源代码:
public /*not inherited*/ init(roundedRect rect: CGRect, cornerWidth: CGFloat, cornerHeight: CGFloat, transform: UnsafePointer<CGAffineTransform>?)
传参数的代码:
let path3 = CGPath.init(roundedRect: CGRect.init(x:100, y: 200, width: 200, height: 200), cornerWidth: 100, cornerHeight:100, transform:[CGAffineTransform(translationX:-100, y:100)])
context.setFillColor(UIColor.red.cgColor)
context.addPath(path3)
context.fillPath()
网友评论