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