Table of Contents

 

Copyright

Brief Table of Contents

Table of Contents

Preface

Acknowledgements

About this Book

Chapter 1. Introducing Swift in depth

1.1. The sweet spot of Swift

1.2. Below the surface

1.3. Swift’s downsides

1.3.1. Module stability

1.3.2. Strictness

1.3.3. Protocols are tricky

1.3.4. Concurrency

1.3.5. Venturing away from Apple’s platforms

1.3.6. Compile times

1.4. What you will learn in this book

1.5. How to make the most of this book

1.6. Minimum qualifications

1.7. Swift version

Summary

Chapter 2. Modeling data with enums

2.1. Or vs. and

2.1.1. Modeling data with a struct

2.1.2. Turning a struct into an enum

2.1.3. Deciding between structs and enums

2.2. Enums for polymorphism

2.2.1. Compile-time polymorphism

2.3. Enums instead of subclassing

2.3.1. Forming a model for a workout app

2.3.2. Creating a superclass

2.3.3. The downsides of subclassing

2.3.4. Refactoring a data model with enums

2.3.5. Deciding on subclassing or enums

2.3.6. Exercises

2.4. Algebraic data types

2.4.1. Sum types