SimpleAnimation
public class SimpleAnimation : AnimationType
Concatenate different animations.
-
Default initializer for the SimpleAnimation class.
Declaration
Swift
init(view: UIView)Parameters
viewthe object’s view.
-
Adds an Identity transformation to the object’s animations list and performs it in the specified amount of time.
Declaration
Swift
public func transformIdentity(withDuration duration: TimeInterval) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
-
Moves the view by a specified amount in a given time, both horizontally and vertically.
Declaration
Swift
public func transform(withDuration duration: TimeInterval, translationX: CGFloat, translationY: CGFloat) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
translationXhow much the view should move horizontally.
translationYhow much the view should move vertically.
-
Rotates the view by a specified amount in a given time.
Declaration
Swift
public func transform(withDuration duration: TimeInterval, rotationAngle: CGFloat) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
rotationAnglehow much the view should rotate, in degrees.
-
Changes the view’s width and height values by the specified horizontal and vertical scale values in a given time.
Declaration
Swift
public func transform(withDuration duration: TimeInterval, scaleX: CGFloat, scaleY: CGFloat) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
scaleXthe new horizontal scale value to be applied to the view.
scaleYthe new vertical scale value to be applied to the view.
-
Moves the position of the view by changing the center point of the view in a given time.
Declaration
Swift
public func action(withDuration duration: TimeInterval, positionX: CGFloat, positionY: CGFloat) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
positionXthe new horizontal position of the view, from the center.
positionYthe new vertical position of the view, from the center.
-
Moves the position of the view a specified amount, from the center of the view, in a given time.
Declaration
Swift
public func action(withDuration duration: TimeInterval, translateX: CGFloat, translateY: CGFloat) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
translateXhow much the view should move horizontally, from the center.
translateYhow much the view should move vertically, from the center.
-
Multiplies the object view’s frame width and height values by the specified horizontal and vertical scale values in a given time.
Declaration
Swift
public func action(withDuration duration: TimeInterval, scaleX: CGFloat, scaleY: CGFloat) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
scaleXthe new horizontal scale value to be applied to the object’s view.
scaleYthe new vertical scale value to be applied to the object’s view.
-
Applies an alpha value to the object’s view in a given time.
Declaration
Swift
public func action(withDuration duration: TimeInterval, alpha: CGFloat) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
alphathe alpha value to be applied to the object’s view.
-
Moves the view to the front or back of the superview in a given time.
Declaration
Swift
public func action(withDuration duration: TimeInterval, moveTo position: UIView.Position) -> SimpleAnimationParameters
withDurationthe duration of the transformation, expressed in seconds.
moveTothe position the view should be moved to, in relation to it’s superview. See
UIView.Positionfor more details.
-
Starts the first animation on the object’s animation list.
Declaration
Swift
public func startAnimation(completion: ((Bool) -> Void)? = .none)Parameters
completioncompletion handler for when the animation has finished.
SimpleAnimation Class Reference