Skip to content

Instantly share code, notes, and snippets.

@greggjaskiewicz
Created September 7, 2016 09:20
Show Gist options
  • Save greggjaskiewicz/8835d5ad29784058ba8a775643014483 to your computer and use it in GitHub Desktop.
Save greggjaskiewicz/8835d5ad29784058ba8a775643014483 to your computer and use it in GitHub Desktop.
let button = UIButton(frame: CGRect(x: 75, y: 75, width: 100, height: 50))
button.backgroundColor = UIColor.green
button.setTitle("Boom Boom", for: .normal)
button.titleLabel?.textColor = UIColor.black
let view = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
PlaygroundPage.current.liveView = view
view.addSubview(button)
button.center = view.center
view.backgroundColor = UIColor.lightGray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment