Muneeb Rehman Muneeb Rehman -5 years ago 119
Swift Question

Unable to get the concept of popping navigation control in current class


So in above line i am having confusion that why I am getting navigation controller instance in the current class. According to the storyboard, navigation controller is present outside this class, but how come are we accessing the navigation controller in the current class?

Answer Source

The current viewController is being managed by the navigationController.

You could think of it in a similar way to a parent / child relationship. The navigationController is somewhat functioning like the parent of the viewController.

That property provides a reference to the navigationController provided it exists. In the same way you can say view.superView to access the parent view that the current view is inside.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download