'CGAffineTransformMake' 在 swift 3 中不可用
'CGAffineTransformMake' is unavailable in swift 3
此代码无法在 swift 3:
中编译
let flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, newSize.height)
context.concatenate(flipVertical)
我该如何转换它?
CGAffineTransformMake
变为 CGAffineTransform
并且初始化器现在需要标签。
let flipVertical = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: newSize.height)
context.concatenate(flipVertical)
有关详细信息,请查看 CGAffineTransform
的 documentation。
在 Swift 3 中,这些独立函数已被替换为 init
语法:
let flipVertical = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: newSize.height)
此代码无法在 swift 3:
中编译let flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, newSize.height)
context.concatenate(flipVertical)
我该如何转换它?
CGAffineTransformMake
变为 CGAffineTransform
并且初始化器现在需要标签。
let flipVertical = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: newSize.height)
context.concatenate(flipVertical)
有关详细信息,请查看 CGAffineTransform
的 documentation。
在 Swift 3 中,这些独立函数已被替换为 init
语法:
let flipVertical = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: newSize.height)