SimpleAnimation

public class SimpleAnimation : AnimationType

Concatenate different animations.

  • Default initializer for the SimpleAnimation class.

    Declaration

    Swift

    init(view: UIView)

    Parameters

    view

    the object’s view.

Transforms

  • 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) -> SimpleAnimation

    Parameters

    withDuration

    the 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) -> SimpleAnimation

    Parameters

    withDuration

    the duration of the transformation, expressed in seconds.

    translationX

    how much the view should move horizontally.

    translationY

    how 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) -> SimpleAnimation

    Parameters

    withDuration

    the duration of the transformation, expressed in seconds.

    rotationAngle

    how 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) -> SimpleAnimation

    Parameters

    withDuration

    the duration of the transformation, expressed in seconds.

    scaleX

    the new horizontal scale value to be applied to the view.

    scaleY

    the new vertical scale value to be applied to the view.

Actions

  • 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) -> SimpleAnimation

    Parameters

    withDuration

    the duration of the transformation, expressed in seconds.

    positionX

    the new horizontal position of the view, from the center.

    positionY

    the 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) -> SimpleAnimation

    Parameters

    withDuration

    the duration of the transformation, expressed in seconds.

    translateX

    how much the view should move horizontally, from the center.

    translateY

    how 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) -> SimpleAnimation

    Parameters

    withDuration

    the duration of the transformation, expressed in seconds.

    scaleX

    the new horizontal scale value to be applied to the object’s view.

    scaleY

    the 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) -> SimpleAnimation

    Parameters

    withDuration

    the duration of the transformation, expressed in seconds.

    alpha

    the 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) -> SimpleAnimation

    Parameters

    withDuration

    the duration of the transformation, expressed in seconds.

    moveTo

    the position the view should be moved to, in relation to it’s superview. See UIView.Position for more details.

Start

  • Starts the first animation on the object’s animation list.

    Declaration

    Swift

    public func startAnimation(completion: ((Bool) -> Void)? = .none)

    Parameters

    completion

    completion handler for when the animation has finished.