更新时间:2021-07-08 10:49:53
封面
版权页
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Taking the First Steps with Swift
What is Swift?
Playgrounds
Hello World
Summary
Chapter 2. Learning About Variables Constants Strings and Operators
Constants and variables
Operators
Chapter 3. Using Swift Collections and the Tuple Type
Swift collection types
Mutability
Arrays
Dictionaries
Set
Tuples
Chapter 4. Control Flow and Functions
What we have learned so far
Control flow
Functions
Putting it all together
Chapter 5. Classes and Structures
What are classes and structures?
Creating a class or structure
Custom initializers
Inheritance
Overriding methods and properties
Protocols
Protocol syntax
Extensions
Memory management
Chapter 6. Using Protocols and Protocol Extensions
Protocols as types
Polymorphism with protocols
Type casting with protocols
Protocol extensions
Chapter 7. Protocol-Oriented Design
Requirements
Object-Oriented design
Chapter 8. Writing Safer Code with Availability and Error Handling
Error handling prior to Swift 2.0
Native error handling
The availability attribute
Chapter 9. Custom Subscripting
Introducing subscripts
Subscripts with Swift arrays
Read and write custom subscripts
Read-only custom subscripts
Calculated subscripts
Subscript values
External names for subscripts
Multidimensional subscripts
When not to use a custom subscript
Chapter 10. Using Optional Types
Introducing optionals
The need for optional types in Swift
Optional chaining
Chapter 11. Working with Generics
An introduction to generics
Generic functions
Generic types
Associated types
When not to use generics
Chapter 12. Working with Closures
An introduction to closures
Simple closures
Shorthand syntax for closures
Using closures with Swift's array algorithms
Standalone closures and good style guidelines
Changing functionality
Selecting a closure based on results
Creating strong reference cycles with closures
Chapter 13. Using Mix and Match
What is mix and match?
When to use mix and match
Using Swift and Objective-C together in the same project