Member-only story
Use Gestures: Even in Swift Playgrounds
You can use gestures for code written in Playgrounds!
Did you know that Playgrounds has support for gestures? No? Read on and find out!
Difficulty: Beginner | Easy | Normal | Challenging
You might be aware that Swift’s Playgrounds are a great way to write and test code quickly and easily.
Did you also know you can use liveView and gestures to create a fully functioning app?
Let’s go!
The end product
You’ll be able to drag and drop a shape on the background. Like (you know) in a very simple App. However — this will be happening in Playgrounds.
The explanation
Setting up the Playground
PlaygroundSupport has all you need to make the most of your playground experience.
By this I mean you can add
import PlaygroundSupport
which enables a collection of great features. One of these is to (assuming we have a MyViewController()
UIViewController…