let context: CGContext = UIGraphicsGetCurrentContext()! let toCenter = CGPoint(x: bounds.width/2.0, y: bounds.height/2.0) let angle = CGFloat(M_PI / 16) var transform = CGAffineTransformIdentity for _ in 0..<32 { triangulateRect(bounds, inputTransform: transform, context: context) transform = CGAffineTransformTranslate(transform, toCenter.x, toCenter.y) transform = CGAffineTransformRotate(transform, angle) transform = CGAffineTransformTranslate(transform, -toCenter.x, -toCenter.y) } CGContextSetLineWidth(context, bounds.size.width / 100) CGContextSetGrayStrokeColor(context, 0.5, 1.0) CGContextDrawPath(context, .Stroke) } Swiftϓϩάϥϛϯάษڧձ 2016/5/19 24