|
Copyright |
6 |
|
|
Dedication |
7 |
|
|
Credits |
8 |
|
|
About the Author |
9 |
|
|
About the Technical Editor |
9 |
|
|
Acknowledgments |
11 |
|
|
Contents |
13 |
|
|
Foreword |
21 |
|
|
Introduction |
23 |
|
|
Part I: Developing a Professional UI |
31 |
|
|
Chapter 1: Creating a Personal Library |
33 |
|
|
Creating Your Personal Library |
34 |
|
|
Understanding Project Basics |
34 |
|
|
Starting a New Project |
35 |
|
|
Configuring Your Project |
36 |
|
|
Defining Constants |
38 |
|
|
Using the Configuration |
38 |
|
|
Importing the Header File |
40 |
|
|
Registration—Login |
41 |
|
|
Creating Registration Logic |
42 |
|
|
Initializing Data |
45 |
|
|
Initializing Application Defaults |
45 |
|
|
Creating Login Logic |
46 |
|
|
Securing Passwords |
48 |
|
|
Storing the Password in a Keychain |
50 |
|
|
Crash Management |
50 |
|
|
Understanding Crashes |
51 |
|
|
Implementing a Crash Handler |
51 |
|
|
Summary |
58 |
|
|
Chapter 2: Advancing with Tableviews |
59 |
|
|
Understanding the UITableView |
59 |
|
|
datasource and delegate |
60 |
|
|
Scrolling |
64 |
|
|
Building a Chat View Controller |
68 |
|
|
Building a datasource |
69 |
|
|
Building a Chat Data Object |
69 |
|
|
Building a Custom UITableView |
72 |
|
|
Flexible Cell Height |
75 |
|
|
Developing Custom Cells |
76 |
|
|
Creating the Chat User Object |
79 |
|
|
Putting It All Together |
80 |
|
|
Drilling Down with UITableView |
86 |
|
|
Implementing a UISearchBar |
96 |
|
|
Adding an Alphabet Index |
102 |
|
|
Summary |
107 |
|
|
Chapter 3: Advancing with Map Kit |
109 |
|
|
Simulating iOS Device Movement |
110 |
|
|
Why You Need a GPS Simulator |
110 |
|
|
Creating the Simulator |
110 |
|
|
Creating a GPS Route File with Google Maps |
114 |
|
|
Implementing the YDLocationSimulator |
117 |
|
|
Working with Annotations |
120 |
|
|
Creating Custom Annotations |
120 |
|
|
Responding to Annotation Call-Outs |
125 |
|
|
Summary |
148 |
|
|
Chapter 4: Understanding Action Views and Alerts |
149 |
|
|
Asking for User Input |
149 |
|
|
Creating a UIActionSheet with Multiple Options |
150 |
|
|
Presenting the UIActionSheet |
155 |
|
|
Responding to User Input |
163 |
|
|
Processing the User Selection |
163 |
|
|
Extending the UIAlertView |
166 |
|
|
Adding a UITextField to a UIAlertView |
166 |
|
|
Summary |
170 |
|
|
Chapter 5: Internationalization: Building Apps for the World |
171 |
|
|
Localizing Your Application |
171 |
|
|
Setting Up Localization |
173 |
|
|
Localizing Interface Builder Files |
174 |
|
|
Localizing Strings |
175 |
|
|
Localizing Images |
178 |
|
|
Localize the Name of Your Application |
180 |
|
|
Working with Date Formats |
181 |
|
|
What Is a Locale? |
181 |
|
|
Understanding Calendars |
185 |
|
|
Storing Dates in a Generic Way |
189 |
|
|
Working with Numbers |
190 |
|
|
Introducing Number Formatters |
190 |
|
|
Summary |
194 |
|
|
Chapter 6: Using Multimedia |
195 |
|
|
Portable Document Format |
195 |
|
|
Displaying a PDF Document with a UIWebView |
196 |
|
|
Displaying a PDF Document using QuickLook |
200 |
|
|
Creating a Thumbnail from a PDF Document |
203 |
|
|
Creating a PDF Document |
207 |
|
|
Playing and Recording Audio |
211 |
|
|
Introduction to the Frameworks |
212 |
|
|
Playing an Audio File from the Bundle |
212 |
|
|
Playing Audio from Your iTunes Library |
217 |
|
|
Playing Streaming Audio |
221 |
|
|
Recording Audio |
223 |
|
|
Playing and Recording Video |
228 |
|
|
Playing a Video File from the Bundle |
229 |
|
|
Playing a Video from Your iTunes Library |
232 |
|
|
Playing a YouTube Video |
235 |
|
|
Recording Video |
237 |
|
|
Summary |
240 |
|
|
Part II: Networking—Data Processing |
241 |
|
|
Chapter 7: Using Web Services and Parsing |
243 |
|
|
Why Would You Need to Use a Web Service? |
243 |
|
|
Understanding Basic Networking |
244 |
|
|
Understanding Protocols |
244 |
|
|
Understanding Operations |
245 |
|
|
Understanding Response Codes |
245 |
|
|
Introduction to Web Services |
246 |
|
|
Calling an HTTP Service |
246 |
|
|
Requesting a Website |
246 |
|
|
Downloading an Image from an HTTP URL |
249 |
|
|
Requesting a Secure Website Using HTTPS |
255 |
|
|
Using Blocks |
258 |
|
|
Calling a REST Service |
262 |
|
|
Constructing Your Request |
262 |
|
|
Processing the Response |
266 |
|
|
Posting to a RESTful Service |
272 |
|
|
Making SOAP Requests |
278 |
|
|
Preparing Your Request |
280 |
|
|
Passing Values to an Operation |
282 |
|
|
Understanding Secure SOAP Requests |
288 |
|
|
More Parsing |
290 |
|
|
What about Comma-Separated Value Files? |
290 |
|
|
Transforming XML to an NSDictionary |
296 |
|
|
Summary |
300 |
|
|
Chapter 8: Using FTP |
301 |
|
|
Developing an FTP Client |
302 |
|
|
Writing a Simple FTP Client |
302 |
|
|
Downloading a Remote File |
307 |
|
|
Creating a Remote Directory |
309 |
|
|
Listing a Remote Directory |
310 |
|
|
Uploading a File |
313 |
|
|
Reading from an NSStream |
314 |
|
|
Writing to an NSStream |
315 |
|
|
Writing a Complex FTP Client |
318 |
|
|
Working with an FTP Client |
327 |
|
|
Summary |
327 |
|
|
Chapter 9: Implementing Core Data |
329 |
|
|
Introduction to Core Data |
329 |
|
|
Why Should You Use Core Data? |
330 |
|
|
Introducing Managed Object Context |
330 |
|
|
Introducing the Managed Object Model |
330 |
|
|
Introducing Managed Objects |
331 |
|
|
Introducing Persistent Stores |
331 |
|
|
Introducing Fetch Requests |
331 |
|
|
Using Core Data in Your Application |
332 |
|
|
Creating a Managed Object Model |
332 |
|
|
Creating Managed Objects |
335 |
|
|
Creating Persistent Stores |
336 |
|
|
Setting Up Your Appdelegate |
337 |
|
|
Using Core Data in Your Application |
339 |
|
|
Using Managed Objects |
339 |
|
|
Fetching Managed Objects |
341 |
|
|
Using Relationships |
346 |
|
|
Understanding Model Changes |
350 |
|
|
Tuning for Performance |
354 |
|
|
Concurrency with Core Data |
361 |
|
|
Summary |
362 |
|
|
Part III: Integrating Your App |
363 |
|
|
Chapter 10: Notifications |
365 |
|
|
Implementing Local Notifications |
366 |
|
|
Understanding Local Notifications |
366 |
|
|
Creating a Notification |
367 |
|
|
Receiving a Notification |
370 |
|
|
Understanding Push Notifications |
371 |
|
|
Configuring the Developer Portal |
373 |
|
|
Obtaining Certificates |
376 |
|
|
Implementation with Urban Airship |
379 |
|
|
External Notifications |
382 |
|
|
Defining a Custom URL Scheme |
382 |
|
|
Responding to the URL Request |
383 |
|
|
Summary |
384 |
|
|
Chapter 11: Sending E?Mail, SMS, and Dialing a Phone |
385 |
|
|
Sending E?Mail |
385 |
|
|
Composing an E?Mail |
386 |
|
|
Working with Attachments |
388 |
|
|
Sending SMS (Text Message) |
389 |
|
|
Verifying if SMS Is Available |
389 |
|
|
Composing a Text Message |
389 |
|
|
Dialing a Phone Number |
390 |
|
|
Verifying Dialing Capability |
390 |
|
|
Summary |
391 |
|
|
Chapter 12: Understanding the Address Book |
393 |
|
|
Introduction to the Address Book Framework |
393 |
|
|
Accessing the Address Book |
394 |
|
|
Selecting a Contact |
394 |
|
|
Requesting Access Permission |
397 |
|
|
Displaying and Editing a Contact |
400 |
|
|
Creating a Contact |
403 |
|
|
Deleting a Contact |
405 |
|
|
Programmatically Accessing the Address Book |
405 |
|
|
Understanding Address Books |
406 |
|
|
Understanding Records |
409 |
|
|
Understanding Properties |
410 |
|
|
Creating a Contact Programmatically |
411 |
|
|
Deleting a Contact Programmatically |
414 |
|
|
Summary |
414 |
|
|
Chapter 13: Event Programming |
415 |
|
|
Introduction to the Event Kit Framework |
415 |
|
|
Using the EventKitUI Framework |
416 |
|
|
Requesting Access Permission |
416 |
|
|
Accessing a Calendar |
418 |
|
|
Creating and Editing a Calendar Event |
420 |
|
|
Programmatically Accessing the Calendar Database |
421 |
|
|
Creating an Event |
422 |
|
|
Editing an Event |
426 |
|
|
Deleting an Event |
427 |
|
|
Stay Synchronized |
427 |
|
|
Working with Reminders |
427 |
|
|
Creating a Reminder |
428 |
|
|
Editing a Reminder |
429 |
|
|
Deleting a Reminder |
429 |
|
|
Working with Alarms |
429 |
|
|
Summary |
431 |
|
|
Chapter 14: Integrating with Social Media |
433 |
|
|
Introduction to Social Media Integration |
433 |
|
|
Understanding the Accounts Framework |
434 |
|
|
Understanding the Social Framework |
438 |
|
|
Making a Post |
439 |
|
|
Retrieving Tweets |
448 |
|
|
Integrating with Facebook |
449 |
|
|
Creating a Single Sign-In Application |
456 |
|
|
Summary |
461 |
|
|
Part IV: Taking Your Application to Production |
463 |
|
|
Chapter 15: Analyzing Your Application |
465 |
|
|
Performing a Technical Analysis |
465 |
|
|
Application Crashes |
466 |
|
|
Blocking the Main Thread |
466 |
|
|
Memory Leaks |
467 |
|
|
Using Synchronized HTTP Requests |
468 |
|
|
Extensive Bandwidth Usage |
468 |
|
|
Battery Drainage |
472 |
|
|
Bad User Interface |
474 |
|
|
Performing a Commercial Analysis |
474 |
|
|
Introducing Flurry Analytics |
475 |
|
|
Summary |
476 |
|
|
Chapter 16: Monetize Your App |
477 |
|
|
Introduction to Monetizing |
477 |
|
|
Paid Application |
478 |
|
|
Advertising |
478 |
|
|
In-App Purchases |
478 |
|
|
Subscriptions |
478 |
|
|
Lead Generation |
479 |
|
|
Affiliate Sales |
479 |
|
|
Developing In-App Purchases |
479 |
|
|
Introduction to In-App Purchase |
479 |
|
|
Registering Products |
480 |
|
|
Choosing the Product Type |
480 |
|
|
Understanding the In-App Purchase Process |
481 |
|
|
Implementing an In-App Purchase |
482 |
|
|
Monetizing with Advertisements |
503 |
|
|
Introducing the iAd Framework |
503 |
|
|
Implementing the AdMob Network |
506 |
|
|
Summary |
509 |
|
|
Chapter 17: Understanding iTunes Connect |
511 |
|
|
IOS Developer Member Center |
512 |
|
|
Obtaining a Developer Certificate |
512 |
|
|
Managing Devices |
516 |
|
|
Managing Apps |
519 |
|
|
Creating a Development Provisioning Profile |
526 |
|
|
Creating a Distribution Provisioning Profile |
529 |
|
|
Summary |
533 |
|
|
Chapter 18: Building and Distribution |
535 |
|
|
App Store Review |
535 |
|
|
Understanding the Review Guidelines |
536 |
|
|
Understanding the Review Process |
536 |
|
|
Understanding Rejections |
539 |
|
|
Avoiding Common Pitfalls |
539 |
|
|
Building for Ad Hoc Distribution |
540 |
|
|
Building Your Application |
540 |
|
|
Distribute for Testing |
542 |
|
|
Building for App Store Distribution |
544 |
|
|
Summary |
551 |
|
|
Appendix A: Audio Codes |
553 |
|
|
Appendix B: Artwork Dimensions |
557 |
|
|
Device Dimensions |
557 |
|
|
iTunes Connect Artwork Dimensions |
559 |
|
|
Index |
561 |
|
|
Advertisement |
578 |
|