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.

What happens to local content in the new era of digital media?

IMG_2321

Thirty years after this taken photos once again look like this. But will the kind of local content these kids grew up with return as well?

This past winter I was visiting my parents. One evening we were all sitting around the dining room table, having coffee and tea, each of us tuned into our own digital devices. I had my MacBook out and was working on some Swift code. My mom had her tablet out and was busy texting and scoffing at the days Facebook drama. And my dad had a small laptop out and was busy watching a stream of the local evening news.

That moment really stuck with me, for a few reasons. To start with my parents are not cord cutters or techno-nerds. I still remember the years of resistance my dad put up before he finally replaced our BetaMax video cassette player with a VHS one (which was by then only a few years before DVD’s would hit the market). It is not that they are luddites, but they have always, even when they were younger, had a resistance to new technologies. They would never adopt it until it was absolutely necessary. That they had seemingly overnight begun to drop a lot of their traditional television viewing for time in front of their tablets and laptops was a clear sign the true mainstreaming of digital distribution was beginning. Read More

Book review: Objective-C for Swift Developers by Paul Hudson

A few months ago I was on Twitter talking about the frustrations I was having with trying to get an Objective-C based API, that had no Swift documentation or source code examples, to work properly in my all Swift project. Having only learned Swift trying to figure out Objective-C and all it’s quirks was proving to be a long, tedious exercise. During the chat that ensued I made a comment to the author of Objective-C for Swift Developers, Paul Hudson, that he should write a book that would help those people who only knew Swift and wanted a guide on how to work with Objective-C at a basic level. I also requested that if he could find a way to make Objective-C simply disappear altogether that would be even better.

Fast forward to the present. Objective-C still lives on, but Paul did write Objective-C for Swift Developers, available in digital form for US$20, which has just been released into the wild a few days ago (as of May 13 to be exact). While I have no immediate need for the book I picked it up straight away because I still want to know some of the fundamentals of Objective-C and I was really curious to see if this would serve as a the crash course book I wanted a few months ago. Read More

NSNorth 2016: An Apple Developer conference about people and ideas.

Last week, April 28 – 30 to be exact, NSNorth was held in a conference space attached to the St James Cathedral located in the heart of Toronto. Minutes from the subway, with streetcars buzzing by every minute, surrounded by the dense and rapidly evolving urban core, and next to a small city park, the setting showcased all that is great about Canadian cities. This might seem irrelevant, but in fact, it mattered a lot. But before diverting too far off track back lets get back to talking about the conference.

For those that do not know NSNorth is the largest Apple developers conference in Canada and has steadily been gaining a reputation as one of the best on the calendar each year. I won’t go into every detail of what took place, you can go to NSNorth.ca to see what all went down, but I’ll give a quick, high level overview here. Read More