Creating a “Hello World!”app in 1,2,3
We have finally arrived at making real life applications. Here are the various steps to take in creating your first application:
Open your Xcode editor and create a single view iOS application, name it Hello world and make sure you disable the classes option to make the size of the app fit the iPhone size more appropriately.
Next you want to go and locate a button object and place it onto the storyboard layout to indicate where the button would go with respect to the view of the phone. Edit the label to your button to say Hello World. Then you want to code your button.
Coding the button would include creating a method that would send a message to the application to produce a function. You would write an IBAction is really meant to focus on the method at hand. IB stands for Interface Builder and the Action is calling the method. IBOutlet is an indicator to associate the instance variables with the elements in the prototype cell in the storyboard. IBOutlet is a name to let the prototype cell know that it can make a connection.
Next you want to connect the Hello World Button and the showMessage method we created. To do this we have to hold down the control button and click and drag the button icon until we connect with the view controller icon, as you hold it over, you let go and little screen will pop that will ask you to make the connection for you and you would click yes.
Then you hit run and it will successfully build your Hello World app!