Skip to content

Instantly share code, notes, and snippets.

@sketchytech
sketchytech / piechart.swift
Created February 15, 2016 16:39
Simple pie chart drawing code for iOS using CAShapeLayer and UIBezierPath
extension CGFloat {
func radians() -> CGFloat {
let b = CGFloat(M_PI) * (self/180)
return b
}
}
extension UIBezierPath {
convenience init(circleSegmentCenter center:CGPoint, radius:CGFloat, startAngle:CGFloat, endAngle:CGFloat)
{