Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//: Playground - noun: a place where people can play
import UIKit
UIGraphicsBeginImageContext(CGSize(width: 10, height: 10))
let context = UIGraphicsGetCurrentContext()
let path = CGPathCreateMutable()
CGPathMoveToPoint(path, nil, 0, 0)
CGPathAddLineToPoint(path, nil, 10, 10)
CGPathMoveToPoint(path, nil, 10, 0)
CGPathAddLineToPoint(path, nil, 0, 10)
CGContextAddPath(context, path)
CGContextSetLineWidth(context, 4)
CGContextSetGrayStrokeColor(context, 0.5, 1.0)
CGContextDrawPath(context, .Stroke)
UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment