ENGLISH

Advanced Swift - objc.io

Book information

Publisher
objc.io
Year
2017
Language
english
Format
PDF
Filesize
15 MB (15290122 bytes)
Edition
3rd Edition
Pages
409\409
Time added
2019-02-07 16:10:03

Description

Introduction......Page 7 Who Is This Book For?......Page 9 Themes......Page 10 Terminology......Page 13 Swift Style Guide......Page 17 Built-In Collections......Page 18 Arrays......Page 20 Dictionaries......Page 38 Sets......Page 42 Ranges......Page 45 Collection Protocols......Page 50 Sequences......Page 52 Collections......Page 70 Conforming to Collection......Page 74 Indices......Page 82 Slices......Page 88 Specialized Collections......Page 92 Recap......Page 98 Optionals......Page 99 Sentinel Values......Page 101 Solving the Magic Value Problem with Enumerations......Page 103 A Tour of Optional Techniques......Page 105 When to Force-Unwrap......Page 134 Living Dangerously: Implicitly Unwrapped Optionals......Page 138 Recap......Page 139 Structs and Classes......Page 140 Value Types......Page 142 Mutability......Page 145 Structs......Page 148 Copy-On-Write......Page 156 Closures and Mutability......Page 166 Memory......Page 168 Closures and Memory......Page 173 Encoding and Decoding......Page 176 Overview......Page 178 A Minimal Example......Page 179 The Encoding Process......Page 182 The Synthesized Code......Page 186 Manual Conformance......Page 189 Common Coding Tasks......Page 192 Recap......Page 205 Functions......Page 206 Flexibility through Functions......Page 215 Local Functions and Variable Capture......Page 226 Functions as Delegates......Page 228 inout Parameters and Mutating Methods......Page 235 Properties......Page 239 Subscripts......Page 244 Key Paths......Page 247 Automatic Closures......Page 254 The @escaping Annotation......Page 257 Strings......Page 260 Unicode, Or: No More Fixed Width......Page 262 Grapheme Clusters and Canonical Equivalence......Page 264 Strings and Collections......Page 271 String Indices......Page 274 Substrings......Page 276 Code Unit Views......Page 281 Strings and Foundation......Page 285 Internal Structure of String and Character......Page 291 A Simple Regular Expression Matcher......Page 293 ExpressibleByStringLiteral......Page 296 CustomStringConvertible and CustomDebugStringConvertible......Page 297 Text Output Streams......Page 299 String Performance......Page 304 Recap......Page 308 Error Handling......Page 309 The Result Type......Page 312 Throwing and Catching......Page 313 Typed Errors......Page 316 Bridging Errors to Objective-C......Page 317 Errors and Function Parameters......Page 319 Cleaning Up Using defer......Page 321 Errors and Optionals......Page 322 Chaining Errors......Page 324 Higher-Order Functions and Errors......Page 325 Recap......Page 327 Generics......Page 328 Overloading......Page 330 Operating Generically on Collections......Page 339 Designing with Generics......Page 348 How Generics Work......Page 353 Recap......Page 357 Protocols......Page 358 Protocol-Oriented Programming......Page 362 Two Types of Protocols......Page 367 Protocols with Self Requirements......Page 373 Protocol Internals......Page 376 Recap......Page 378 Interoperability......Page 379 Hands-On: Wrapping CommonMark......Page 381 An Overview of Low-Level Types......Page 398 Function Pointers......Page 401 Final Words......Page 406

Similar books