Created
January 23, 2019 10:19
-
-
Save novinfard/d725bb8c91df9c9011369e59a2b77e36 to your computer and use it in GitHub Desktop.
[Live View in Playground]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
import PlaygroundSupport | |
class CustomView: UIView { | |
override func draw(_ rect: CGRect) { | |
super.draw(rect) | |
// draw stuff | |
let rect = UIBezierPath(roundedRect: CGRect(x: 150, y: 150, width: 100, height: 100), cornerRadius: 5.0) | |
UIColor.green.set() | |
rect.fill() | |
} | |
} | |
let containerView = CustomView(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) | |
containerView.backgroundColor = UIColor.blue | |
PlaygroundPage.current.liveView = containerView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment