How to make your first “Hello World!” program in Swift

Our 1st program is : How to make your first “Hello World!” program in Swift.

Like any other language we are going to start our first program by printing or showing “Hello World!”

All you need to make iOS app is knowledge of Objective C or Swift and a Mac with Xcode installed. You can download Xcode from app store. And it will be found later in your application folder or you can search it in spotlight.

  1.  Open Xcode it will look like this. Then select “Create new Xcode project”.

Screen Shot 2015-06-24 at 4.37.41 pm

 

2. Then select “Single View Application”. We will use rest types later.

Screen Shot 2015-06-24 at 4.40.50 pm

 

3. Give your project a name like “HelloWorld” and then save it in any folder you like.Screen Shot 2015-06-24 at 4.41.05 pm

4. Select “View Controller” from your left and then write some code. Here i wrote a code to display “Hello World” with a message using alert view. Write below code in viedDidLoad() method.

 

 

Screen Shot 2015-06-24 at 4.41.21 pm

5. Now user Cmd+R or press the Play button on left top corner. A simulator of iPhone6 will pop up and display an alert view containing title and message written all by yourself.

Screen Shot 2015-06-24 at 4.41.36 pm

6. Congrats on your first iOS App. Cheers.

Next Time we will see “How to Create simple tableView using UITableView in Swift“.

Add a Comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.