MixedAnimation

public class MixedAnimation : AnimationType

Concatenate different affine transformations in one single transformation.

  • Initializer for the MixedAnimation object.

    Declaration

    Swift

    init(view: UIView, duration: TimeInterval)

    Parameters

    duration

    the length of the animation, expressed in Seconds.

    view

    the view of the object.

Transforms

  • Adds an Identity transformation to the object’s transformations list.

    Declaration

    Swift

    public func transformIdentity() -> MixedAnimation
  • Moves the view by a specified amount, both horizontally and vertically.

    Declaration

    Swift

    public func transform(translationX: CGFloat, translationY: CGFloat) -> MixedAnimation

    Parameters

    translationX

    how much the view should move horizontally.

    translationY

    how much the view should move vertically.

  • Rotates the view by a specified amount.

    Declaration

    Swift

    public func transform(rotationAngle: CGFloat) -> MixedAnimation

    Parameters

    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.

    Declaration

    Swift

    public func transform(scaleX: CGFloat, scaleY: CGFloat) -> MixedAnimation

    Parameters

    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.

    Declaration

    Swift

    public func action(positionX: CGFloat, positionY: CGFloat) -> MixedAnimation

    Parameters

    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.

    Declaration

    Swift

    public func action(translateX: CGFloat, translateY: CGFloat) -> MixedAnimation

    Parameters

    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.

    Declaration

    Swift

    public func action(scaleX: CGFloat, scaleY: CGFloat) -> MixedAnimation

    Parameters

    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.

    Declaration

    Swift

    public func action(alpha: CGFloat) -> MixedAnimation

    Parameters

    alpha

    the alpha value to be applied to the object’s view.

  • Moves the view to the front or back of the superview.

    Declaration

    Swift

    public func action(moveTo position: UIView.Position) -> MixedAnimation

    Parameters

    moveTo

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

  • 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.