Skip to content

Instantly share code, notes, and snippets.

@dfelber
Created May 15, 2016 16:50
Show Gist options
  • Save dfelber/fbc05ee743822350825f19afc44314be to your computer and use it in GitHub Desktop.
Save dfelber/fbc05ee743822350825f19afc44314be to your computer and use it in GitHub Desktop.
Minimal setup to show UIView in a Xcode Playground.
import UIKit
import XCPlayground
let someView = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
XCPlaygroundPage.currentPage.liveView = someView
@restebanez
Copy link

// For Xcode 8.2.1

import UIKit
import PlaygroundSupport

let someView = UIView(frame: CGRect(x: 0, y: 0, width: 400, height: 200))
PlaygroundPage.current.liveView = someView

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment