Beginner Series: Swift Tutorial
What is Swift?
Swift is a young programming language developed by Apple for use with many of their products including iOS, OS X, watchOS, tvOS and Linux.
Apple first introduced Swift at their Worldwide Developer Conference (WWDC) in 2014. Up until then, Objective-C was the main development language for Apple’s platforms. Since Objective-C was first created back in the 80s, it was time for a change.
Apple created Swift with the focus that it would be easier to work with, more resilient to erroneous code, and more concise.
At the WWDC 2015 conference, Apple unveiled Swift 2.0 the latest build of the language which brings several enhancements. The most obvious change is that Apple has made Swift open-source, allowing the use of the language on Linux and Windows platforms.
Still, it’s important to understand the limitations of the language, particularly that you still need a Mac to develop in Swift.
Why Did Apple Create Swift?
Apple did not abandon Objective-C altogether. Developers are still free to create applications and programs with the language, in addition to Swift. However, there are several reasons why Apple created Swift for the modern generation.
In layman’s terms, Objective-C is a very difficult language to learn. This means that inexperienced developers are likely going to shy away from it, instead focusing on much easier languages to get their feet wet. Because Swift is much easier to write and infinitely easier to learn – it means that the platform will see a huge boost in the number of developers that are willing to work with it. Naturally, this translates to more support for Apple’s platforms and products, so it’s a win-win scenario for them.
Objective-C is old. 2014 was the language’s 30th anniversary since inception. It was long overdue for Apple to introduce a more modern language for their platforms, which came in the form of Swift. This means that Apple can do a lot of innovative and fresh things with Swift, as opposed to Objective-C which has largely had its methods set in stone – for a long time now.
Finally, since Apple is responsible for the creation of Swift they can influence how it develops over time. This is exciting for not only the future of the language but also their platforms. They now have the flexibility to change, add, and update functions of the language. As their ecosystem grows, this is incredibly important because it means they have more wiggle room in terms of what they can do, and what features they can add.
Plus, Apple wants to get a leg up on Google’s Android OS. With the previous setup porting iOS apps to Android was relatively easy. This is because there is no lack of tools that allow you to port Objective-C apps to Java. Developers who work with Apple’s platforms have a fairly easy way to move their apps cross-platform.
Swift, on the other hand, is more difficult to port apps from and the process to do so is incredibly time-consuming. So, the more developers that create products for Apple’s ecosystem in Swift means more exclusive content.
What are the Requirements for Developing With Swift?
You need a Mac with the latest version of OS X in order to work with Swift. That means, if you want to build an iOS or OS X application, you’ll need to do it in Apple’s ecosystem.
How is Swift Used?
Even though the most recent build of Swift is open-source, it is primarily meant to be used for Apple’s iOS, OS X, watchOS, and tvOS platforms.
Apple uses the language to build their operating systems for their products. Developers, on the other hand, use Swift to develop mobile applications and programs for these platforms.
Next, we’re going to talk about the Benefits of Learning Swift.
Recommended Training – Treehouse
Although this site recommends various training services, our top recommendation is Treehouse.
Treehouse is an online training service that teaches web design, web development and app development with videos, quizzes and interactive coding exercises.
Treehouse's mission is to bring technology education to those who can't get it, and is committed to helping its students find jobs. If you're looking to turn coding into your career, you should consider Treehouse.
Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.