'CGPathGetBoundingBox' 已替换为 属性 'CGPath.boundingBox'
'CGPathGetBoundingBox' has been replaced by property 'CGPath.boundingBox'
我正在集成早期 Swift
编写的库。由于该库与 Swift 4 的兼容版本不可用,我正在自己删除错误。
有这一行:
let pathBounds = CGPathGetBoundingBox(path.cgPath);
给出错误:
'CGPathGetBoundingBox' has been replaced by property
'CGPath.boundingBox'
连同警告:
'CGPathGetBoundingBox' was obsoleted in Swift 3
(CoreGraphics.CGPathGetBoundingBox)
它在 Swift 4 中的替代品是什么? CGPath
class 中有一个函数 boundingBox
但我不知道如何使用它。
很简单:
path.cgPath.boundingBox
我正在集成早期 Swift
编写的库。由于该库与 Swift 4 的兼容版本不可用,我正在自己删除错误。
有这一行:
let pathBounds = CGPathGetBoundingBox(path.cgPath);
给出错误:
'CGPathGetBoundingBox' has been replaced by property 'CGPath.boundingBox'
连同警告:
'CGPathGetBoundingBox' was obsoleted in Swift 3 (CoreGraphics.CGPathGetBoundingBox)
它在 Swift 4 中的替代品是什么? CGPath
class 中有一个函数 boundingBox
但我不知道如何使用它。
很简单:
path.cgPath.boundingBox