Learning iOS Programming, 2nd Ed. – Updated to cover iOS 5, iPad, iPhone, iPod Touch – #programming #bookreview

Learning iOS Programming, 2nd Edition
By Alasdair Allan
(O’Reilly, paperback, list price $34.99; Kindle edition, list price $27.99)

Alasdair Allan’s popular iOS programming book recently has been updated to cover iOS 5. And it has a new name. (The first edition was titled Learning iPhone Programming.)

“The changes made in this second edition reflect the fact that a lot has happened since the first edition was published: the release of the iPad, a major release of Xcode, two revisions of the operating system itself, and the arrival of Apple’s iCloud,” the author notes. “This book has therefore been refreshed, renewed, and updated to reflect these fairly fundamental changes to the platform, and all of the example code was rewritten from the ground up for Xcode 4 and iOS 5 using ARC.”

Allan’s book – well-written and appropriately illustrated – is structured to provide “a rapid introduction to programming for the iPhone, iPod touch, and iPad,” and it assumes that you have some familiarity with C or a C-derived language, as well as a basic understanding of object-oriented programming.

And the pace is fast. By chapter 3, you are building the requisite “Hello, World” application and running it in iPhone Simulator.

In that same chapter, Allan also introduces the basic syntax of Objective-C and highlights some of the “rather strange” ways that it deals with method calls. He discusses how the Cocoa Touch framework underlying iOS applications “is based on one of the oldest design patterns, the Model-View-Controller pattern, which dates from the 1970s.” And he warns that “[a]ttempting to write iOS applications while ignoring the underlying MVC patterns is a pointless exercise in make-work.”

Learning iOS Programming, 2nd Edition does not emphasize web-based applications. It centers, instead, on creating native applications using Apple’s SDK. “The obvious reason to use the native SDK,” Allan states, “is to do things that you can’t do using web technologies. The first generation of augmented reality applications is a case in point; these needed close integration with the iPhone’s onboard sensors (e.g., GPS, accelerometer, digital compass, and camera) and wouldn’t have been possible without that access.”

He emphasizes a financial reason, as well. “Consumers won’t buy your application on their platform just because you support other platforms; instead they want an application that looks like the rest of the applications on their platform, that follows the same interface paradigms as the rest of the applications they’re used to, and is integrated into their platform.”

He adds: “If you integrate your application into the iOS ecosphere, make use of the possibilities that the hardware offers, and make sure your user interface is optimized for the device, the user experience is going to be much improved.”

Hard to argue with that.

Learning iOS Programming, 2nd Edition provides the steps necessary to develop and market your first iOS application. Allan notes: “Until recently, the only way to obtain the iOS SDK was to become a registered iOS developer. However, you can now download the current release of Xcode and the iOS SDK directly from the Mac App Store.”

Of course, if you intend to distribute your applications “or even just deploy them onto your own device, you will also need to register with Apple as a developer and then enroll in one of the developer programs.”

You may need some system upgrades, as well. To develop apps for the iOS, you’ll need an Intel Mac running OS X 10.6 (“Snow Leopard”) or later. If you plan to create apps that use Apple’s iCloud, you’ll need OS X 10.7 (“Lion”) or later.

One other recommendation from Allan: If you’re truly serious about being an iOS developer, consider also registering with the Mac Developer Program.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir. He is the author of an e-book detective novel, Erwin’s Law, now also available in paperback, plus a novella, Jump, and several other books and short stories.

iOS 5 Programming Cookbook: Solutions & Examples for iPhone, iPad, & iPod Apps – #bookreview

iOS 5 Programming Cookbook
By Vandad Nahavandipoor
(O’Reilly, paperback, list price $49.99; Kindle edition, list price $39.99)

This huge and helpful “cookbook” does not ignore iOS novice programmers. But the author, a veteran software developer, expects readers to at least be “comfortable with the iOS development environment and know how to create an app for the iPhone or iPad.”

His well-structured new edition “presents useful ways to get things done” and promises that readers “will learn a lot more about the basics of iOS programming, and a lot more about UIKit, dictionaries, arrays, loops, and conditionals.”

He notes that “[a] lot has changed in iPhone, iPad, and iPod touch programming since the introduction of iOS 5. The whole runtime and the way we write Objective-C code has dramatically changed. ARC (Automatic Reference Counting) is now introduced into the LLVM Compiler, which in some ways gives us more flexibility and in other ways makes the runtime more fragile.”

Nahavandipoor’s 852-page book is loaded with code examples, screenshots, and other illustrations and is divided into 17 chapters and an index.

  • Chapter 1: The Basics - An overview of  Objective-C.
  • Chapter 2: Implementing Controllers and Views - “Describes various approaches to constructing your iOS application’s user interface…”
  • Chapter 3: Constructing and Using Table Views - Shows how to use table views “to create professional-looking iOS applications.”
  • Chapter 4: Storyboards - The process of storyboarding can help you “define the connections between different screens in your app.” And, with storyboarding, “you don’t have to know anything about iOS programming to get a simple app running.”
  • Chapter 5: Concurrency - Focuses on Grand Central Dispatch, “Apple’s preferred way of achieving concurrency in iOS.” Also looks at timers, threads, and operations.
  • Chapter 6: Core Location and Maps - Describes “how you should use Map Kit and Core Location APIs to develop location-aware iOS applications.”
  • Chapter 7: Implementing Gesture Recognizers - Shows “how to use all available gesture recognizers in the iOS SDK, with working examples tested on iOS 5 on different devices such as the iPhone 3GS, iPhone 4, and iPad.”
  • Chapter 8: Networking, JSON, XML, and Twitter - Includes downloading data from a URL and parsing XML files. The pros and cons of synchronous and asynchronous connections. Caching files in memory and on disk to minimize an iOS device’s bandwidth consumption.
  • Chapter 9: Audio and Video - Focuses on “the AV Foundation and Media Player frameworks that are available on the iOS SDK.”
  • Chapter 10: Address Book – Structured to help Objective-C developers get a handle on the Address Book framework and how to retrieve contacts, groups, and their information. “The Address Book framework is composed entirely of C APIs.” So, “many Objective-C developers find it difficult to use this framework….”
  • Chapter 11: Camera and the Photo Library - Shows how to “determine the availability of front- and back-facing cameras on an iOS device.” Also looks at accessing the Photo Library “using the Assets Library framework…available in iOS 4 and later” and editing videos on an iOS device.
  • Chapter 12: Multitasking - Explains and presents examples that show “how to create multitasking-aware aplications that run beautifully on iOS 4 and above.”
  • Chapter 13: Core Data - Using Core Data to “maintain persistent storage for your iOS applications….”
  • Chapter 14: Dates, Calendars, and Events - Shows how to use “the event Kit and Event Kit UI frameworks, which are available on iOS 4 and later, in order to manage calendars and events on an iOS device.”
  • Chapter 15: Graphics and Animations – Introduces the reader to the Core Graphics framework and shows how to work with images and text and graphics context.
  • Chapter 16: Core Motion - Introduces the Core Motion framework and shows how to access the accelerometer and gyroscope on an iOS device. (Not all devices have those capabilities.)
  • Chapter 17: iCloud - “Shows how to use the iCloud service, which ties devices together and allows them to share data…as the user moves from one device to another.”

More than 100 new recipes have been added to this updated second edition of Nahavandipoor’s book. He also provides extensive references and links to other materials, including some Apple documents that he believes “every professional iOS developer should read.”

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. His latest book is a detective novel, Erwin’s Law. His other published works include Jump, a novella, and a book of poetry, plus several short stories, including The 7th Mars Cavalry, all available on Kindle.