Swift UI special training 4 scene transitions-transitions

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.