About the Author |
|
xi | |
About the Technical Reviewer |
|
xiii | |
Chapter 1 Organizing Code |
|
1 | (26) |
|
Using the II MARK: Comment |
|
|
3 | (2) |
|
|
5 | (6) |
|
|
11 | (3) |
|
|
14 | (5) |
|
Creating Custom Code Snippets |
|
|
17 | (1) |
|
Deleting Custom Code Snippets |
|
|
18 | (1) |
|
Using @IBDesignable and @IBInspectable |
|
|
19 | (7) |
|
|
26 | (1) |
Chapter 2 Debugging Code |
|
27 | (24) |
|
Simple Debugging Techniques |
|
|
30 | (4) |
|
|
34 | (15) |
|
|
35 | (1) |
|
|
36 | (5) |
|
|
41 | (4) |
|
Using Symbolic Breakpoints |
|
|
45 | (3) |
|
Using Conditional Breakpoints |
|
|
48 | (1) |
|
|
49 | (2) |
Chapter 3 Understanding Closures |
|
51 | (10) |
|
Closures with Multiple Parameters |
|
|
54 | (2) |
|
Understanding Value Capturing |
|
|
56 | (1) |
|
|
57 | (2) |
|
|
59 | (2) |
Chapter 4 Multithreaded Programming Using Grand Central Dispatch |
|
61 | (28) |
|
|
62 | (6) |
|
Using Grand Central Dispatch |
|
|
68 | (9) |
|
|
77 | (3) |
|
|
80 | (7) |
|
|
87 | (2) |
Chapter 5 Understanding the Application Life Cycle |
|
89 | (24) |
|
Getting State-Change Notifications |
|
|
90 | (8) |
|
Using Execution State Changes |
|
|
98 | (1) |
|
|
98 | (1) |
|
|
98 | (1) |
|
|
99 | (1) |
|
|
99 | (1) |
|
Displaying the Launch Screen |
|
|
99 | (2) |
|
Using the Notification Center |
|
|
101 | (10) |
|
|
111 | (2) |
Chapter 6 Understanding Data Persistence |
|
113 | (42) |
|
Storing Preferences in UserDefaults |
|
|
114 | (6) |
|
Storing Preferences in UserDefaults in the AppDelegate File |
|
|
120 | (11) |
|
Reading and Writing to Files |
|
|
131 | (5) |
|
|
136 | (16) |
|
Creating a Data Model File |
|
|
137 | (4) |
|
Customizing a Data Model File |
|
|
141 | (4) |
|
Designing the User Interface |
|
|
145 | (3) |
|
|
148 | (4) |
|
|
152 | (3) |
Chapter 7 Passing Data Between Files |
|
155 | (46) |
|
Sharing Data with the AppDelegate.swift File |
|
|
155 | (6) |
|
Sharing Data Between View Controllers |
|
|
161 | (31) |
|
|
163 | (16) |
|
Passing Data Backward with a Protocol |
|
|
179 | (8) |
|
Passing Data Backward with a Delegate |
|
|
187 | (5) |
|
Passing Data with the Notification Center |
|
|
192 | (6) |
|
|
198 | (3) |
Chapter 8 Translating with Localization |
|
201 | (34) |
|
Designing the User Interface |
|
|
202 | (3) |
|
Creating a Localization File |
|
|
205 | (4) |
|
|
209 | (4) |
|
Creating a Localized String File |
|
|
213 | (9) |
|
|
222 | (4) |
|
|
226 | (2) |
|
Formatting Numbers and Dates |
|
|
228 | (4) |
|
|
232 | (3) |
Chapter 9 Using 3D Touch |
|
235 | (42) |
|
|
236 | (3) |
|
Detecting 3D Touch Availability |
|
|
239 | (3) |
|
|
242 | (3) |
|
Creating Home Screen Quick Actions |
|
|
245 | (7) |
|
Responding to Quick Action Items |
|
|
252 | (7) |
|
Adding Dynamic Home Screen Quick Actions |
|
|
259 | (7) |
|
Adding Peeking, Popping, and Previewing |
|
|
266 | (10) |
|
|
276 | (1) |
Chapter 10 Detecting Motion and Orientation |
|
277 | (16) |
|
|
277 | (15) |
|
Understanding Core Motion |
|
|
281 | (1) |
|
|
282 | (3) |
|
Detecting Rotation with the Gyroscope |
|
|
285 | (4) |
|
Detecting Magnetic Fields |
|
|
289 | (1) |
|
Detecting Device Motion Data |
|
|
290 | (2) |
|
|
292 | (1) |
Chapter 11 Using Location and Maps |
|
293 | (20) |
|
|
293 | (5) |
|
|
294 | (1) |
|
Defining a Distance Filter |
|
|
295 | (1) |
|
|
296 | (1) |
|
|
296 | (1) |
|
|
297 | (1) |
|
|
298 | (5) |
|
|
303 | (4) |
|
|
307 | (4) |
|
|
311 | (2) |
Chapter 12 Playing Audio and Video |
|
313 | (20) |
|
|
314 | (9) |
|
|
323 | (4) |
|
Playing Videos on the Internet |
|
|
327 | (5) |
|
|
332 | (1) |
Chapter 13 Using the Camera |
|
333 | (12) |
|
|
333 | (2) |
|
|
335 | (2) |
|
Designing a Simple User Interface |
|
|
337 | (2) |
|
|
339 | (1) |
|
|
340 | (4) |
|
|
344 | (1) |
Chapter 14 Using WebKit |
|
345 | (12) |
|
Displaying Web Pages from the Internet |
|
|
345 | (6) |
|
|
351 | (5) |
|
|
356 | (1) |
Chapter 15 Displaying Animation |
|
357 | (42) |
|
Moving Items with Animation |
|
|
358 | (5) |
|
Customizing Animation with Delays and Options |
|
|
363 | (4) |
|
Customizing Animation with Damping and Velocity |
|
|
367 | (2) |
|
Resizing Items with Animation |
|
|
369 | (3) |
|
Rotating Items with Animation |
|
|
372 | (4) |
|
Changing Transparency with Animation |
|
|
376 | (3) |
|
Animating Transitions Between View Controllers |
|
|
379 | (14) |
|
Simple Animation Transition Between View Controllers |
|
|
393 | (5) |
|
|
398 | (1) |
Chapter 16 Using Machine Learning |
|
399 | (34) |
|
Understanding Machine Learning |
|
|
400 | (2) |
|
|
402 | (1) |
|
|
403 | (12) |
|
Identifying Objects from the Camera |
|
|
415 | (9) |
|
|
424 | (8) |
|
|
432 | (1) |
Chapter 17 Using Facial and Text Recognition |
|
433 | (38) |
|
Recognizing Faces in Pictures |
|
|
433 | (9) |
|
Highlighting Faces in an Image |
|
|
442 | (8) |
|
Highlighting Parts of a Face in an Image |
|
|
450 | (8) |
|
Recognizing Text in an Image |
|
|
458 | (11) |
|
|
469 | (2) |
Chapter 18 Using Speech |
|
471 | (20) |
|
Converting Speech to Text |
|
|
471 | (11) |
|
Recognizing Spoken Commands |
|
|
482 | (4) |
|
|
486 | (4) |
|
|
490 | (1) |
Chapter 19 Understanding SiriKit |
|
491 | (28) |
|
|
492 | (5) |
|
Defining How Siri Interacts with the User |
|
|
497 | (3) |
|
Understanding the IntentHandler.swift File |
|
|
500 | (4) |
|
Understanding the ExtensionUl Folder |
|
|
504 | (6) |
|
Creating a Payment App with Siri |
|
|
510 | (8) |
|
|
518 | (1) |
Chapter 20 Understanding ARKit |
|
519 | (36) |
|
|
519 | (9) |
|
Drawing Augmented Reality Objects |
|
|
528 | (3) |
|
Resetting the World Origin |
|
|
531 | (6) |
|
|
537 | (2) |
|
Modifying the Appearance of Shapes |
|
|
539 | (9) |
|
|
548 | (5) |
|
|
553 | (2) |
Chapter 21 Interacting with Augmented Reality |
|
555 | (30) |
|
Storing and Accessing Graphic Assets |
|
|
556 | (3) |
|
Working with Touch Gestures |
|
|
559 | (6) |
|
Detecting a Horizontal Plane |
|
|
565 | (6) |
|
|
571 | (1) |
|
|
572 | (12) |
|
|
584 | (1) |
Index |
|
585 | |