ViewWillAppear is not calling at the dismisal of modalview controller

Viewed 51

I have two class A and B .

class A{ 

override func viewWillAppear(_ animated: Bool) { . 

print("")
}

     let myPost = self.storyboard?.instantiateViewController(withIdentifier: "Completed") as! Completed

        myPost.transitioningDelegate = self as? UIViewControllerTransitioningDelegate
        myPost.modalPresentationStyle = .custom

        self.present(myPost, animated: true, completion: nil)

}
class B{ . 

 dismiss(animated: true, completion: nil)
}

Here I am presenting class B from class A. But when I am dismissing class B the viewWillApper (in class A) is not calling. How to achive this?

1 Answers

You can use viewdidload() or awakefromnib() to be called when you present other contollers like A from B or B from A

Related