Skip to content

Instantly share code, notes, and snippets.

@Gocrazy
Created August 24, 2018 14:10
Show Gist options
  • Select an option

  • Save Gocrazy/8127509aff2ea1c599b25c6a60ec759f to your computer and use it in GitHub Desktop.

Select an option

Save Gocrazy/8127509aff2ea1c599b25c6a60ec759f to your computer and use it in GitHub Desktop.
import UIKit
import PlaygroundSupport
class ViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .white
let box = UIView()
box.frame = CGRect(x: 0, y: 0, width: 100, height: 100)
box.backgroundColor = .blue
view.addSubview(box)
self.view = view
}
}
PlaygroundPage.current.needsIndefiniteExecution = false
PlaygroundPage.current.liveView = ViewController()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment