A Step-By-Step Guide To The Programming Language Swift

Rosie Allabarton

Do you keep hearing about Swift? Do you want to know more about it? Then you’ve just discovered exactly the right article! Today we’re going to give you a complete introduction to what exactly Swift is, and why it’s so important for app developers. Not only that but we’ll be providing info on the best places to learn as a beginner, a list of great online resources on iOS development and mobile app programming, and the low-down on what you can use this sought-after programming language for.

What is Swift?

Swift is a general-purpose, multi-paradigm, compiled programming language created for iOS, OS X, watchOS, tvOS and Linux development by Apple Inc. It is an alternative to the Objective-C language which was the recommended and most popular language for building apps for Apple’s ecosystem of devices.

Swift, rightly named after the Swift bird (which is among the fastest fliers in the animal kingdom), was developed to be a faster alternative to Objective-C. Other than speed, Swift offers other advantages over Objective-C, including ease of learning, safety, requires less code, is interactive, among other things.

For beginners or those completely new to the field, I’m going to be explaining Swift and and Objective-C in more detail so you know the advantages and disadvantages of each.

Compared to Objective-C, Swift has a simpler syntax that makes it easier to learn for beginners or for anyone coming from another programming language. The language took language ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list. This means that programmers coming from other languages or from other platforms (such as web development) will find a lot of concepts in Swift similar to what they were used to.

Swift is also easier to read and maintain that Objective-C. In Objective-C, you have to maintain two code files for each class you write — a header file with a .h extension and an implementation file with a .m extension. Sometimes changes made in one file affect the other, so you have to make sure to keep the files in sync. Swift, just like other programming languages like Java, C#, JavaScript, etc. manages with just one file.

Objective-C’s syntax is quite verbose. It is also quite different from other programming languages. Take the below code comparison as an example. The first two statements shows some code in Objective-C and the other two statements shows the same code in Swift.


NSString *str = @”hello,”; str = [str stringByAppendingString:@” world”];


var str = “hello,” str += “ world”

If you are coming from another programming language, you will be able to understand the second piece of code as it is similar (with slight differences here and there) to how variables are declared in other programming languages. Even for a beginner, the second example code seems less intimidating than the first.

Swift is still a rather new programming language but its popularity and adoption has been increasing faster than any other language. It is now the most popular language to develop for Apple devices. Some popular apps built using Swift include Lyft, Khan Academy, Clear, Sky Guide, LinkedIn, Strava, Yahoo Weather and Hipmunk. Because it was open sourced by Apple, we are bound to see its use spread to include development for other platforms other than Apple devices. As of now, there is already a compiler for it for Linux. This is a huge step-up from Objective-C which could only be used on a Mac OS machine. Swift was released under theApache 2.0 license, which means developers can use it as they like — even in commercial products.

This is still really new and speculative, but rumor has it that Google might be considering making Swift a “first class” language in Android development. This would be good news to anyone who already knows Swift since porting their app to Android will now be an easier process that won’t require acquiring additional skills. Facebook and Uber are also apparently looking to make Swift more central to their operations.

A benefit of Swift is that it can serve as both a forward-facing language as well as a server-side one. For a product like Facebook, that’s beneficial; apps and servers can speak to one another seamlessly, and it potentially gives the company a wider scope to write APIs for services.

Swift is still evolving and it will be interesting to see what it grows up to be and what it will be used for in the future. Since its announcement at WWDC 2014, Apple developers have continued working on it, releasing incremental versions. Swift 3.0 is expected to be announced at this year’s WWDC 2016 conference with an official release set for Fall. The major goal of this release is said to be portability, meant to make it more portable to other platforms. Whatever the future has in hold for Swift, its growth and popularity has increased job demands for it. It is a good time to be or to consider becoming a Swift developer.

Where to start when learning Swift

There are numerous resources you can use when learning Swift. We cannot give an exhaustive list, but we’ll mention some resources that you might find useful.

  • You can also find some free and premium courses online to learn from. Some of them are: Stanford’s’ CS193P iOS Development Class (this is available on iTunes for free. The only disadvantage is that the latest class posted is on iOS 8. It’s still useful in learning Swift though), Hacking with Swift is a Swift book that is free to read online, with premium options for offline viewing, Coursera offers some courses on iOS development that are free to take with premium options for code review and certifications, Udacity offers free video courses on iOS development with premium options for mentorship and certification.

Further reading

What You Should Do Now

  1. Get a hands-on introduction to web development with a free, 5-day short course.
  2. Become a qualified web developer in 4-7 months—complete with a job guarantee.
  3. Talk to a program advisor to discuss career change and find out if web development is right for you.
  4. Learn about our graduates, see their portfolio projects, and find out where they’re at now