Contents
Chapter 1: Application Recipes
Recipe 1-1: Setting Up a Single-View Application
Recipe 1-2: Linking a Framework
Recipe 1-3: Adding a User Interface Control View
Recipe 1-4: Creating an Outlet
Recipe 1-5: Creating an Action
Recipe 1-7: Adding an Info.plist Property
Recipe 1-8: Adding a Resource File
Setting Up the Application with a Storyboard
Adding a New Scene to the Storyboard
Setting Up a Custom View Controller
Setting Up a Framework for Error Handling
Recipe 1-11: Handling Exceptions
A Strategy for Handling Exceptions
Intercepting Uncaught Exceptions
Recipe 1-12: Adding a Lite Version
Recipe 1-13: Adding Launch Images
Recipe 2-2: Programming Autolayout
Defining the Image Views’ Constraints
Recipe 2-3: Debugging Autolayout
Dealing with Ambiguous Layouts
Chapter 3: Table and Collection View Recipes
Recipe 3-1: Creating an Ungrouped Table
Displaying Data in a Table View
Implementing the Accessory Views
A Note on Cell View Customization
Recipe 3-2: Editing a UITableView
Recipe 3-3: Reordering a UITableView
Recipe 3-4: Creating a Grouped UITableView
Recipe 3-5: Registering a Custom Cell Class
Creating a Custom Table View Cell Class
Recipe 3-6: Creating a Flag Picker Collection View
Defining the Collection View Interface
Using Autolayout to Center the Headers
Standard and Significant Change Services
Recipe 4-1: Getting Basic Location Information
Starting and Stopping Location Updates
Recipe 4-2: Significant Location Changes
Recipe 4-3: Tracking Magnetic Bearing
Starting and Stopping Heading Updates
Recipe 4-4: Tracking True Bearing
Recipe 4-6: Implementing Geocoding
Implementing Reverse Geocoding
Implementing Forward Geocoding
Recipe 5-1: Recognizing Shake Events
Implementing Shake Notifications
Recipe 5-2: Accessing Raw Core Motion Data
Recipe 5-3: Accessing Device Motion Data
Recipe 5-4: Moving a Label with Gravity
Recipe 6-1: Showing a Map with the Current Location
Recipe 6-2: Marking Locations with Pins
Recipe 6-3: Creating Custom Annotations
Creating a Custom Annotation Class
Creating a Custom Annotation View
Recipe 6-5: Adding Overlays to a Map
Recipe 6-6: Grouping Annotations Dynamically
Recipe 6-7: Starting Maps from Your App
Recipe 6-8: Registering a Routing App
Chapter 7: Social Network Recipes
Recipe 7-1: Sharing Content with the Activity View
Setting Up an Activity View Controller
Recipe 7-2: Sharing Content Using a Compose View
Recipe 7-3: Sharing Content Using SLRequest
Requesting Access to Twitter Accounts
Setting Up a Navigation-Based Application
Saving Picture to Photos Album
Recipe 8-4: Using Custom Camera Overlays
Recipe 8-5: Displaying Camera Preview with AVCaptureSession
Recipe 8-6: Capturing Still Images with AVCaptureSession
Recipe 8-7: Capturing Video with AVCaptureSession
Recipe 8-8: Capturing Video Frames
Handling Errors and Interruptions
Recipe 9-3: Accessing the Music Library
Setting Up a Basic Music Player
Recipe 9-4: Playing Background Audio
Declaring Background Mode Playback
Recipe 10-1: Drawing Simple Shapes
Recipe 10-2: Programming Screenshots
Recipe 10-3: Using Image Views
Recipe 10-5: Manipulating Images with Filters
Creating Thumbnail Images for the Table View
Recipe 10-6: Detecting Features
Recipe 11-1: Working with NSCalendar and NSDate
Recipe 11-2: Fetching Calendar Events
Recipe 11-3: Displaying Events in a Table View
Recipe 11-4: Viewing, Editing, and Deleting Events
Recipe 11-5: Creating Calendar Events
Recipe 11-6: Creating Reminders
Requesting Access to Reminders
Creating Location-Based Reminders
Recipe 11-7: Accessing the Address Book
Recipe 11-8: Setting Contact Information
Chapter 12: Data Storage Recipes
Recipe 12-1: Persisting Data With NSUserDefaults
Recipe 12-2: Persisting Data Using Files
Setting Up the Vocabularies Table View
Implementing the Words View Controller
Recipe 12-4: Storing Key-Value Data in iCloud
Persisting Data in iCloud Key-Value Store
Caching iCloud Data Locally Using NSUserDefaults
Recipe 12-5: Storing UIDocuments in iCloud
Chapter 13: Data Transmission Recipes
Recipe 13-1: Composing Text Messages
Recipe 13-3: Printing an Image
Recipe 13-4: Printing Plain Text
Recipe 13-6: Formatted Printing with Page Renderers
Recipe 14-1: Making Your App Game Center Aware
Registering with iTunes Connect
Displaying Game Center From Your App
Recipe 14-2: Implementing Leaderboards
Reporting Scores to Game Center
Recipe 14-3: Implementing Achievements
Defining Achievements in iTunes Connect
Recipe 14-4: Creating a Simple Turn-Based Multiplayer Game
Preparing the Game for Game Center