In swift playgrounds how do you setup a viewcontroller and use it? I\'ve done it with a UIView before but the UI gets cut when in a difference orientation so I want to try use a
I found that to create a viewcontroller in swift playgrounds you need this code
import UIKit
import PlaygroundSupport
class ViewController:UIViewController{
override func viewDidLoad() {
super.viewDidLoad()
}
}
let viewController = ViewController()
PlaygroundPage.current.liveView = viewController
PlaygroundPage.current.needsIndefiniteExecution = true