Review of Mastering Swift 2

Category: Reviews
Review of Mastering Swift 2

At the Worldwide Developers Conference (WWDC) in 2014 Apple introduced new programing language Swift. Swift can be thought of as Objective-C reimagined using modern concepts and safe programming patterns. In Apple's own words, Swift is like Objective-C without the C.

At that point of time I was thinking to start learning new programing language and shifting towards mobile development from web development (PHP as my main language).

I had few attempts to learn Objective-C but it was way too different with its syntax compared to PHP, Java and ActionScript.

With the new Swift language introduced I started to investigate, play around with code and with some basic applications. Later I did lots of readings and watched tons of online tutorials.

I was fascinated by this new and modern programing language. The development environment – Xcode 6 looked beautiful, fast, and modern. Well this is not unusual. Apple products – hardware and software – they all literally shine!

At the WWDC in 2015 Apple introduced Swift 2.

Swift has been refined from the ground up. It generates faster code across the board, both for release and debug builds. The additions include syntax improvements and improved Error handling.

With the release I started to learn more about the updates and improvements that have been made in Swift 2.0. There have been many resources but still because of lack of time and poor explanations I didn’t have a chance to learn more about them.

I headed to www.packtpub.com, searched for Swift 2 and discovered the upcoming book Mastering Swift 2.

So recently I got my hands on the newly released Mastering Swift 2 (released November 2015) by Jon Hoffman and published by PacktPub.

I was excited. I instantly downloaded my copy of e-book and just wanted to take a quick look at it before evening to dive in. Well later I realized that I spent my one hour lunch break reading Mastering Swift 2.

By the time of writing this review I’ve covered the whole book and I can say that it’s been the most pleasant and exciting ride I’ve ever had with reading any book.

I guess I can compare it with the feelings when I was a kid and watched Spider-Man movie with Tobey Maguire and Kirsten Dunst on the big screen for the first time. For a month or two I was in the Spider-Man world and since then I still love Spider-Man.

Now let’s get serious.
This book is perfectly written. The author describes and explains everything the way it makes clear even for a novice.

My purpose with the book was to once again go through basics of Swift and learn about the new stuff that has been added to version 2.

To be honest I expected much less then this book really offered.

One of the most important stuff incorporated into Swift 2 are protocol extensions. In the first version of Swift, it was possible to extend the functionality of existing class, struct and enum types. Now with Swift 2, you can extend a protocol as well. I never knew what Protocol-Oriented programing was. While it may only seem like a minor feature at first, protocol extensions are extremely powerful and can transform the way you write code. This books explains it and even tells you how to use protocol extensions and why you would want to use protocol extensions in details.

Error handling has been revamped in Swift 2. Instead of NSError objects and double pointers, they moved to a new system that looks similar to exception handling. If I didn’t read this book I would know nothing about error handling in Swift 2 in such details. And probably my code would be more prone to bugs and security problems.

One thing worth of noting is that you can read about all of the new features elsewhere, but the way of presenting this information and “teaching” is outstanding by Jon Hoffman.

This book covers all of the main features of Swift and gives you great explanation. It also covers topics such as working with XML and JSON, working with NSURLSession. This book has got everything.

I could write much more about the contents of the book that makes almost 400 pages and after some time you would think – “I should probably read it, guess its worth of it”. I can tell you straight away that it’s a MUST READ book for everyone, novice and expert.

Conclusion

If you are starting with Swift now, I’d like to tell you that after research I have done this is the right time to dive into Apple programing world, and the right place is Mastering Swift 2. If you are an experienced developer grab this book to master Swift 2. I bet you’ll make many discoveries.

Once again, I'd like to mention that this has been one of the most exciting journey's I've ever had with the programming book.

Code samples with the theoretical explanations – I would say - "Bravo!" to the author and thank PacktPub for publishing this book!