swift 3 CGPathAddCurveToPoint
swift 3 CGPathAddCurveToPoint
我正在尝试将代码更新为 swift 3,但我找不到任何关于 CGPathAddCurveToPoint 的信息,我该如何修复错误?
路径是一个 CGMutablePath
CGPathAddCurveToPoint(path, nil, 10, 10, 20, 20, 30, 30)
错误:nil 与预期的参数类型不兼容 'UnsafePoiter'
我发现 CGPathAddLineToPoint(path, nil, 10, 10)
变成了 path.addLine(to: p0)
请阅读 CGMutablePath 文档:
https://developer.apple.com/reference/coregraphics/cgmutablepath
你会发现:
func addCurve(to end: CGPoint, control1: CGPoint, control2: CGPoint,
transform: CGAffineTransform = default)
请注意,这现在是一个 方法 ,而不是一个松散的全局函数。
我正在尝试将代码更新为 swift 3,但我找不到任何关于 CGPathAddCurveToPoint 的信息,我该如何修复错误?
路径是一个 CGMutablePath
CGPathAddCurveToPoint(path, nil, 10, 10, 20, 20, 30, 30)
错误:nil 与预期的参数类型不兼容 'UnsafePoiter'
我发现 CGPathAddLineToPoint(path, nil, 10, 10) 变成了 path.addLine(to: p0)
请阅读 CGMutablePath 文档:
https://developer.apple.com/reference/coregraphics/cgmutablepath
你会发现:
func addCurve(to end: CGPoint, control1: CGPoint, control2: CGPoint,
transform: CGAffineTransform = default)
请注意,这现在是一个 方法 ,而不是一个松散的全局函数。