Swift tutorial for beginners Part 1

Developing iOS Apps Using Swift

Fabio Rocha
Jun 3, 2014 · 3 min read

So as you all may know, Apple just just announced Swift for iOS 8 (not Taylor Swift), which is kinda exciting since Swift looks so easy to learn! In this part of the tutorial I will only cover some simple aspects of the new way of coding iOS.

“Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility”

Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/pt/jEUH0.l

First things first, make sure that you’ve download Xcode 6 from https://developer.apple.com/ and create a new project.

Create an Empty Application, we will start from scratch

Make sure that you select “Swift” as coding language:

Creating new project on Xcode 6

We will end up with something like


As you may see, this has nothing to due with objective-C, but at the same time the structure keeps the same for AppDelegate. Also we have lost the Header file (.h), and now we only have a single swift file.

Lets add a Root View Controller and see how it goes ☺

Setting root view controller on Swift

And finally, build!

Test build for our app

For the ones with web development background, some things on Swift will look a lot like Javascript, lets compare variable assignment:

This is what Objective-c array definition looks like
This is how Swift array definition looks like

Did I mention how easy it is now do manipulate Strings with Swift?

Also you may have noticed that now we have let and var, the difference between them is that let defines a constant and var defines an usual variable.

On the next part of this series we will learn how to define a class and we will create a simple app.

Meanwhile you can take a look at this awesome Cheat sheet from @rwenderlich

See you later!


Swift tutorial for beginners

Tutorial to develop apps with iOS and Swift

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store