Navigation Application - Back Button

When we click the back button in the navigation view, is there any method (delegate) that is called on the current view controller before pulling it from the stack and clicking the next one on the stack?

+3
source share
2 answers

The only methods available are viewWillDisappear and viewDidDisappear in the viewController controlled by the UINavigationController. Perhaps you can check the size of the property of the viewController UINavigationController array and compare it with the last known -count. If there are more controllers in the stack, you know that something has been pressed. If there are fewer, something popped up.

+3
source

-back: (id) , , , , :

    [[self navigationController] popViewControllerAnimated:YES];
+2

Source: https://habr.com/ru/post/1772942/


All Articles