setAnimationDuration(_:)
Sets the duration (measured in seconds) of the animations in an animation block.
Declaration
class func setAnimationDuration(_ duration: TimeInterval)Parameters
- duration:
The period over which the animation occurs, measured in seconds.
Discussion
If you specify your animations using begin/commit set of methods, you use this method to specify the duration of the animations. This method does nothing if called from outside of an animation block. It must be called between calls to the beginAnimations(_:context:) and commitAnimations() methods. And you must call this method prior to changing the animatable properties of your views. The default value is 0.2 seconds.
Use of this method is discouraged in iOS 4.0 and later. Instead, you should use any of the block-based animation methods to specify your animations and their duration.
See Also
Deprecated methods
beginAnimations(_:context:)commitAnimations()setAnimationStart(_:)setAnimationsEnabled(_:)setAnimationDelegate(_:)setAnimationWillStart(_:)setAnimationDidStop(_:)setAnimationDelay(_:)setAnimationCurve(_:)setAnimationRepeatCount(_:)setAnimationRepeatAutoreverses(_:)setAnimationBeginsFromCurrentState(_:)setAnimationTransition(_:for:cache:)areAnimationsEnabledforBaselineLayout()