Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. class Drawing: NSView {
  2. override func drawRect(dirtyRect: NSRect) {
  3. super.drawRect(dirtyRect)
  4.  
  5. let context = NSGraphicsContext.currentContext()?.CGContext;
  6.  
  7. CGContextBeginPath(context)
  8. CGContextMoveToPoint(context, 0, 0)
  9. CGContextAddLineToPoint(context, 100, 100)
  10. CGContextSetRGBStrokeColor(context, 1, 1, 1, 1)
  11. CGContextSetLineWidth(context, 5.0)
  12. CGContextStrokePath(context)
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement