更新时间:2021-07-16 14:12:31
封面
版权信息
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Chapter 1. Taking the First Steps with Swift
What is Swift?
Playgrounds
Swift language syntax
Hello world
Summary
Chapter 2. Learning about Variables Constants Strings and Operators
Constants and variables
Defining constants and variables
Numeric types
The Boolean type
The string type
Optional variables
Enumerations
Operators
Chapter 3. Using Collections and Cocoa Data Types
Swift collection types
Mutability
Arrays
Dictionaries
Tuples
Using Cocoa data types
Foundation data types
Chapter 4. Control Flow and Functions
What we have learned so far
Control flow
Functions
Chapter 5. Classes and Structures
What are classes and structures?
Creating a class or structure
Initializer
Inheritance
Overriding methods and properties
Protocols
Extensions
Memory management
Chapter 6. Working with XML and JSON Data
XML and JSON
Common files
XML and the NSXMLParser class
Using the NSXMLParserDelegate protocol
Parsing XML documents
XML and manually building XML documents
JSON and NSJSONSerialization
Chapter 7. Custom Subscripting
Introducing subscripts
Subscripts with Swift arrays
Read and write custom subscripts
Read only custom subscripts
Calculated subscripts
Subscript values
Subscripts with ranges
External names for subscripts
Multidimensional subscripts
When not to use a custom subscript
Chapter 8. Using Optional Type and Optional Chaining
Introducing optionals
The need for optional types in Swift
Optional chaining
Chapter 9. Working with Generics
Introduction to generics
Generic functions
Generic types
Associated types
Chapter 10. Working with Closures
Introducing closures
Simple closures
Shorthand syntax for closures
Using closures with Swift's array algorithms
Standalone closures and good style guidelines
Changing functionality
Select a closure based on results
Strong reference cycles with closures
Chapter 11. Using Mix and Match
What is mix and match?
Using Swift and Objective-C together in the same project
Chapter 12. Concurrency and Parallelism in Swift
Concurrency and parallelism
Chapter 13. Swift Formatting and Style Guide
What is a programming style guide?
Your style guide