About the Author |
|
xvii | |
About the Technical Reviewer |
|
xix | |
Acknowledgments |
|
xxi | |
Introduction |
|
xxiii | |
Chapter 1 Hello Swift |
|
1 | (14) |
|
Improvements over Objective-C |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
3 | (2) |
|
|
5 | (4) |
|
|
9 | (4) |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
13 | (2) |
Chapter 2 The Swift Playground in Xcode 6 |
|
15 | (14) |
|
Getting Started with a Playgorund |
|
|
15 | (5) |
|
|
20 | (1) |
|
|
20 | (1) |
|
|
21 | (1) |
|
XCPSetExecutionShouldContinuelndefinitely |
|
|
21 | (1) |
|
Custom Modules for Playground |
|
|
21 | (6) |
|
|
22 | (5) |
|
|
27 | (2) |
Chapter 3 Accessing Swift's Compiler and Interpreter: REPL |
|
29 | (4) |
|
|
29 | (2) |
|
|
31 | (1) |
|
|
32 | (1) |
Chapter 4 Introduction to Object-Oriented Programming |
|
33 | (10) |
|
|
34 | (1) |
|
Indirection and Variables |
|
|
34 | (1) |
|
|
35 | (3) |
|
Objected Oriented Implementation |
|
|
38 | (4) |
|
|
42 | (1) |
Chapter 5 Constants, Variables, and Data Types |
|
43 | (12) |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
47 | (1) |
|
|
47 | (2) |
|
|
49 | (5) |
|
|
49 | (2) |
|
|
51 | (2) |
|
|
53 | (1) |
|
|
53 | (1) |
|
|
54 | (1) |
Chapter 6 Operators |
|
55 | (12) |
|
|
55 | (1) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
56 | (8) |
|
|
56 | (1) |
|
|
56 | (7) |
|
|
63 | (1) |
|
|
64 | (2) |
|
|
64 | (1) |
|
|
65 | (1) |
|
|
66 | (1) |
Chapter 7 Flow Control |
|
67 | (14) |
|
|
67 | (3) |
|
|
67 | (2) |
|
For-conditional-Increment |
|
|
69 | (1) |
|
|
70 | (1) |
|
|
71 | (1) |
|
|
71 | (1) |
|
|
72 | (7) |
|
|
74 | (2) |
|
Control Transfer Statements |
|
|
76 | (3) |
|
|
79 | (2) |
Chapter 8 Functions and Closures |
|
81 | (12) |
|
|
81 | (1) |
|
|
82 | (1) |
|
|
83 | (1) |
|
|
84 | (1) |
|
|
85 | (1) |
|
|
85 | (1) |
|
|
86 | (1) |
|
|
86 | (1) |
|
|
87 | (1) |
|
Functions as Return Values |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
88 | (1) |
|
|
89 | (1) |
|
Inferring Types from Context |
|
|
90 | (1) |
|
|
90 | (1) |
|
|
90 | (1) |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
92 | (1) |
Chapter 9 Classes and Structures |
|
93 | (10) |
|
|
93 | (1) |
|
|
94 | (1) |
|
|
95 | (1) |
|
Value Types vs. Reference Types |
|
|
95 | (2) |
|
Choosing Between Classes or Structures |
|
|
97 | (1) |
|
|
97 | (1) |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
99 | (1) |
|
|
100 | (1) |
|
|
101 | (1) |
|
|
102 | (1) |
Chapter 10 Methods |
|
103 | (6) |
|
|
103 | (2) |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
107 | (2) |
Chapter 11 Access Control |
|
109 | (8) |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
110 | (1) |
|
|
111 | (1) |
|
|
112 | (1) |
|
|
112 | (1) |
|
|
112 | (1) |
|
|
113 | (1) |
|
|
113 | (1) |
|
|
114 | (1) |
|
|
114 | (1) |
|
|
114 | (1) |
|
|
115 | (1) |
|
|
115 | (1) |
|
|
115 | (2) |
Chapter 12 Inheritance |
|
117 | (6) |
|
|
117 | (1) |
|
|
118 | (1) |
|
|
118 | (2) |
|
|
120 | (1) |
|
|
121 | (1) |
|
|
121 | (2) |
Chapter 13 Extensions |
|
123 | (6) |
|
|
124 | (1) |
|
|
125 | (1) |
|
|
125 | (1) |
|
|
126 | (1) |
|
|
126 | (1) |
|
|
127 | (1) |
|
|
127 | (1) |
|
|
128 | (1) |
Chapter 14 Memory Management and ARC |
|
129 | (12) |
|
|
130 | (1) |
|
|
130 | (1) |
|
|
130 | (1) |
|
|
131 | (1) |
|
|
132 | (1) |
|
Resolving Strong Reference Cycles |
|
|
133 | (1) |
|
|
134 | (1) |
|
|
135 | (2) |
|
Strong Reference Cycles and Closures |
|
|
137 | (2) |
|
|
139 | (2) |
Chapter 15 Protocols |
|
141 | (8) |
|
|
141 | (3) |
|
|
142 | (2) |
|
|
144 | (1) |
|
|
144 | (4) |
|
|
145 | (1) |
|
|
146 | (1) |
|
Conformance with Extensions |
|
|
147 | (1) |
|
Protocols and Collection Types |
|
|
147 | (1) |
|
|
147 | (1) |
|
|
148 | (1) |
|
|
148 | (1) |
Chapter 16 Generics |
|
149 | (8) |
|
|
149 | (2) |
|
|
151 | (2) |
|
|
153 | (3) |
|
|
156 | (1) |
Chapter 17 Expressions |
|
157 | (8) |
|
|
157 | (1) |
|
|
158 | (1) |
|
|
158 | (1) |
|
|
158 | (1) |
|
|
159 | (1) |
|
|
159 | (1) |
|
|
160 | (1) |
|
|
160 | (1) |
|
|
161 | (1) |
|
|
161 | (1) |
|
|
162 | (1) |
|
Implicit Member Expression |
|
|
163 | (1) |
|
|
163 | (1) |
|
|
164 | (1) |
Chapter 18 Interoperability with Objective-C |
|
165 | (12) |
|
|
166 | (1) |
|
|
167 | (1) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
|
170 | (1) |
|
|
171 | (1) |
|
|
171 | (2) |
|
|
173 | (1) |
|
|
173 | (1) |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
175 | (1) |
|
|
175 | (1) |
|
|
176 | (1) |
Chapter 19 Mix and Match |
|
177 | (8) |
|
Importing Objective-C into Swift in the Same App Target |
|
|
178 | (2) |
|
Importing Swift into Objective-C in the Same App Target |
|
|
180 | (1) |
|
Importing Objective-C into Swift in the Same Framework Target |
|
|
181 | (1) |
|
Importing Swift into Objective-C in the Same Framework Target |
|
|
181 | (1) |
|
|
182 | (1) |
|
Using Swift in Objective-C |
|
|
182 | (1) |
|
|
183 | (2) |
Chapter 20 Working with Core Data |
|
185 | (18) |
|
|
186 | (1) |
|
|
186 | (1) |
|
|
186 | (1) |
|
NSPersistentStoreCoordinator |
|
|
186 | (1) |
|
|
186 | (1) |
|
|
186 | (2) |
|
|
187 | (1) |
|
|
188 | (10) |
|
|
191 | (7) |
|
|
198 | (1) |
|
|
199 | (3) |
|
|
202 | (1) |
Chapter 21 Consuming RESTful Services |
|
203 | (8) |
|
|
203 | (1) |
|
|
204 | (1) |
|
|
204 | (1) |
|
|
204 | (1) |
|
|
204 | (6) |
|
|
210 | (1) |
Chapter 22 Developing a Swift-Based Application |
|
211 | (26) |
|
|
211 | (24) |
|
|
212 | (11) |
|
|
223 | (11) |
|
|
234 | (1) |
|
|
235 | (2) |
Index |
|
237 | |