Swift UI special training 1 interaction, swiftui

Source: Internet
Author: User

Swift UI special training 1 interaction, swiftui

We all know that IBOutlet and IBAction are available during IOS interface programming. The former refers to the latter as an operation, and the IBAction has a parameter sender, which is used to point to the operation object, the weather forecast applet I released earlier can be seen. If we need a button click event, we can use IBAction, if a Label is used to display objects, use IBOutlet.

Here are some event types in IBAction:

1. Touch Down Inside: Touch, even if we don't Touch it, it triggers the event.

2. Touch Up Inside: lift off, and 1 is different, after the Touch is carried in the original position, trigger the event

3. Touch Up Outside

4. Edit/Change: edit the language, background, and system settings.

The second type of event is commonly used.

Interaction can also be applied to navigation, which means switching between multiple pages. NavitationController I have applied a lot in the Swift IOS development War series. If you are interested, please take a look. Now we are talking about some of the features of navigation. navigation has a navigation stack, and stack is characterized by backward first-in-first-out, so the page arrangement is the same. This is also in line with our usage habits.

In addition to navigation, we can also use the Segue in storyboard to transition from one page to another. It can also be called traversing. The transition consists of three parts: Display, reverse, and modal pop-up.

Display: From the first page to the second page, use push to append, and use replace to replace.

Mode: it is a pop-up. For example, you need to enter the account and password for your program. If you do not enter the password, you must close it.

Reverse: move back to the previous scenario.

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.