Find „Hello planet“ icon and click on the qualities inspector under the service location

Find „Hello planet“ icon and click on the qualities inspector under the service location

Programming the Hello World Icon

Now that you’ve complete the UI on the HelloWorld software, it is time to create some code. During the project navigator, you should find the ViewController.swift data. Because you in the beginning picked the application plan template, Xcode already produced a ViewController classroom inside the ViewController.swift file. This file is actually associated with the point of view operator through the storyboard. Being highlight a note when the button is definitely used, we’ll include code on the document.

Select the ViewController.swift file. The editor program location straight away exhibits the origin signal. Add the subsequent phrases of code within the ViewController course:

Your very own source-code needs to look similar to this after editing and enhancing:

Everything you have actually just done try put a showMessage(sender: UIButton) technique for the ViewController class. The Immediate rule within the method is a new comer to you. I most certainly will explain they for you personally next phase. Meanwhile, merely look at the showMessage(sender: UIButton) as a motion. When this activity is referred to as, the neighborhood of signal will instruct iOS to display a „Hello World“ content on screen. (mehr …)

Weiterlesen Find „Hello planet“ icon and click on the qualities inspector under the service location