What UINavigationController
event can be overridden to get access to current view controller?
My end goal is to check the current screen in the Navigation Controller to determine whether or not to call SetNavigationBarHidden
.
What UINavigationController
event can be overridden to get access to current view controller?
My end goal is to check the current screen in the Navigation Controller to determine whether or not to call SetNavigationBarHidden
.
How about having a UINavigationController subclass adopt the UINavigationControllerDelegate protocol? Then implement the monotouch equivalent of navigationController:willShowViewController:animated: or navigationController:didShowViewController:animated:. Each of these methods passes a parameter which is a pointer to "[t]he view controller whose view and navigation item properties are being shown." You'll have to remember to make the navigation controller its own delegate.
If by "current" you mean "currently visible" you can make use of UINavigationController's VisibleViewController property. Though if you're using MT.D you'll want to cast it out:
var currentViewController = (DialogViewController)myNavController.VisibleViewController
Alternatively you could access the ViewController array directly. Or...you can also subclass DialogViewController and set the NavigationBar.Hidden = true inside the implementation.