- ホーム
- > 洋書
- > 英文書
- > Computer / General
Full Description
The Advanced iOS 6 Developer's Cookbook brings together reliable, proven solutions for cutting-edge iOS 6 development. World-renowned iOS expert Erica Sadun covers device-specific development, document/data sharing, Core Text, networking, image processing, onboard cameras, audio, Address Book, Core Location, GameKit,StoreKit, push notifications, and more.As in her previous bestselling iOS books, Sadun translates today's development best practices into working code, distilling key concepts into concise recipes that are easy to understand and transfer into your own projects. This isn't just cut and paste. Using her examples, Sadun fully explains both the "how" and "why" of advanced and specialized iOS 6 development.All code is tested with iOS 6 features and iPhone, iPad, and iPod touch capabilities. Throughout, every chapter groups related tasks together, so you can jump straight to your solution without having to identify the right class or framework first. Coverage includesTesting device properties so your app can take full advantage of the iOS unit it's running onSeamlessly sharing documents and data across apps and moving control between appsPresenting exceptionally attractive text with freeform text typesettingBuilding touch-based apps that leverage Bezier curves, splines, and other geometric toolsSecuring network apps via authentication, system keychains, and OAuthAccessing and processing image data to create special effectsIntegrating live camera feeds and user snapshotsPresenting audio to users and enabling them to interact with itEffectively using Address Book frameworks and GUI classesBuilding advanced location apps with Core Location geopositioning and MapKitCreating connected game play with GameKit/Game Center: device-to-device networking, shared leaderboards, and Internet-based matchesIntegrating secure in-app purchasing with StoreKitCommunicating with users from web-based services via push notifications
Contents
Preface xiii1 Device-Specific Development 1Accessing Basic Device Information 1Adding Device Capability Restrictions 2Recipe: Checking Device Proximity and Battery States 5Recipe: Recovering Additional Device Information 9Recipe: Using Acceleration to Locate "Up" 11Working with Basic Orientation 12Retrieving the Current Accelerometer Angle Synchronously 13Recipe: Using Acceleration to Move Onscreen Objects 16Recipe: Accelerometer-Based Scroll View 19Recipe: Core Motion Basics 21Recipe: Retrieving and Using Device Attitude 26Detecting Shakes Using Motion Events 27Recipe: Using External Screens 29Tracking Users 35One More Thing: Checking for Available Disk Space 35Summary 362 Documents and Data Sharing 39Recipe: Working with Uniform Type Identifiers 39Recipe: Accessing the System Pasteboard 45Recipe: Monitoring the Documents Folder 48Recipe: Presenting the Activity View Controller 54Recipe: The Quick Look Preview Controller 63Recipe: Adding a QuickLook Action 66Recipe: Using The Document Interaction Controller 69Recipe: Declaring Document Support 75Recipe: Creating URL-Based Services 82Summary 843 Core Text 87Core Text and iOS 87Attributed Strings 89Recipe: Basic Attributed Strings 93Recipe: Mutable Attributed Strings 95The Mystery of Responder Styles 98Recipe: Attribute Stacks 100Recipe: Using Pseudo-HTML to Create Attributed Text 105Drawing with Core Text 109Creating Image Cut-Outs 112Recipe: Drawing Core Text onto a Scroll View 114Recipe: Exploring Fonts 116Adding Custom Fonts to Your App 118Recipe: Splitting Core Text into Pages 119Recipe: Drawing Attributed Text into a PDF 120Recipe: Big Phone Text 122Summary 1254 Geometry 127Recipe: Retrieving Points from Bezier Paths 127Recipe: Thinning Points 129Recipe: Smoothing Drawings 132Recipe: Velocity-Based Stroking 135Recipe: Bounding Bezier Paths 137Recipe: Fitting Paths 142Working with Curves 144Recipe: Moving Items Along a Bezier Path 148Recipe: Drawing Attributed Text Along a Bezier Path 151Recipe: View Transforms 154Recipe: Testing for View Intersection 161Summary 1665 Networking 167Recipe: Secure Credential Storage 167Recipe: Entering Credentials 171Recipe: Handling Authentication Challenges 176Recipe: Uploading Data 177Recipe: Building a Simple Web Server 181Recipe: OAuth Utilities 184Recipe: The OAuth Process 188Summary 1966 Images 197Image Sources 197Reading Image Data 199Recipe: Fitting and Filling Images 203Recipe: Rotating Images 208Recipe: Working with Bitmap Representations 210Recipe: Basic Image Processing 215Recipe: Image Convolution 216Recipe: Basic Core Image Processing 219Capturing View-Based Screen Shots 221Drawing into PDF Files 222Recipe: Reflection 223Recipe: Emitters 226Summary 2287 Cameras 229Recipe: Snapping Photos 229Recipe: Enabling a Flashlight 233Recipe: Accessing the AVFoundation Camera 235Recipe: EXIF 242Image Orientations 247Recipe: Core Image Filtering 249Recipe: Core Image Face Detection 251Recipe: Sampling a Live Feed 257Summary 2608 Audio 261Recipe: Playing Audio with AVAudioPlayer 261Recipe: Looping Audio 269Recipe: Handling Audio Interruptions 272Recipe: Recording Audio 274Recipe: Recording Audio with Audio Queues 280Recipe: Picking Audio with the MPMediaPickerController 286Creating a Media Query 288Recipe: Using the MPMusicPlayerController 290Summary 2949 Connecting to the Address Book 297The AddressBook Frameworks 297Recipe: Searching the Address Book 322Recipe: Accessing Contact Image Data 325Recipe: Picking People 326Recipe: Limiting Contact Picker Properties 329Recipe: Adding and Removing Contacts 331Modifying and Viewing Individual Contacts 334Recipe: The "Unknown" Person Controller 335Summary 33810 Location 339Authorizing Core Location 339Recipe: Core Location in a Nutshell 344Recipe: Geofencing 348Recipe: Keeping Track of "North" by Using Heading Values 350Recipe: Forward and Reverse Geocoding 353Recipe: Viewing a Location 355Recipe: User Location Annotations 360Recipe: Creating Map Annotations 363Summary 36911 GameKit 371Enabling Game Center 371Recipe: Signing In to Game Center 373Designing Leaderboards and Achievements 375Recipe: Accessing Leaderboards 378Recipe: Displaying the Game Center View Controller 380Recipe: Submitting Scores 381Recipe: Checking Achievements 382Recipe: Reporting Achievements to Game Center 383Recipe: Multiplayer Matchmaking 385Recipe: Responding to the Matchmaker 387Recipe: Creating an Invitation Handler 388Managing Match State 390Recipe: Handling Player State Changes 390Recipe: Retrieving Player Names 392Game Play 393Serializing Data 394Recipe: Synchronizing Data 397Recipe: Turn-by-Turn Matchmaking 399Recipe: Responding to Turn-Based Invitations 401Recipe: Loading Matches 402Recipe: Responding to Game Play 403Recipe: Ending Gameplay 407Recipe: Removing Matches 410Recipe: Game Center Voice 411GameKit Peer Services 415Summary 42512 StoreKit 427Getting Started with StoreKit 427Creating Test Accounts 430Creating New In-App Purchase Items 431Building a Storefront GUI 435Purchasing Items 438Validating Receipts 443Summary 44513 Push Notifications 447Introducing Push Notifications 447Provisioning Push 451Registering Your Application 454Recipe: Push Client Skeleton 458Building Notification Payloads 465Recipe: Sending Notifications 466Feedback Service 471Designing for Push 473Summary 473Index 475