This book is organized into two parts. Part one talks about iOS development in general. How to get started, the frameworks provided by Apple, the Provisioning Portal, the IDE, and several core concepts are introduced in this first part of the book. The second part includes techniques for putting iOS development into practice. The chapters in part 2 contain projects that are developed using multiple techniques. By the end of the chapter (or two chapters in one case), you’ll go through the development of an app from beginning to end.
The apps developed in the chapters can be found for free in the AppStore so you can see how they wound up. But if you go through the chapters and follow along (or download the source code), you will be able to see see how the app is coded and run it yourself.
My suggestion is to follow along with the development of each project in each chapter. Downloading the source code is helpful, but try typing out the lines of code from the book, if you have time. This will help you to experience the process and you will see how Xcode handles things like code-completion, navigation, UI design, and so on. That hands-on experience is invaluable.
I expect you’re reading this book because you want to learn about different aspects of iOS development and are just starting out. However, this is not an Objective-C programming book. It’s assumed that you already know a bit of Objective-C, are learning it concurrently, or are willing to glean what you can from diving right in. Regardless of your level of experience, I recommend that you digest each line of code in order to understand the details of all aspects of iOS development.
Part 1 covers the groundwork needed to get started in iOS development. In chapter 1, you’ll get to develop your first Hello World app, but we’ll also cover some of the core areas and concepts of iOS development. Chapter 2 covers the development environment, including Xcode for editing the code and user interface along with other concepts and tools.
Chapter 3 begins part 2 with your first real app project: PicDecor. In this chapter you’ll learn about view controllers and displaying images as well as how to interface with sending email. You’ll see how to design the UI, and how to connect it to the code you’re writing.
Chapter 4 builds on what you learned in chapter 3 about view controllers by showing you table view controllers and how to access the address book.
Chapter 5 continues with access to images through the photo album and the camera and how to manipulate those images. Also, in chapter 5 you’ll see how to display a map and the user’s location and store data for later retrieval and display.
The Settings Bundle is the official way to have a user manage app settings and is covered in chapter 6. Also covered are playing MP3s and detecting motion (particularly shaking) of the device. Chapter 7 goes further in playing audio, allowing the user to make playlists and play them via the iPad framework. This includes covering CoreData for database design and for storing app data.
Push notifications and in-app purchase both use external server interaction for their functionality and are covered in chapter 8 for our Rock, Paper, Scissors game. Chapter 9 continues the game with GameCenter interaction including leaderboards and achievements.
Chapter 10 could be called the “iChapter” as it covers using the iTunes API to search music, designing for the iPad, and advertising using iAds.
Finally, chapter 11 covers the more recent additions to iOS. Specifically, it covers the collection view, Social Framework, reminders, and UI state restoration.
There are many Objective-C code examples in this book edited with Xcode. Source code in listings and text is in a fixed-width font like this to separate it from ordinary text.
Writing code for a book is challenging compared with writing code that isn’t going to be published for the world to see. Restrictions on line length, readability, and conciseness encouraged decisions I might not have made otherwise. You will find that I may have added a method to a class that might not make the most sense, or named some variables in less-than-perfect ways. Please concentrate on the content over form in those cases.
As all aspects of mobile, websites, documentation, tools, and so on change regularly, some images in the book may not match what you see online and elsewhere. However, the concepts are likely to remain, and the variance you might see shouldn’t cause confusion.
You will need a few things to benefit from the information presented in this book, starting with an Apple computer. Then you will need to download Xcode and the accompanying documentation, including public/open source libraries, as well as the source code for the examples in the book. The chapters will then direct you on what to do, one step at a time.
You will find the source code for the working examples in this book available for download from the publisher’s website at www.manning.com/iOSinPractice www.manning.com/iOSinPractice.
You can also find some of the apps developed in this book in the Apple App Store.
The title of this book communicates its two core aspects—it covers iOS development both in general and in practice. Learning happens best through examples and exercises‚ as opposed to learning about theories or concepts in isolation. So I’ve included numerous hands-on techniques and examples to get you started in iOS development.
Bear Cahill has worked in iOS development at Brainwash Inc. since 2008 and through the development of several dozen apps. Prior to that, Bear worked at IBM, Ericsson, and Travelocity, among other companies.
From REXX to BASIC to C++ to Java to Objective-C, along with several other languages, Bear has worked on a variety of platforms and technologies. He now focuses on independent work, using friends to handle related server, Android, and other work.
Bear enjoys spending time with his wife and two sons around downtown Denton, Texas. He has too many hobbies past and future to list here, so we’ll just say he’s never been sky diving, scuba diving, or stage diving. No diving allowed!
The purchase of iOS in Practice includes free access to a private forum run by Manning Publications where you can make comments about the book, ask technical questions, and receive help from the author and other users. You can access and subscribe to the forum at www.manning.com/iOSinPractice www.manning.com/iOSinPractice. This page provides information on how to get on the forum after you’re registered, what kind of help is available, and the rules of conduct in the forum.
Manning’s commitment to our readers is to provide a venue where a meaningful dialogue among individual readers and between readers and the author can take place. It’s not a commitment to any specific amount of participation on the part of the author, whose contribution to the book’s forum remains voluntary (and unpaid). We suggest you try asking the author some challenging questions, lest his interest stray!
The Author Online forum and the archives of previous discussions will be accessible from the publisher’s website as long as the book is in print.