In the last word we created two scenarios, and we wanted to make a transition between the two scenes. We just need to add a navigation bar. Select the table View controller that we created in the previous session, click Editor on the toolbar, select embed in (embed), select Navigation Controller,
After embedding, a navigationcontroller appears on the left side of the storyboard, and an arrow connects to our Tableviewcontroller.
At the top of the Tableviewcontroller, an area will be vacated, and we can name it, for example, I'm named "Restaurant ranking", add a button to the left and right of the navigation bar, and go to the control to find Bar button Item, which is specifically used on the navigation bar or toolbar.
Drag it to the right side of the navigation bar, edit it in the property editor, it has a number of types, if you add a button, select Add, the button will become a plus. Add an Edit button again
Post-run effects
We see the storyboard in English, and after the run is Chinese, which is the localization effect set in our first speech.
Similarly, add a navigation to the list of new restaurants, set two buttons in the navigation bar, a "done", and a "cancel". Next, click the plus sign in the first scene to jump to the second scene. Like the way we wired before, we need to control-drag a line from the plus sign to the second scene in the Navigationcontroller, which shows the following options, which represent different transitions, such as direct display, pop-up, and so on, select, show. Run to see if you can achieve the transition by clicking on "+". If you delete the confirmation and return button of the new scene, there will be a default return button after the transition, and click to go back to the first scene.
This is the performance of the stack. Because we want to preserve the functionality of the new restaurant, add the two buttons and change the mode to the third one:
It becomes a pattern that must have input to return, and you can see that the scene is slipping from the bottom of the screen when the transition is made.
Swift UI special training 4 scene transitions-transitions