更新时间:2021-07-16 13:54:25
封面
版权信息
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Chapter 1. Introducing Swift
Defining our goals for this book
Setting up the development environment
Running our first Swift code
Understanding playgrounds
Learning with this book
Summary
Chapter 2. Building Blocks – Variables Collections and Flow Control
Core Swift types
Swift's type system
Printing on the console
Control flow
Functions
Bringing it all together
Chapter 3. One Piece at a Time – Types Scopes and Projects
Structs
Classes
Enumerations
Projects
Extensions
Scope
Access control
Chapter 4. To Be or Not to Be – Optionals
Introducing optionals
Unwrapping an optional
Optional chaining
Implicitly unwrapped optionals
Debugging optionals
The underlying implementation
Chapter 5. A Modern Paradigm – Closures and Functional Programming
Functional programming philosophy
Closures
Building blocks of functional programming in Swift
Lazy evaluation
Curried functions
Chapter 6. Make Swift Work for You – Protocols and Generics
Protocols
Defining a generic
Extending the existing generics
Putting protocols and generics to use
Chapter 7. Everything is Connected – Memory Management
How data is stored in a computer
Value types versus reference types
Automatic reference counting
Strong reference cycles
Lost objects
Chapter 8. Writing Code the Swift Way – Design Patterns and Techniques
What is a design pattern?
Behavioral patterns
Structural patterns
Creational patterns
Using associated values effectively
Extending system types to reduce code
Lazy properties
Chapter 9. Harnessing the Past – Understanding and Translating Objective-C
Swift's relationship with Objective-C
The history of Objective-C
Constants and variables
Containers
Types
Calling Objective-C code from Swift
Using functions
Chapter 10. A Whole New World – Developing an App
Conceptualizing the app
Setting up the app project
Configuring the user interface
Running the app
Allowing picture taking
Temporarily saving a photo
Populating our photo grid
Refactoring to respect Model-View-Controller
Permanently saving a photo
Chapter 11. What's Next? Resources Advice and Next Steps
Apple's documentation
Forums and blogs
Prominent figures
Podcasts
Index