Getting Started With Building iOS Apps in Swift

I was very excited when Swift was out because the language seems very modern in that it remainds me of Python a lot. So I picked up a project I was working on and started to build an iOS app from it in Swift.

Swift didn’t disappoint. I like the language a lot and now that it’s open source, I think it’s only going to become better and more popular.

The following tools and resources help make things easier for me when I was developing my first app. Hope it will be of help to someone else as well.

Tools

CocoaPods

For managing dependencies, I find CocoaPods extremely useful. All popular libraries seem to support it.

Libraries

There are a few libraries I found very useful when I develop my first iOS App. I’ll briefly introduce some of them here.

Alamofire

If you use Python, think of it as something like requests. Or if you ever used jQuery before, it’s like its Ajax APIs. Alamofire simplifies how your app talk to your server and you get to write less (and more robust) code. Fetching JSON response from the server is as simply as:

1
2
3
4
5
// from https://github.com/Alamofire/Alamofire
Alamofire.request(.GET, "https://httpbin.org/get")
.responseJSON { response in
debugPrint(response)
}

SwiftyJSON

This library is super useful when you need to parse JSON data. I use it along with Alamofire.

NVActivityIndicatorView

This library has all the loading animations you need! I use it in two places in my apps: 1) when loading a webpage 2) while Alamofire is fetching data from the server to populate a table.

Locksmith

If you ever want to incorporate in-app purchases into your app, you’ll probably find this library useful. It makes working with keychain painless. Saving some information into the keychain can be as simply as doing this:

1
Locksmith.saveData(["some key": "some value"], forUserAccount: "myUserAccount")

Resources

Stack Overflow is as useful as usual, but having to add swift to the end of every search query is super annoying… Besides Stack Overflow, I found the following resources useful as well:

Awesome iOS

Awesome iOS lists all kinds of iOS development related resources. You’ll probably find a library to use on there in your project.

iOS weekly

It’s a weekly newsletter that gathers iOS development links. I always find something interesting from it every week.

Under the radar

This podcast talks about various topics in indie iOS development such as App marketing and pricing model. I highly recommend it. Marco also has another (and probably more popular) Podcast called Accidental Tech Podcast.

iOS bytes

This is a podcast from code school that talks about what’s happening in iOS community every week. It also talks about blog posts and frameworks/libraries.