Coding for Apple mobile devices provides developers a rewarding and lucrative career path where you might not only change peoples lives with your app (see Figure ), but youll also have a great time being with bright, like-minded women and men such as yourself. Though youre bound to find some difficulty in learning the language, tools, and processes, these new associates will not only help you through the landscape of this new world, but will also challenge you to be your best and to stand out from the mediocre.
Figure 1-1.
One of the greatest feelings you can experience as an iOS developer is seeing other people using your creation out in the real world
And for now, think of me as one of those friends along your journey of iOS discovery. Im so proud to be able to help you by providing this initiation into the world of iOS development, whether it is for iPhone, iPod Touch or the iPad. iOS provides an exciting platform that has been seeing explosive growth since it first came out in 2007. The proliferation of mobile devices means that people are using software everywhere they go, whether it is a phone or a wearable, such as the Apple Watch. With the release of iOS 10, Xcode 8, Swift 3, and the latest version of the iOS software development kit (SDK), things continue to be exciting and generally become easier for the new developer.
About the Book
This book guides you down the path to creating your own iOS applications. I want to get you past the initial difficulties to help you understand the way that iOS applications work and how they are built.
As you work your way through this book, you will create a number of small applications, each designed to highlight specific iOS features and to show you how to control or interact with those features. If you combine the foundation youll gain through this book with your own creativity and determination, and then add in the extensive and well-written documentation provided by Apple, youll have everything you need to build your own professional iPhone and iPad applications.
Note
Throughout most of this book, I tend to refer to the iPhone and iPad, as they are the devices that well most commonly use. This does not preclude the iPod Touch by any means; it is just a matter of convenience.
Tip
The authors of the previous revisions of this book have set up a forum for this book. Its a great place to meet like-minded folks, get your questions answered, and even answer other peoples questions. The forum is at http://forum.learncocoa.org . Be sure to check it out!
Things Youll Need
Before you can begin writing software for iOS, youll need a few items. For starters, youll need an Intel-based Macintosh running Yosemite (OS X 10.10), El Capitan (OS X 10.11), Sierra (macOS 10.12) or later. Any recent Intel-based Macintosh computerlaptop or desktopshould work just fine. Of course, as well as the hardware, youll need the software. You can learn how to develop iOS applications and get the software tools that youll need as long as you have an Apple ID; if you own an iPhone, iPad, or iPod, then youve almost certainly already have an Apple ID, but if you dont, then just visit .
Figure 1-2.
Apples Development Center resources site
Click on Downloads across the top bar to go to the main resources page (see Figure ) for the current production release and (if there is one) the current beta release of iOS. Here, youll find links to a wealth of documentation, videos, sample code, and the likeall dedicated to teaching you the finer points of iOS application development. Be sure to scroll to the bottom of the page and check out the links to the Documentation and Videos sections of the web site. Youll also find a link to the Apple Developer Forums, where you can follow discussions on a wide variety of topics covering the whole iOS platform, as well as macOS, watchOS, and tvOS. To post to the forums, youll need to be a registered Apple developer.
Figure 1-3.
You can download all the production and beta releases of the development tools from the Downloads page. You will need to sign in with your Apple ID
Note
At the 2016 developer conference, WWDC 2016, Apple changed the name of OS X back to the previously used macOS to become more in line with the other naming conventions used throughout the four major system platforms.
The most important tool youll be using to develop iOS applications is called Xcode, Apples integrated development environment (IDE) . Xcode includes tools for creating and debugging source code, compiling applications, and performance tuning the applications youve written.
You can download the current beta release of Xcode by following the Xcode link from the developer Download page shown in Figure . If you prefer to use the latest production release, youll find it in the Mac App Store, which you can access from your Macs Apple menu.
SDK Versions and Source Code for The Examples
As the versions of the SDK and Xcode evolve, the mechanism for downloading them changed over the past few years. Apple now publishes the current production version of Xcode and the iOS SDK on the Mac App Store, while simultaneously providing developers the ability to download preview versions of upcoming releases from its developer site. Bottom line: unless you really want to work with the most recent development tools and platform SDK, you usually want to download the latest released (non-beta) version of Xcode and the iOS SDK, so use the Mac App Store.
This book is written to work with the latest versions of Xcode and the SDK. In some places, new functions or methods are introduced with iOS 10 that are not available in earlier versions of the SDK.
Be sure to download the latest and greatest source code archive for examples from this books page at www.apress.com . The code is updated as new versions of the SDK are released, so be sure to check the site periodically.
Your Options as a Developer
The free Xcode download includes a simulator that will allow you to build and run iPhone and iPad apps on your Mac, providing the perfect environment for learning how to program for iOS. However, the simulator does not support many hardware-dependent features , such as the accelerometer and camera. To test applications that use those features, youll need an iPhone, iPod touch, or iPad. While much of your code can be tested using the iOS simulator, not all programs can be. And even those that can run on the simulator really need to be thoroughly tested on an actual device before you ever consider releasing your application to the public.