1 UIKit Dynamics 1 Sample App 1 Introduction to UIKit Dynamics 2 Implementing UIKit Dynamics 3 Gravity 3 Collisions 4 Attachments 6 Springs 8 Snap 9 Push Forces 9 Item Properties 11 In-Depth UIDynamicAnimator and UIDynamicAnimatorDelegate 13 Summary 13 Exercises 14 2 Core Location, MapKit, and Geofencing 15 The Sample App 15 Obtaining User Location 15 Requirements and Permissions 16 Checking for Services 19 Starting Location Request 20 Parsing and Understanding Location Data 22 Significant Change Notifications 23 Using GPX Files to Test Specific Locations 24 Displaying Maps 26 Understanding the Coordinate Systems 26 MKMapKit Configuration and Customization 26 Responding to User Interactions 28 Map Annotations and Overlays 29 Adding Annotations 29 Displaying Standard and Custom Annotation Views 32 Draggable Annotation Views 35 Working with Map Overlays 36 Geocoding and Reverse-Geocoding 37 Geocoding an Address 37 Reverse-Geocoding a Location 41 Geofencing 44 Checking for Regional Monitoring Capability 44 Defining Boundaries 45 Monitoring Changes 46 Getting Directions 48 Summary 52 Exercises 53 3 Leaderboards 55 Whack-a-Cac 55 Spawning a Cactus 57 Cactus Interaction 60 Displaying Life and Score 62 Pausing and Resuming 63 Final Thoughts on Whack-a-Cac 64 iTunes Connect 65 Game Center Manager 68 Authenticating 70 Common Authentication Errors 71 iOS 6 Authentication 73 Submitting Scores 75 Adding Scores to Whack-a-Cac 78 Presenting Leaderboards 80 Score Challenges 82 Going Further with Leaderboards 84 Summary 86 Exercises 86 4 Achievements 87 iTunes Connect 87 Displaying Achievement Progress 89 Game Center Manager and Authentication 91 The Achievement Cache 91 Reporting Achievements 93 Adding Achievement Hooks 95 Completion Banners 96 Achievement Challenges 97 Adding Achievements into Whack-a-Cac 100 Earned or Unearned Achievements 101 Partially Earned Achievements 102 Multiple Session Achievements 104 Piggybacked Achievements and Storing Achievement Precision 105 Timer-Based Achievements 106 Resetting Achievements 107 Going Further with Achievements 108 Summary 110 Exercises 110 5 Getting Started with Address Book 111 Why Address Book Support Is Important 111 Limitations of Address Book Programming 112 Introduction to the Sample App 112 Getting Address Book Up and Running 112 Reading Data from the Address Book 115 Reading Multivalues from the Address Book 116 Understanding Address Book Labels 117 Working with Addresses 118 Address Book Graphical User Interface 120 People Picker 120 Programmatically Creating Contacts 125 Summary 128 Exercises 128 6 Working with Music Libraries 129 Introduction to the Sample App 129 Building a Playback Engine 131 Registering for Playback Notifications 131 User Controls 133 Handling State Changes 135 Duration and Timers 139 Shuffle and Repeat 140 Media Picker 141 Programmatic Picker 143 Playing a Random Song 144 Predicate Song Matching 145 Summary 147 Exercises 148 7 Working with and Parsing JSON 149 JSON 149 Benefits of Using JSON 149 JSON Resources 150 Sample App Overview 150 Accessing the Server 150 Getting JSON from the Server 151 Building the Request 151 Inspecting the Response 152 Parsing JSON 153 Displaying the Data 154 Posting a Message 155 Encoding JSON 156 Sending JSON to the Server 158 Summary 159 Exercise 159 8 Getting Started with iCloud 161 The Sample App 161 Setting Up the App for iCloud Support 162 Account Setup 162 Enabling iCloud Capabilities 163 Initializing iCloud 164 Introducing UIDocument 165 Subclassing UIDocument 165 Interacting with UIDocument 167 Interacting with iCloud 168 Listing Documents in iCloud 168 Detecting Conflicts in iCloud 172 Conflict Resolution 173 Key-Value Store Syncing 178 Summary 180 Exercises 180 9 Notifications 181 Differences Between Local and Push Notifications 181 Sample App 182 App Setup 182 Create Development Push SSL Certificate 184 Development Provisioning Profile 188 Custom Sound Preparation 194 Registering for Remote Notifications 194 Scheduling Local Notifications 196 Receiving Notifications 196 Push Notification Server 198 Basic Rails Setup 198 Add Support for Devices and Shouts 199 Device Controller 202 Shout Controller 202 Tying It All Together 204 Sending the Push Notifications 207 Handling APNs Feedback 207 Summary 208 Exercise 208 10 Bluetooth Networking with Game Kit 209 Limitations of Game Kit''s Bluetooth Networking 209 Benefits of Game Kit''s Bluetooth Networking 210 Sample App 210 The Peer Picker 215 Sending Data 218 Data Modes 219 Sending Data in the Sample App 219 Receiving Data 221 Receiving Data in the Sample App 221 State Changes 222 Advanced Features 223 Peer Display Name 223 Connecting Without the Peer Picker 223 Session Modes 225 Summary 225 Exercises 225 11 AirPrint 227 AirPrint Printers 227 Testing for AirPrint 229 Printing Text 229 Print Info 230 Setting Page Range 231 Error Handling 232 Starting the Print Job 232 Print Simulator Feedback 233 Print Center 234 UIPrintInteractionControllerDelegate 234 Printing Rendered HTML 236 Printing PDFs 237 Summary 239 Exercises 239 12 Core Data Primer 241 Deciding on Core Data 242 Core Data Managed Objects 243 Managed Objects 243 Managed Object Model 244 Managed Object Model Migrations 246 Creating Managed Objects 246 Fetching and Sorting Objects 247 Fetched Results Controller 248 The Core Data Environment 248 Persistent Store Coordinator 249 Persistent Store 249 Managed Object Context 249 Summary 250 13 Getting Up and Running with Core Data 251 Sample App 251 Starting a Core Data Project 252 Core Data Environment 254 Building Your Managed Object Model 256 Creating an Entity 257 Adding Attributes 257 Establishing Relationships 258 Custom Managed Object Subclasses 259 Setting Up Default Data 260 Inserting New Managed Objects 260 Other Default Data Setup Techniques 261 Displaying Your Managed Objects 262 Creating Your Fetch Request 262 Fetching by Object ID 264 Displaying Your Object Data 265 Using Predicates 267 Introducing the Fetched Results Controller 268 Preparing the Fetched Results Controller 268 Integrating Table View and Fetched Results Controller 271 Responding to Core Data Changes 273 Adding, Editing, and Removing Managed Objects 275 Inserting a New Managed Object 275 Removing a Managed Object 276 Editing an Existing Managed Object 277 Saving and Rolling Back Your Changes 278 Summary 279 Exercises 279 14 Language Features 281 Literals 282 Boxed Expressions 284 Automatic Reference Counting 285 Using ARC in a New Project 285 Converting an Existing Project to ARC 286 Basic ARC Usage 288 ARC Qualifiers 289 Blocks 290 Declaring and Using Blocks 290 Capturing State with Blocks 291 Using Blocks as Method Parameters 293 Memory, Threads, and Blocks 294 Properties 295 Declaring Properties 295 Synthesizing Properties 297 Accessing Properties 297 Dot Notation 298 Fast Enumeration 298 Method Swizzling 299 Summary 302 Exercises 302 15 Integrating Twitter and Facebook Using Social Framework 303 Social Integration 303 The Sample App 303 Logging In 304 Using SLComposeViewController 306 Posting with a Custom Interface 308 Posting to Twitter 308 Posting to Facebook 312 Creating a Facebook App 312 Accessing User Timelines 318 Twitter 318 Facebook 324 Summary 328 Exercises 328 16 Working with Background Tasks 329 The Sample App 330 Checking for Background Availability 330 Finishing a Task in the Background 331 Background Task Identifier 332 Expiration Handler 333 Completing the Background Task 333 Implementing Background Activities 335 Types of Background Activities 335 Playing Music in the Background 336 Summary 340 Exercises 340 17 Grand Central Dispatch for Performance 341 The Sample App 341 Introduction to Queues 343 Running on the Main Thread 343 Running in the Background 345 Running in an Operation Queue 347 Concurrent Operations 347 Serial Operations 349 Cancelin.
iOS Components and Frameworks : Understanding the Advanced Features of iOS SDK