问题
I'm trying to update code to swift 3 but I can't find anything about CGPathAddCurveToPoint, how can I fix the error?
path is a CGMutablePath
CGPathAddCurveToPoint(path, nil, 10, 10, 20, 20, 30, 30)
error: nil is not compatible with expected argument type 'UnsafePoiter'
I found that CGPathAddLineToPoint(path, nil, 10, 10) became path.addLine(to: p0)
回答1:
Please read the CGMutablePath docs:
https://developer.apple.com/reference/coregraphics/cgmutablepath
You will find:
func addCurve(to end: CGPoint, control1: CGPoint, control2: CGPoint,
transform: CGAffineTransform = default)
Note that this is now a method, not a loose global function.
来源:https://stackoverflow.com/questions/39554110/swift-3-cgpathaddcurvetopoint