1. Let’s continue with the content of the previous lesson
Where did we talk about the last lesson? Is it a summary of this navigation controller?
Then, the precautions for using
2. Precautions for using navigation controller:
1) The first point is to use the navigation controller. When you create it, you need to assign it a root controller.
When creating a navigation controller, specify its root controller
2) The second point: When we display other controllers, how do we display it? Is it displayed in the form of push? But when you push, can you push directly?
When displaying the next controller, what do the steps look like?
a. First of all, the first step is to create a controller to be displayed, right?
Create a controller to push to
b. Then, after creating the controller, can you push it?
Then, when pushing, you need to get the navigation controller of the current controller.
After obtaining its controller, you can push it.
When pushing, you need to obtain the navigation controller of the current controller to perform the push operation.
3) Then, this is our push, and when returning,
return:
When returning, I just showed you the two situations, right?
a. First, the first one is to return to the previous controller: popViewControllerAnimated
When this pops up, do I also need to specify its controller?
This is unnecessary. When it returns, it will directly help you return to the previous controller.
Then, I will explain to you later why, it can return to the previous controller,
b. Return to the root controller: popToRootViewControllerAnimated
c. In fact, there is a third situation, which is called returning to the specified controller.
Let me write it out first. Later, I will explain to you why you can return to the specified controller. Then, the method is called