Preface |
|
xi | |
1 Cocoa Development Tools |
|
1 | (20) |
|
The Mac and iOS Developer Programs |
|
|
1 | (3) |
|
Registering for a Developer Program |
|
|
2 | (1) |
|
|
3 | (1) |
|
Creating Your First Project with Xcode |
|
|
4 | (9) |
|
|
7 | (6) |
|
Developing a Simple Swift Application |
|
|
13 | (4) |
|
|
13 | (2) |
|
|
15 | (2) |
|
|
17 | (2) |
|
Testing iOS Apps with TestFlight |
|
|
19 | (2) |
2 Programming with Swift |
|
21 | (42) |
|
The Swift Programming Language |
|
|
21 | (2) |
|
|
23 | (1) |
|
|
24 | (2) |
|
|
26 | (4) |
|
|
28 | (1) |
|
|
28 | (1) |
|
|
29 | (1) |
|
|
30 | (5) |
|
|
33 | (2) |
|
|
35 | (5) |
|
Using Functions as Variables |
|
|
37 | (2) |
|
|
39 | (1) |
|
|
40 | (12) |
|
|
42 | (1) |
|
Initialization and Deinitialization |
|
|
42 | (2) |
|
|
44 | (2) |
|
|
46 | (1) |
|
|
47 | (2) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
Interoperating with Objective-C |
|
|
52 | (1) |
|
Using Objective-C and Swift in the Same Project |
|
|
52 | (2) |
|
Using Swift Objects in Objective-C |
|
|
53 | (1) |
|
Using Objective-C Objects in Swift |
|
|
53 | (1) |
|
|
54 | (1) |
|
|
54 | (1) |
|
|
55 | (2) |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
57 | (2) |
|
Loading Data from Files and URLs |
|
|
57 | (1) |
|
Serialization and Deserialization |
|
|
58 | (1) |
|
|
59 | (4) |
|
|
59 | (1) |
|
|
60 | (3) |
3 Applications on OS X and iOS |
|
63 | (18) |
|
|
63 | (5) |
|
Applications, Frameworks, Utilities, and More |
|
|
64 | (1) |
|
What Are Apps Composed Of? |
|
|
65 | (2) |
|
Using NSBundle to Find Resources in Applications |
|
|
67 | (1) |
|
The Application Life Cycle |
|
|
68 | (7) |
|
|
68 | (2) |
|
|
70 | (5) |
|
|
75 | (3) |
|
|
76 | (2) |
|
Notifications with NSNotification |
|
|
78 | (3) |
4 Graphical User Interfaces |
|
81 | (26) |
|
Interfaces in OS X and iOS |
|
|
81 | (1) |
|
MVC and Application Design |
|
|
82 | (1) |
|
Nib Files and Storyboards |
|
|
82 | (7) |
|
|
83 | (3) |
|
|
86 | (1) |
|
|
87 | (1) |
|
How Nib Files and Storyboards Are Loaded |
|
|
88 | (1) |
|
Constructing an Interface |
|
|
89 | (3) |
|
Guidelines and Constraints |
|
|
90 | (2) |
|
Building an App with Nibs and Constraints |
|
|
92 | (3) |
|
|
95 | (3) |
|
|
98 | (1) |
|
|
98 | (3) |
|
|
99 | (1) |
|
|
100 | (1) |
|
|
101 | (6) |
|
|
102 | (1) |
|
|
103 | (4) |
5 Closures and Operation Queues |
|
107 | (10) |
|
|
108 | (1) |
|
Concurrency with Operation Queues |
|
|
109 | (1) |
|
Operation Queues and NSOperation |
|
|
110 | (1) |
|
Performing Work on Operation Queues |
|
|
110 | (1) |
|
|
111 | (6) |
6 Drawing Graphics in Views |
|
117 | (24) |
|
|
117 | (2) |
|
|
119 | (3) |
|
|
120 | (1) |
|
|
121 | (1) |
|
|
122 | (2) |
|
|
122 | (1) |
|
|
123 | (1) |
|
|
124 | (17) |
|
Filling with a Solid Color |
|
|
125 | (1) |
|
|
126 | (2) |
|
|
128 | (2) |
|
|
130 | (1) |
|
|
131 | (3) |
|
|
134 | (3) |
|
|
137 | (4) |
7 SpriteKit |
|
141 | (24) |
|
|
141 | (1) |
|
Making an App That Uses SpriteKit |
|
|
142 | (1) |
|
Working with SpriteKit Scenes |
|
|
143 | (2) |
|
|
145 | (2) |
|
Putting Sprites in Scenes |
|
|
147 | (1) |
|
|
148 | (1) |
|
|
149 | (1) |
|
|
150 | (1) |
|
|
151 | (1) |
|
Animating Content with Actions |
|
|
152 | (1) |
|
|
153 | (2) |
|
|
155 | (1) |
|
Adding Physics to SpriteKit Objects |
|
|
156 | (1) |
|
Adding Joints to SpriteKit Objects |
|
|
157 | (1) |
|
Lighting SpriteKit Scenes |
|
|
158 | (1) |
|
|
159 | (1) |
|
Using Shaders in SpriteKit |
|
|
159 | (3) |
|
|
162 | (3) |
8 SceneKit |
|
165 | (26) |
|
|
166 | (1) |
|
|
167 | (1) |
|
|
167 | (1) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
|
171 | (1) |
|
Animating Content in the Scene |
|
|
172 | (2) |
|
|
174 | (2) |
|
|
175 | (1) |
|
|
176 | (4) |
|
|
178 | (2) |
|
|
180 | (3) |
|
|
183 | (1) |
|
Loading Data from COLLADA Files |
|
|
184 | (3) |
|
Adding Physics to the Scene |
|
|
187 | (4) |
9 Audio and Video |
|
191 | (20) |
|
|
191 | (1) |
|
Playing Video with AVPlayer |
|
|
192 | (10) |
|
|
193 | (1) |
|
|
193 | (4) |
|
|
197 | (2) |
|
|
199 | (2) |
|
Playing Sound with AVAudioPlayer |
|
|
201 | (1) |
|
|
202 | (1) |
|
Working with the Photo Library |
|
|
203 | (8) |
|
Capturing Photos and Video from the Camera |
|
|
204 | (2) |
|
Building a Photo Application |
|
|
206 | (3) |
|
|
209 | (2) |
10 iCloud and Data Storage |
|
211 | (32) |
|
|
211 | (3) |
|
Registering Default Preferences |
|
|
212 | (1) |
|
|
213 | (1) |
|
|
213 | (1) |
|
Working with the Filesystem |
|
|
214 | (5) |
|
|
215 | (4) |
|
|
219 | (1) |
|
|
219 | (3) |
|
|
219 | (1) |
|
|
220 | (1) |
|
Security-Scoped Bookmarks |
|
|
221 | (1) |
|
|
222 | (1) |
|
|
223 | (1) |
|
|
224 | (1) |
|
Testing Whether iCloud Works |
|
|
224 | (1) |
|
|
225 | (5) |
|
Handling External Changes |
|
|
226 | (1) |
|
|
227 | (3) |
|
|
230 | (7) |
|
|
230 | (5) |
|
|
235 | (2) |
|
|
237 | (4) |
|
|
241 | (2) |
11 Cocoa Bindings |
|
243 | (14) |
|
|
243 | (1) |
|
|
244 | (3) |
|
|
247 | (1) |
|
Array and Object Controllers |
|
|
248 | (1) |
|
A More Complex Bindings App |
|
|
249 | (8) |
12 Table Views and Collection Views |
|
257 | (20) |
|
Data Sources and Delegates |
|
|
257 | (1) |
|
|
258 | (14) |
|
|
258 | (8) |
|
|
266 | (6) |
|
|
272 | (5) |
|
|
272 | (5) |
13 Document-Based Applications |
|
277 | (18) |
|
The NSDocument and UlDocument Classes |
|
|
278 | (1) |
|
|
278 | (2) |
|
|
279 | (1) |
|
|
280 | (1) |
|
Document-Based Applications on OS X |
|
|
280 | (8) |
|
|
281 | (1) |
|
Representing Documents with NSDocument |
|
|
281 | (1) |
|
|
282 | (2) |
|
|
284 | (4) |
|
Document-Based Applications on iOS |
|
|
288 | (7) |
14 Networking |
|
295 | (14) |
|
|
295 | (4) |
|
|
296 | (1) |
|
|
297 | (1) |
|
|
298 | (1) |
|
NSURLResponse and NSHTTPURLResponse |
|
|
298 | (1) |
|
Building a Networked Application |
|
|
299 | (2) |
|
Bonjour Service Discovery |
|
|
301 | (2) |
|
Browsing for Shared iTunes Libraries |
|
|
301 | (2) |
|
|
303 | (6) |
15 Working with the Real World |
|
309 | (42) |
|
|
309 | (7) |
|
|
310 | (2) |
|
The Core Location Framework |
|
|
312 | (1) |
|
Working with Core Location |
|
|
313 | (3) |
|
|
316 | (3) |
|
Region Monitoring and iBeacons |
|
|
319 | (3) |
|
|
322 | (1) |
|
|
322 | (4) |
|
|
322 | (1) |
|
|
323 | (1) |
|
|
324 | (2) |
|
|
326 | (7) |
|
|
327 | (4) |
|
Using the Built-in Altimeter |
|
|
331 | (1) |
|
|
332 | (1) |
|
|
333 | (3) |
|
|
334 | (1) |
|
|
335 | (1) |
|
|
336 | (2) |
|
|
338 | (2) |
|
Authenticating Using Touch ID |
|
|
340 | (4) |
|
|
344 | (7) |
16 EventKit |
|
351 | (12) |
|
|
351 | (1) |
|
Accessing the Event Store |
|
|
352 | (1) |
|
|
353 | (1) |
|
|
354 | (1) |
|
|
355 | (1) |
|
Building an Events Application |
|
|
356 | (5) |
|
|
361 | (2) |
17 Instruments and the Debugger |
|
363 | (26) |
|
Getting Started with Instruments |
|
|
364 | (6) |
|
The Instruments Interface |
|
|
366 | (1) |
|
|
367 | (1) |
|
Adding Instruments from the Library |
|
|
368 | (2) |
|
Fixing Problems Using Instruments |
|
|
370 | (4) |
|
|
374 | (2) |
|
|
376 | (4) |
|
|
376 | (3) |
|
Inspecting Memory Contents |
|
|
379 | (1) |
|
Working with the Debugger Console |
|
|
380 | (1) |
|
|
380 | (3) |
|
|
383 | (3) |
|
|
383 | (2) |
|
Writing Asynchronous Tests |
|
|
385 | (1) |
|
Performance-Testing Blocks with Tests |
|
|
385 | (1) |
|
|
386 | (1) |
|
|
386 | (3) |
18 Sharing and Notifications |
|
389 | (22) |
|
|
389 | (3) |
|
|
392 | (3) |
|
|
395 | (1) |
|
|
395 | (9) |
|
Registering Notification Settings |
|
|
396 | (6) |
|
|
402 | (1) |
|
What Happens When a Notification Arrives |
|
|
403 | (1) |
|
Sending Push Notifications |
|
|
404 | (1) |
|
Setting Up to Receive Push Notifications |
|
|
405 | (1) |
|
Receiving Push Notifications |
|
|
406 | (2) |
|
|
408 | (3) |
19 Nonstandard Apps |
|
411 | (12) |
|
|
411 | (1) |
|
|
412 | (5) |
|
How Preference Panes Work |
|
|
413 | (1) |
|
|
414 | (1) |
|
Building a Sample Preference Pane |
|
|
415 | (2) |
|
|
417 | (2) |
|
Building a Status Bar App |
|
|
417 | (2) |
|
iOS Apps with Multiple Windows |
|
|
419 | (4) |
20 Working with Text |
|
423 | (20) |
|
Internationalization and Localization |
|
|
423 | (9) |
|
|
423 | (1) |
|
Creating a Sample Localized Application |
|
|
424 | (8) |
|
Formatting Data with NSFormatter |
|
|
432 | (3) |
|
Testing Different Locales |
|
|
434 | (1) |
|
Formatting Numbers, Lengths, Mass, Energy, and Data |
|
|
435 | (3) |
|
|
435 | (1) |
|
NSEnergyFormatter, NSMassFormatter, and NSLengthFormatter |
|
|
436 | (1) |
|
|
437 | (1) |
|
Detecting Data with NSDataDetector |
|
|
438 | (2) |
|
|
440 | (3) |
Index |
|
443 | |