How to programmatically rotate the view by 180 degrees in my iPhone App?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
As ’CGAffineTransformRotate’ uses radians as its unit of measure, and 180 degrees is the same as PI, instead of the math provided in other answers you can simply do:
Swift 3:
If you plan on doing a lot of transforms, it's probably best to read up on radians, so you understand what is going on.
Should be possible by using CGAffineTransform
Quote from this question, this should do the trick:
Simple solution:
In Swift 3 :
Latest Swift 3 syntax:
Same outcome as @Manny's answer using a different function.