Use SwiftUI in a Playground
Let your imagination run wild!
Playgrounds are a fantastic way of producing code, and you don’t even need a device in order to do so.
But how can you combine your love of SwiftUI with your love of Playgrounds? Read on.
Difficulty: Beginner | Easy | Normal | Challenging
Prerequisites:
- Install either Xcode on a Mac, or playgrounds on iPhone or iPad
Recommended: Be able to produce a “Hello, World!” Swift application (guide HERE)
Terminology
Playgrounds: A development environment that can be used to create Swift code
Swift: An open source programming language for macOS, iOS, watchOS and tvOS
Creating a Playground: On a Mac
You do need to have downloaded and installed Xcode on your machine
You can then go through the menu File > New Playground
I then choose iOS > New Playground in the following screen. By choosing iOS we get UIKit
imported for us (which is great, as we need that)