Swift UI special training 23 setting up delegates and keyboard return

Source: Internet
Author: User

In the first few words we took care of the layout, this word we have to add all the references, is connected to the controller

Uiviewcontroller {    @IBOutlet weak var textfield1:uitextfield!    @IBOutlet weak var web1:uiwebview!

Then the agent, first look at our mobile phone scene interface three buttons:


The first button is the controller itself, the second button is the first reaction of this interface, the first reaction of our interface is the URL of this box, the third button is to exit.

When we choose the agent can also be connected by the way, only need to drag the delegate to the first button on the line:


Second, you also need to add a proxy in your code:

Class Viewcontroller:uiviewcontroller,uiwebviewdelegate
The text box also needs to add the agent, because when we enter the screen will appear a keyboard, the keyboard is another component of the system, press ENTER after the input is complete, we need to detect press ENTER this action, use the same action to add the text box proxy. If you are working with an event of a view, you must add a proxy.

Swift UI special training 23 setting up delegates and keyboard return

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.