
iOS 15 Programming for Beginners
By :

As you have seen in Chapter 1, Getting Familiar with Xcode, an Xcode project does not have a Results area that a playground has, but both project and playground have a Debug area. Using the print()
statement will print anything between the brackets to the Debug area.
Important Information
The print()
statement is a function. You'll learn more about functions in Chapter 6, Functions and Closures.
Add the following code to your playground and click the Play/Stop button to run it:
print(ratingResult)
You'll see the value of ratingResult
appear in the Debug area:
Figure 2.18: Debug area showing result of print() statement
When you're just starting out, feel free to use as many print()
statements as you like. It's a really good way to understand what is happening in your program.