Skip to content

Instantly share code, notes, and snippets.

@rockarts
Last active October 5, 2018 03:10
Show Gist options
  • Save rockarts/ce1fffebd8c874c3c778c549b4284cd0 to your computer and use it in GitHub Desktop.
Save rockarts/ce1fffebd8c874c3c778c549b4284cd0 to your computer and use it in GitHub Desktop.
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let draw = DrawView(frame: self.view.bounds)
view.addSubview(draw)
}
}
class DrawView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func draw( _ rect: CGRect) {
}
func drawLine(x:Int, y:Int, width:Int, height:Int) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment