Create a new playground file:
Name your playground and select the platform (iOS/macOS/tvOS), then click Next.
Using Playground it is easy to see that happens inside loops or objects while the change is happening.
For example, in the code below, the value of x
will change from 1 to 4.
import UIKit
for x in [1, 2, 3, 4] {
x
}
(1) Clicking on the eye symbol on the right will give us a quick look.
(2) Clicking on the circle next to it will open show the Latest Value below the line.
(3) Right click on the view added will show a drop down menu with Latest Value, Value History and Graph
Images, static data, sounds, etc. are resources in a Playground.
Resources
folder orlet i = UIImage(named: "tacos.jpg")