Coding the Hi Globe Icon
You now’ve completed the UI of the HelloWorld app, you need to create some signal. In the cast navigator, try getting the ViewController.swift file. Because most of us initially picked the application challenge template, Xcode previously made a ViewController classroom inside ViewController.swift data. This file is truly from the thought controller through the storyboard. In order to showcase a communication whenever button is stolen, we’re going to include some signal within the document.
Choose the ViewController.swift file. The manager community promptly exhibits the origin code. Put the following contours of code within the ViewController type:
Your very own source code need to look similar to this after modifying:
The things you bring merely carried out is definitely included a showMessage(sender: UIButton) way when you look at the ViewController type. The Immediate code around the strategy is a new comer to one. I’ll explain they for your needs over the following section. Meanwhile, just think about showMessage(sender: UIButton) as an action. The moment this actions is known as, the neighborhood of code will advise apple’s ios to show a “Hello World” content on screen.