LazyBlog

宣告CGAffineTransform

1
private let transformIdentity = CGAffineTransform.identity

你要旋轉的物件

1
2
self.view.transform = self.transformIdentity.rotated(by: 180 * CGFloat(Double.pi))
self.view.transform = self.transformIdentity.rotated(by: -1 * CGFloat(Double.pi))

轉回來

1
2

self.view.transform = CGAffineTransform.identity

 評論