Skip to content

Instantly share code, notes, and snippets.

@rmirabelli
Last active March 9, 2018 20:37
Show Gist options
  • Save rmirabelli/262d1d457c88c1042508422d31bf3e2d to your computer and use it in GitHub Desktop.
Save rmirabelli/262d1d457c88c1042508422d31bf3e2d to your computer and use it in GitHub Desktop.
Adding a layer to our view. This may feel foreign to iOS developers.
let metalLayer = CAMetalLayer()
metalLayer.device = device
let view = NSView(frame: NSRect(x: 0, y: 0, width: 400, height: 400))
view.layer = metalLayer
PlaygroundPage.current.liveView = view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment