Book review: iOS Apps with Rest APIs: Building Web-Driven Apps in Swift by Christina Moulton

hero

Just a little over a year ago I was exploring whether to use some geo-based REST APIs in a prototype application I was working on. Right away I encountered two problems. One, I was still new to Swift and iOS development in general so I had no idea how to work with REST APIs. And two, there was a limited amount of Swift related information on the topic at the time as the knowledge base for the language was still in the very early stages at that point. Then I came across the book, iOS Apps with Rest APIs: Building Web-Driven Apps in Swift by Christina Moulton, priced at US$29.00 and available in digital format only. Right away I realized that this was exactly the resource I was looking for!

However, a few days after I started reading the book I came to the conclusion that the APIs I was researching were not going to provide me with what I was looking for. So I put the book aside and moved on to other things. Fast forward a year later, armed with a much deeper and richer knowledge of Swift and a new found need to use a REST API in an app I am working on called Cnvrt I picked up the book again and was able to fully dive right into all the RESTful goodness it was going to attempt to teach me.

What the Book is About

iOS Apps with REST APIs is very much a practical book, so if your interested in something very theoretical that will help you create “clever” code than this isn’t likely the book your looking for. The book does also assume at least an intermediate level of knowledge of Swift or object-oriented programming principles. If you are not at that level you can still work your way through it, but it will be something of a struggle.

The author, Christina Moulton, has written it in such a way that each chapter is essentially a tutorial for the topic she is covering. You can follow along and copy what is being done, or you can read through it and apply the same principles into your own project and code as you go along. This structure is really what lends the book to being a modern day Time-Life DIY Guide to REST APIs.

While there are officially 19 chapters in the book it can better be broken down into these 5 sections: Introduction, JSON Parsing and Network Calls, Tableviews and how to make it all work with your API Data, OAuth..the UI…and you, and Leveling Up your coding skills with advanced JSON and REST API topics. While each section or chapter is not completely independent as you will need some prerequisite knowledge to follow along if you skip ahead, you also do not need to read the book from start to finish in order for it to be effective. If what matters to you most when you first pick up the book is that section on OAuth then you can skip ahead and start there without too much worry.

The writing style is not formal in the way academic writing can be, but not casual either. JSON and networking is not an easy topic to make lively and exciting to read so the author has probably done as much as she can to make the reading “fun” while still conveying all the necessary details and instructions.

The pace through each section felt just about right for me. There is just enough detail to keep the topic moving, and the number of times I had to flip back to reread a few of the previous pages because the content was not clear was minimal. Of course everyone is different in terms of experience and learning styles so this might not be the case for all readers.

The layout of the book will not win any design awards, but it does the job. Code blocks are in colour so this makes it easy to read through them. As you would expect in a digital book any links are hyperlinked directly in the body of the text. The font does sometimes seem to be a bit compressed and could use some breathing room, but when you are reading on a retina screen this is really not a big deal.

The code and examples have all been updated to Swift 2.2 and will presumably be updated to Swift 3.0 when that is released. Of course one of the benefits of digital books, especially for books covering Swift which is still evolving a lot, is that you can get updates of the book as the language changes, keeping it relevant to the reader (if the author choices to do so of course). One element that I really appreciate is that the code is very Swifty with guard and switch statements being used extensively, making for very readable code. This is a trend I hope to see all books covering adopt.

How effective is the book?

The key measure of any book like this is how effective is it at teaching the subject. After sitting down for a few days and going through the book I had no problem working with a REST API and creating my own code to parse the data. I was able to handle errors properly and deal with the consequences of a network connection or a server not being available. And of course I got the data to be displayed in a tableview and any values that needed to passed around between view controllers were able to move around as required.

For experienced developers this might seem pretty simple. But for someone just tackling REST APIs and working with network calls for the first time this can be incredibly challenging to get right as the details are critical! That said what made it effective for me was having one of my own projects to directly apply what I was learning to. You can follow along with the tutorials and do them yourself, but it is usually when you apply what you learned into real world code that it really sinks in.

TL;DR

If you are working on a Swift project that uses REST APIs, but it is something new to you and you need a resource that is going to teach you how to use and implement them in a real world project this is likely going to be just the resource you are looking for. It is straight forward, and to the point, in what it is trying to teach so there is no wasted time on irrelevant topics. It does mean that you have to be very confident in your Swift or object oriented programming knowledge to get the most out of the book. When I read the book the first time it was a challenge (though not impossible either) to understand what was being taught, but going back to it with another year of Swift experience made it many fold more effective and useful, and ultimately a great value at the price being charged for it.

One final note. There are a few other packages available beyond the standard book. One includes an expanded edition along with a TL;DR version that is even more concise and to the point than the standard edition. It also includes a Adding More API Calls Guide. I have not reviewed this package but for those who need to go into even more detail than the book covers this could be an excellent investment. There is also a team license for settings where many developers would get use from the book.

Christina is currently sailing around the Caribean but she still shows up on Twitter from time to time and you can find her @Christinamltn. As always you can find me @third_beach and if you want to simply know when I add a new post on manitoba.ninja you can follow @manitobaninja.