Chapter 4. Favorite Things
This chapter will introduce you to the concept of variables and constants. It will cover how we use them to manage state in an iOS application. We will take what you've learned in the last chapter in working with print
statements and build upon that to help you understand the problem that is solved using variables and constants.
The topics this chapter covers are as follows:
- Creating variables and constants
- Assigning a value to a variable
- Reading a value from a variable
Variables and constants
What's your favorite Disney song? Our is A Whole New World from Aladdin. What's your favorite ice cream flavor? For us, nothing beats vanilla. If we wanted to print out some of our favorite items in a playground file, we know how to ...
Get Swift iOS Programming for Kids now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.