Created
April 3, 2018 11:18
-
-
Save MW3000/ddf4d6c9c928470035438b6139927dc0 to your computer and use it in GitHub Desktop.
NSView Subclass Template Playground (Swift 4.1, Xcode 9.3)
This file contains 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 | |
// Swift 4.1, Xcode 9.3 | |
import Cocoa | |
import PlaygroundSupport | |
class CustomView: NSView { | |
override func draw(_ dirtyRect: NSRect) { | |
// Add your drawing code here. | |
} | |
} | |
let customView = CustomView(frame: NSRect(x: 0, y: 0, width: 400, height: 400)) | |
PlaygroundPage.current.liveView = customView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment