I want to setup a UIView animation, but instead of it taking a given amount of time, i want to control the percentage progress and let it automatically interpolate the values for me. Is that possible? Thanks
相关问题
- 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?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
I think i've got it. Immediately after the [UIView animate...] block, do the following on the root view:
And to set the point on the scale, do:
And to resume, something similar to the following:
This is all from here: https://developer.apple.com/library/ios/qa/qa1673/_index.html
If you're talking about a simple
UIView
animation linked to some gesture recognizer, you generally would not use animation during the gesture, but rather just update the view's properties as you receive updates as the continuous gesture (e.g.UIPanGestureRecognizer
) progresses, and then only apply a traditional animation when you let go and want complete the animation that the user initiated manually. You don't need to employ animation during the continuous gesture because those events come in quickly enough to render a smooth changing of the view's properties during the gesture. You only need traditional animation when the user lets go and you want to continue the animation smoothly to its logical conclusion.Alternatively, if you're talking about the new iOS 7 view controller transition (a slightly complicated, very specialized scenario), you (a) set up an animator object (one that conforms to
UIViewControllerAnimatedTransitioning
); (b) set up an interaction controller (on that conforms toUIViewControllerInteractiveTransitioning
, e.g. aUIPercentDrivenInteractiveTransition
); (c) your gesture would update the interaction controller'spercentComplete
; and (d) when the gesture is done, you'd simply call eithercancelInteractiveTransition
orfinishInteractiveTransition
based upon your own logic.