Created
October 13, 2016 03:31
-
-
Save josevazquez/36fb0aea593c4f3c7915c1a3ac99d26e to your computer and use it in GitHub Desktop.
Plain CoreGraphics calls in Swift
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
guard let ctxt = UIGraphicsGetCurrentContext() else { | |
print("BAILING OUT WITHOUT A GRAPHICS CONTEXT !!") | |
return | |
} | |
ctxt.setStrokeColor(gray:0, alpha:kKnobOpacity) | |
ctxt.setLineWidth(knobThickness) | |
ctxt.addEllipse(in:rect) | |
ctxt.strokePath() | |
ctxt.saveGState() | |
ctxt.setBlendMode(.copy) | |
ctxt.setStrokeColor(gray:0, alpha:0) | |
ctxt.setFillColor(gray:0, alpha:0) | |
fillCurvedDoubleArrow(ctxt:ctxt, center:boundsCenter, radius:innerRadius, thickness:knobThickness*0.2, angle:270, aperture:25) | |
ctxt.restoreGState() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment