Skip to content

Instantly share code, notes, and snippets.

@andresbrun
Last active December 21, 2016 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresbrun/137a95105cdec26dd327bc8c52d525ec to your computer and use it in GitHub Desktop.
Save andresbrun/137a95105cdec26dd327bc8c52d525ec to your computer and use it in GitHub Desktop.
Create easily a view in Playground to play with
import UIKit
import PlaygroundSupport
let containerView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 320.0, height: 480.0))
// Play with containerView
let targetView = UIView(frame: CGRect(x: containerView.bounds.midX,
y: containerView.bounds.midY,
width: 50.0,
height: 50.0))
containerView.addSubview(targetView)
PlaygroundPage.current.liveView = containerView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment