iOS

Creating Hello World App in Swift Using Xcode 6


The Hello World tutorial was the first programming article written for our iOS programming course. As Apple released Xcode 6, the tutorial is no longer up-to-date. We received quite a lot of emails about the tutorial update. So here you are. Instead rewriting the same tutorial in Objective-C, we’ll show you how to create the Hello World app in Swift. What’s more, we create a screencast for you.

If this is the first time you come across the tutorial, you may wonder why we teach you building a Hello World app. This programming tutorial is written for absolute beginners. We want to encourage you to learn programming. So the first app should be very simple. Despite its simplicity, the “Hello World” app serves a few purposes:

  • It gives you an overview about the syntax and structure of Swift, the new programming language of iOS.
  • It also gives you a basic introduction to the Xcode 6 environment. You’ll learn how to create a Xcode project and lay out your user interface using Storyboard. Even if you’ve used Xcode 5 before, you’ll learn what’s new in the latest version of Xcode.
  • You’ll learn how to compile a program, build the app and test it using the Simulator.
  • Lastly, it makes you think programming is not difficult. I don’t want to scare you away from learning programming. It’ll be fun.

You’ll need to use Xcode 6 (or up) to work on the Hello World project. If you haven’t upgraded to Xcode 6, just download it via this direct iTunes link.

Okay, let’s get started.

For your reference, you can download the sample Xcode project from here. I hope you enjoy our first screencast. Feel free to leave us comment and share your thought about the tutorial.

If you like the screencast, check out our new Swift programming book and get the free chapter to understand how the Hello World app works.

iOS
Building Action Extensions in iOS 8
iOS
Building a QR Code Reader in Swift
iOS
Building Your First Blockchain App in Swift
  • Sad

    SadSad

    Author Reply

    A programming tutorial really should not be a video. Please don’t do that in the future


    • Anil T

      Anil TAnil T

      Author Reply

      who are you to tell how something needs to be?


    • Guest

      GuestGuest

      Author Reply

      That’s the stupidest thing I have ever heard, please don’t type retarded sentences like that in the future.


    • Lothar Scholz

      I agree with you, this video tutorials everywhere is really getting out of control.
      It takes a video 10min to explain something i could read in 3min.


  • orit

    oritorit

    Author Reply

    I don’t see the buttons above the storyboard. How can I see it?
    Tahnks


    • orit

      oritorit

      Author Reply

      Found them! I clicked the View Controll above.


      • ff

        ffff

        Author Reply

        idiot


  • Oli

    OliOli

    Author Reply

    I found the video quite useful – this has actually been my first successful app build, so thanks for that!

    I have previous programming experience, but I am struggling to get along with navigating my way round the Xcode environment. I wanted to continue after this section to understand how the app worked, so as per your instruction (“If you like the screencast, check out our new Swift programming book and get the free chapter to understand how the Hello World app works.”), I downloaded the free sample. Unfortunately, it cuts off pretty much where this video ends, so I am none the wiser!

    I understand this is probably because you don’t want to give too much away for free, but if you say something is available for free, then in my opinion it’s good practice to make sure it is!


    • Oli

      OliOli

      Author Reply

      Well, one day on and I’ve received an email containing part two which will apparently explain how the app works… Looks like I was a bit too quick to give a bit of negative feedback on that one, but I didn’t read anywhere that it would be done this way. Oh well, I look forward to reading it!


    • Simon Ng

      Simon NgSimon Ng

      Author Reply

      Oli, there was probably a delay in the email delivery. Please let me know if you do not receive the sample chapter that explains how the Hello World app works.


  • Graham

    GrahamGraham

    Author Reply

    Downloaded latest version of xCode, my first attempt at such things since programming for my Commodore Z20. Apple insists I pay $99 to even start. Way to go Apple. You just lost me…


    • Simon Ng

      Simon NgSimon Ng

      Author Reply

      Graham, you do not need to join the iOS developer program ($99) unless you want to test the app on a real iPhone. Xcode 6 is free for download and you can test the app using the built-in simulator.


  • Hello123

    Hello123Hello123

    Author Reply

    Is it possible to do this on a Windows computer? I dont own a Mac.


  • Larry

    LarryLarry

    Author Reply

    I’m not having much luck getting the showMessage utility to come up on my iMac using the xCode simulator.


  • Eduardo

    EduardoEduardo

    Author Reply

    Hola,
    Me parece estupendo ver un video tutorial de como hacer una app, muchas gracias y espero sigas así.


  • abc

    abcabc

    Author Reply

    I downloaded hello world program but I get white blank screen in ios simulator. When I change background to red, I see black red screen. Seems to me I can’t get button (or label for that matter) to get to to display. What am i doing wrong? I am using macbook pro MD101


    • abc

      abcabc

      Author Reply

      i meant “blank” red screen. Seems I can’t get label/buttons to display no matter where I put it. Is this possible hardware issue?


  • Dominic Pritham

    Great video. Thanks!


  • Dominic Pritham

    I have a question. Instead of having the “welcome” window pop up, what if I wanted the app window to change to another window which displayed an image or more text or any data…how can one go about doing that?


  • yuna jewelewicz

    Hi, great video. At 5:07 how did you add the @IBAction func code? I am having trouble with that. Thanks


  • shittytutorialappcoda

    This tutorial is fucked up, a waste of time. IBAction func just show up without explanation and the tutor is talking “without coding”.. sigh*


  • como acabar com a calvície

    Thanks for Sharing.


Shares