Review: Swift Development with Cocoa by Jon Manning, Paris Buttfield-Addison and Tim Nugent (Early Release, O'Reilly)




Swift Development with Cocoa: Developing for the Mac and iOS App Stores
Jon Manning, Paris Buttfield-Addison and Tim Nugent
Publisher: O'Reilly Media
Early Release Ebook: September 2014
Pages: 453 (est.)

Is this book for me?

If your ambition is to learn Swift and Cocoa in order to program for iOS and OS X, then Swift Development with Cocoa is aimed directly at you.

The book begins with a bit of background history and some testing and distribution information before throwing us into the details of Swift in Chapter Two ('Programming with Swift'). And while I would recommend reading Apple's Swift book as well for advanced Swift concepts (in particular generics and bridging to Objective-C), it's possible to understand the main parts of Swift from simply reading this chapter. I can also imagine this would be a very useful chapter for a teacher to share with students in order to get them up to speed quickly. In fact teachers could skip over the Preface and Chapter One to get straight to Chapter Two, since this also demonstrates the creation of Playgrounds and so has all you need to get started quickly.

Later, as the book gets into topics like notifications, background tasks, NSOperation and then onto drawing Bezier Paths, the book flip-flops between iOS and OS X in its examples. For people who already have one programming language under their belts and who are used to the vagaries of languages and IDEs (Integrated Development Environments) then this flip-flopping will not be a problem. But it is important to ask yourself before purchasing this book whether you are ready to jump in at this level or whether you should be looking towards an alternative book such as Introducing iOS 8, iOS 8 Programming Fundamentals with Swift or Programming iOS 8 to read before this one so as not to risk being overwhelmed by the learning task.

Initial approach

The book is a good way to enter the two platforms (iOS and OS X) feet first and to immediately think about how your app will be structured and how it will exist as a good citizen on a device. This is because it is straight to the point in its outlines, making necessary and useful observations in a concise way, while being thorough in its scope.

Starting out

I admire the plotting of the book. For example, closures are presented to us with a list of practical uses that are well conceived. And focus is given in particular to their use as a way to run code after another operation is complete. From this the book then gracefully leads us into a discussion of synchronous and asynchronous operations and a practical example of using a table view alongside the fetching of favicons from numerous websites.

Drawing deeper

The time spent on Bezier Paths and the accompanying code examples in Chapter Six are worthwhile even if you don't intend to do much drawing in your app, because it helps you understand how to work with contexts and views.

Gradients and transforms are then knocked on the head at the end of Chapter Six, before the book launches into discussion of the SpriteKit and SceneKit frameworks. Each of which have an entire chapter devoted to them (they need it!).

Later stages

There's nothing more important these days than being able to sync data to the cloud. But I've heard the screams of many developers on twitter trying to wrestle iCloud into submission. So the extensive chapter on iCloud is very welcome and I'm sure it will help to lessen the frustration.

Chapters on Cocoa Bindings (OS X-only), as well as those that deal with Tables and Collection Views are equally welcome. While the section on networking, Bonjour and multipeer connectivity look well beyond the basics of writing a simple app and inspire the reader to think big.

I could go on and on here about section after section that follows, including Geocoding and EventKit, but it would just turn into an unnecessary list.

Before the close

The book doesn't end with Frameworks, it also guides the reader through using Instruments for debugging, alongside breakpoints and writing tests. To be honest, most of the things you've thought about getting round to using in Xcode or employing in your app are most likely in this book. Everything from building command-line tools to using multiple windows in iOS

There is also a chapter on working with text that discusses localisation and formatting, which in addition tells the reader how to estimate download file sizes. All of it useful for building apps.

Future reference

I was expecting such an ambitious book to breeze past many topics or ignore them completely, and yet the authors are focused not only on presenting each and every essential but also discussing the finer points of having things work well. This persists throughout the topics covered. As such there is plenty that I will be coming back to in this book for future reference.

And while books about programming for iOS and OS X are starting to split at the seams quite literally, it is a testament to the authors' ability to write concisely and in a plotted and well thought out way that the book can cover such a wide range of topics (across two platforms) and can do so in the space of around 500 printed pages (est.). At the same time it is important to be aware that if you are approaching programming from a web background, for example, then the brevity might be a challenge for you unless you grasp concepts very quickly.

Conclusion

As a textbook Swift Development with Cocoa would work really well, but if you are self-teaching (possibly from scratch) then you might be wise to consider Matt Neuburg's texts first, which will be discussed in a forthcoming review. This is because they have longer discussions and encircle ideas until they become familiar. But ultimately the question of reading this book becomes one of when not if. It is a book that will be of value to all but the highest of Cocoa and Swift geniuses, especially if you're thinking of expanding into new areas of the Cocoa framework.

The conciseness of Swift sits well with the conciseness of the text. And the book's focus is different from both of Apple's iBooks on Swift. It is a clean-slate approach to getting the work of building apps done.

Endorse on Coderwall

Comments