About the Editor |
|
xv | |
|
Chapter 1 Introduction to Swift Programming Language |
|
|
1 | (36) |
|
|
4 | (25) |
|
|
5 | (3) |
|
|
8 | (4) |
|
Swift as the First Programming Language |
|
|
12 | (1) |
|
|
13 | (1) |
|
|
14 | (1) |
|
|
15 | (1) |
|
|
15 | (3) |
|
|
18 | (2) |
|
Protocol-Oriented Programming |
|
|
20 | (4) |
|
Libraries, Runtime, and Development |
|
|
24 | (2) |
|
|
26 | (1) |
|
Debugging and Other Elements |
|
|
26 | (1) |
|
|
27 | (2) |
|
|
29 | (3) |
|
|
32 | (5) |
|
Chapter 2 Getting Started with Swift |
|
|
37 | (44) |
|
Basic Swift Language Syntax |
|
|
38 | (12) |
|
Different Elements of the Playground |
|
|
43 | (1) |
|
Swift Playground Automatic or Manual Execution |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
48 | (1) |
|
|
49 | (1) |
|
Using Strings, Ints, Floats, And Bools |
|
|
50 | (16) |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
58 | (1) |
|
|
59 | (1) |
|
|
59 | (1) |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
String Functions and Operators |
|
|
62 | (2) |
|
Empty Character Variables |
|
|
64 | (1) |
|
Accessing Characters from Strings |
|
|
65 | (1) |
|
Concatenating Strings with Characters |
|
|
65 | (1) |
|
Building And Running Programs On C++ |
|
|
66 | (7) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
69 | (4) |
|
|
73 | (8) |
|
|
75 | (1) |
|
|
76 | (2) |
|
|
78 | (3) |
|
Chapter 3 Swift Basic Syntax |
|
|
81 | (52) |
|
|
83 | (4) |
|
Declaring Constants and Variables |
|
|
83 | (1) |
|
|
84 | (1) |
|
Naming Constants and Variables |
|
|
85 | (1) |
|
Printing Constants and Variables |
|
|
86 | (1) |
|
|
87 | (18) |
|
|
87 | (3) |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
91 | (1) |
|
|
92 | (2) |
|
|
94 | (2) |
|
Control Transfer Statements |
|
|
96 | (1) |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
98 | (2) |
|
|
100 | (1) |
|
|
101 | (2) |
|
Checking API Availability |
|
|
103 | (2) |
|
|
105 | (13) |
|
Defining and Calling Functions |
|
|
105 | (2) |
|
Function Parameters and Return Values |
|
|
107 | (1) |
|
Functions without Parameters |
|
|
108 | (1) |
|
Functions with Multiple Parameters |
|
|
108 | (1) |
|
Functions without Return Values |
|
|
109 | (1) |
|
Functions with Multiple Return Values |
|
|
109 | (2) |
|
Optional Tuple Return Types |
|
|
111 | (2) |
|
Functions with an Implicit Return |
|
|
113 | (1) |
|
Function Argument Labels and Parameter Names |
|
|
113 | (2) |
|
|
115 | (1) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
118 | (7) |
|
Comparing Structures and Classes |
|
|
119 | (3) |
|
Structure and Class Instances |
|
|
122 | (1) |
|
Memberwise Initializers for Structure Types |
|
|
123 | (1) |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
125 | (8) |
|
Iterating over Enumeration Cases |
|
|
127 | (1) |
|
|
128 | (1) |
|
|
129 | (1) |
|
Implicitly Assigned Raw Values |
|
|
129 | (2) |
|
|
131 | (2) |
|
Chapter 4 Swift Standard Library |
|
|
133 | (52) |
|
|
135 | (6) |
|
|
136 | (1) |
|
|
136 | (2) |
|
|
138 | (1) |
|
|
139 | (2) |
|
Comparing Dates with Foundation |
|
|
141 | (15) |
|
|
142 | (1) |
|
|
142 | (1) |
|
|
142 | (9) |
|
Creating a DateInterval Instance |
|
|
151 | (1) |
|
|
152 | (1) |
|
|
152 | (1) |
|
|
153 | (1) |
|
|
153 | (1) |
|
|
153 | (3) |
|
Fetching Data with Urlsession |
|
|
156 | (13) |
|
Setting Up the HTTP Request with URLSession |
|
|
158 | (1) |
|
Making the Request with URLSessionDataTask |
|
|
158 | (2) |
|
Printing the Returned Response Data |
|
|
160 | (1) |
|
Validating the Response Data |
|
|
160 | (2) |
|
Converting the Response Data to JSON |
|
|
162 | (4) |
|
Making POST Requests with URLSession |
|
|
166 | (1) |
|
Setting Up the HTTP POST Request with URLSession |
|
|
166 | (1) |
|
Setting Up the Request Headers and Body |
|
|
167 | (1) |
|
Making the Request with URLSessionUploadTask |
|
|
168 | (1) |
|
Printing the Returned Response Data |
|
|
168 | (1) |
|
|
169 | (8) |
|
|
170 | (1) |
|
|
171 | (1) |
|
Decodable and Encodable Protocols |
|
|
172 | (1) |
|
|
172 | (1) |
|
JSONDecoder and JSONEncoder |
|
|
173 | (1) |
|
|
173 | (2) |
|
|
175 | (1) |
|
|
176 | (1) |
|
|
177 | (8) |
|
Chapter 5 Creating iOS Apps with Swift |
|
|
185 | (38) |
|
|
188 | (12) |
|
Creating an Xcode Project for an App |
|
|
197 | (2) |
|
Managing Files in the Main Window |
|
|
199 | (1) |
|
Building An Ios App with Cocoa Touch |
|
|
200 | (13) |
|
|
202 | (1) |
|
|
203 | (2) |
|
|
205 | (5) |
|
|
210 | (1) |
|
|
210 | (1) |
|
|
211 | (2) |
|
Unit and Integration Testing Xctest |
|
|
213 | (10) |
|
Pros and Cons of XCTest Framework |
|
|
214 | (3) |
|
|
217 | (2) |
|
Writing an Integration Test |
|
|
219 | (1) |
|
|
219 | (1) |
|
Writing a Performance Test |
|
|
220 | (3) |
|
Chapter 6 Building Blocks of SwiftUI |
|
|
223 | (46) |
|
Swiftui Improvements On Macos |
|
|
225 | (1) |
|
Always-On Retina Display Support |
|
|
225 | (1) |
|
|
225 | (1) |
|
|
225 | (1) |
|
|
226 | (1) |
|
Controls, Views, and Lists |
|
|
227 | (9) |
|
Configuring a View with a Modifier |
|
|
232 | (1) |
|
Chain Modifiers to Achieve Complex Effects |
|
|
233 | (1) |
|
|
234 | (1) |
|
Using View-Specific Modifiers |
|
|
234 | (2) |
|
|
236 | (1) |
|
Exploring Text and Decoration |
|
|
236 | (9) |
|
|
238 | (7) |
|
Creating Custom Views and Lists |
|
|
245 | (24) |
|
Conforming to the View Protocol |
|
|
245 | (1) |
|
|
246 | (1) |
|
Assembling the View's Content |
|
|
246 | (2) |
|
Configuring Views with Modifiers |
|
|
248 | (1) |
|
|
248 | (1) |
|
Adding Your View to the View Hierarchy |
|
|
249 | (1) |
|
Creating and Modifying List View |
|
|
250 | (1) |
|
Supporting Selection in Lists |
|
|
251 | (1) |
|
Refreshing the List Content |
|
|
252 | (1) |
|
Supporting Multidimensional Lists |
|
|
253 | (2) |
|
Creating Hierarchical Lists |
|
|
255 | (2) |
|
|
257 | (8) |
|
|
265 | (4) |
|
Chapter 7 Machine Learning on Swift |
|
|
269 | (48) |
|
|
271 | (7) |
|
|
274 | (4) |
|
|
278 | (19) |
|
|
279 | (2) |
|
Creating a Text Classifier Model |
|
|
281 | (4) |
|
|
285 | (1) |
|
Recognizing Speech in Live Audio |
|
|
286 | (5) |
|
|
291 | (1) |
|
Classifying Sounds in an Audio File |
|
|
292 | (5) |
|
|
297 | (11) |
|
Tracking the User's Face in Real-Time |
|
|
303 | (5) |
|
Detecting Objects By Core ML and Vision |
|
|
308 | (9) |
Appraisal |
|
317 | (6) |
Index |
|
323 | |