Created
February 16, 2018 07:17
-
-
Save zenangst/dd7c32cfcd808e906516dcd55340f174 to your computer and use it in GitHub Desktop.
Setting a background color to an NSView - macOS Example
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
import Cocoa | |
let frame = CGRect(origin: .zero, size: CGSize(width: 100, height: 100)) | |
let view = NSView(frame: frame) | |
view.wantsLayer = true | |
view.layer?.backgroundColor = NSColor.blue.cgColor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment