List of s

 

Chapter 2. Introduction to Swift playgrounds

Listing 2.1. Convert Int to a Double

Listing 2.2. How many pizza slices per person?

Listing 2.3. Using arrays

Listing 2.4. Using sets

Listing 2.5. Using dictionaries

Listing 2.6. if, else, and while statements

Listing 2.7. for-in loop with range

Listing 2.8. switch statement

Listing 2.9. Function syntax

Listing 2.10. Modify external parameter name

Listing 2.11. Omit external parameter name

Listing 2.12. Default parameter name

Listing 2.13. Pyramid of doom

Listing 2.14. Multiple optional binding

Listing 2.15. The guard statement

Listing 2.16. The guard let statement

Listing 2.17. Merge guard statements

Listing 2.18. The ternary conditional operator

Listing 2.19. The nil coalescing operator

Listing 2.20. Implicitly unwrapped optional

Listing 2.21. Using tuples

Chapter 3. Swift objects

Listing 3.1. Overloading a function with different parameter names

Listing 3.2. Overloading a function with different parameter data types

Listing 3.3. Class inheritance

Listing 3.4. Override method

Listing 3.5. Call super

Listing 3.6. Extending a protocol

Listing 3.7. Changes to reference types

Listing 3.8. Changes to value types

Chapter 4. View controllers, views, and outlets

Listing 4.1. Add label

Chapter 5. User interaction

Chapter 6. Adaptive layout