On the iPhone, we can simply use (void) viewDidAppear:(BOOL)animated;
to perform actions when a view becomes the focus. In some events, we have a modal view with another modal view on top of it and, on the iPhone, closing the topmost modal view will fire the viewDidAppear for the lower modal view.
This is not the case for the iPad, as the view stays "visible" even though it's behind another modal view. Is there any way to tell from within a UIViewController when the view itself becomes the active view?
Can't you just use when the modal view controller's view disappears? When the modal view's controller recieves the viewWill/DidDissapear you know that the original view is visible again.
EDIT: in the viewDidDissapear of the modal viewcontroller add this:
[self.parentViewController viewDidAppear:animated];
This will make the viewDidAppear method be called as it is on the iPhone.
You don't need to set self.parentViewController at all, as it is done for you in the presentModalViewController method (the one your use to display the modal view controller)
try checking the value of [theUIView isFirstResponder] it should be True for the view that has the focus of the keyboard, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With