How can I animate the movement of a label or image? I would just like to make a slow transition from one location on the screen to another (nothing fancy).
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
You're looking for the
-beginAnimations:context:
and-commitAnimations
methods on UIView.In a nutshell, you do something like:
Here is an example with a
UILabel
- the animation slides the label from the left in 0.3 seconds.For ios4 and later you should not use
beginAnimations:context
andcommitAnimations
, as these are discouraged in the documentation.Instead you should use one of the block-based methods.
The above example would then look like this: