How to teach yourself Swift in 8 days
I don’t recommend this approach
My final project at Dev Bootcamp was an iOS app called breadCrumbs. We had just spent 15 weeks on Ruby and Javascript. No one in my group of three knew a thing about Swift, other than that it replaced Objective-C, and it was what you had to use if you wanted to make an iOS app.
You will probably have more than 8 days to teach yourself Swift. I am still teaching myself Swift, and if you look at the breadCrumbs repo, you’ll see that while the Swift we wrote worked, it wasn’t great, but it got the job done.
Where to start (don’t forget about Xcode!)
So you say you want to learn Swift? Where should you start? Here’s what I did:
First, I checked the app store to see if there were apps I could use to learn a bit of Swift on my commute on the subway. I found a great little app called swifty. It teaches you the very basics, and the first few lessons are free. I thought it was well worth it to shell out for all of the lessons. The interface is clean, and whoever wrote it had a pretty good sense of humor.
Next, I downloaded Apple’s free iBook on Swift. To be honest, I didn’t read past the introductory chapter. Not because it wasn’t interesting (it was), but because I didn’t have time. I’ve picked it up again, and it is a great free resource, straight from the company who created Swift.
Then I did this: youtube, youtube, and more youtube. There are a TON of videos on youtube about developing apps for iOS. Swift is only a couple of years old, so check the date on the videos: older videos will be about Objective-C, not Swift. The thing about developing in iOS is that you don’t just need to learn Swift, you need to learn the IDE (integrated development environment) that is used to build iOS apps, and that’s Apple’s Xcode. Unlike in prior years, Xcode is free, so go download it now, because you know what turns out to be a lot harder than learning Swift? Learning Xcode. Xcode is a phenomenal tool, but the interface is overwhelming and takes awhile to get used to. This is where youtube comes in: you’ll learn a bit of Swift on the videos, but you’ll also watch someone using Xcode. I recommend the whole series from Code with Chris.
Given my 8 day schedule, I moved on from youtube to the more focused courses on Treehouse. Not gonna lie, I’m a Treehouse evangelist. They gamify learning by giving you points (I love points), their videos are excellent, and their practice projects are challenging (please just don’t pass off one of their projects as a project of your own). The downside of Treehouse is that it isn’t free; the upside is that the first month is free, and you can suspend and reactivate your membership whenever you want. I found the Treehouse videos and exercises on Swift and iOS development to be as high quality as the rest of their content.
Playgrounds: Finally, Xcode has this cool thing called playgrounds, which are sandboxes for Swift. If you use Ruby, think of it playgrounds as a slower version of IRB (seriously slow). Open up Xcode, open a playground, and play around with Swift. Swift looks a lot like Javascript without the semicolons, so even if you know a tiny bit of Javascript, you should be able to write a tiny bit of Swift and see what your code returns in the playground.
Good luck! If you have any other good resources for beginners learning Swift, please let me know in the comments.