I have a split view based app, and would like to listen for some sort of notification for when the root menu is displayed. The reason I want to do this is because the keyboard overlaps the menu, so I would like to hide the keyboard when the menu is displayed.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
name:<Some Notification Here>
object:self.view.window];
I already have the method to hide the keyboard, I’m just looking for the appropriate notification.
Thanks!
you can post the notification yourself from the root menu. Just subclass it and post the notification on
viewDidAppearorviewWillAppear.The word of warning: if you are targeting iOS 5 and up you should kep in mind the
viewWillAppearandviewDidAppearare deprecated in iOS6. usewillMoveToParentViewControllerordidMoveToParentViewControlleror-(void)viewWillLayoutSubviewsAlso, you can provide nil as a notification name and listen to any possible notification, then NSLog it out, perhaps you can find a useful notification there, just make sure it is documented to futureproof your product.