2017-07-25 94 views
-2

無法使用此代碼不會在SWIFT 3編譯:'CGAffineTransformMake' 是在迅速3

let flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, newSize.height) 
context.concatenate(flipVertical) 

我將如何轉換這種過度?

+0

你看的'CGAffineTransform'的文檔? – rmaddy

+0

我沒有意識到它被重命名爲沒有'make'的名字。 –

+0

它未被重命名。 – rmaddy

回答

3

在斯威夫特3,這些自由豎立的功能已經被替換爲init語法:

let flipVertical = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: newSize.height) 
1

CGAffineTransformMake變成CGAffineTransform並且初始值設定器現在需要它的標籤。

let flipVertical = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: newSize.height) 
context.concatenate(flipVertical) 

欲瞭解更多信息,檢查出CGAffineTransformdocumentation