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.