AnimationAttributes

public struct AnimationAttributes

UIView animation configuration values.

  • Whether the view supports user interaction during the animation.

    Declaration

    Swift

    public var allowUserInteraction: Bool
  • Declaration

    Swift

    public static let `default`: `Self`
  • Declaration

    Swift

    public init(
        duration: TimeInterval = 0.2,
        curve: UIView.AnimationCurve = .easeInOut,
        allowUserInteraction: Bool = true
    )
  • An animation that uses in the built-in UIView animation curves.

    Declaration

    Swift

    public static func curve(_ curve: UIView.AnimationCurve, duration: TimeInterval, allowUserInteraction: Bool = true) -> AnimationAttributes
  • An animation whose easing curve is determined by two control points.

    Declaration

    Swift

    public static func cubicBezier(
        controlPoint1: CGPoint,
        controlPoint2: CGPoint,
        duration: TimeInterval,
        allowsUserInteraction: Bool = true
    ) -> Self
  • A spring animation based on a damping ratio and initial velocity.

    Declaration

    Swift

    public static func dampenedSpring(
        dampingRatio: CGFloat = 1,
        initialVelocity: CGVector = .zero,
        duration: TimeInterval,
        allowUserInteraction: Bool = true
    ) -> Self
  • A spring animation based off the physics of an object with mass, a spring stiffness and damping, and initial velocity. The duration of the animation is determined by the physics of the spring.

    The default arguments for each parameter match those of the system spring animation used for transitions such as modal presentation, navigation controller push/pop, and keyboard animations. You can match that animation with .spring().

    Declaration

    Swift

    public static func spring(
        mass: CGFloat = 3,
        stiffness: CGFloat = 1000,
        damping: CGFloat = 500,
        initialVelocity: CGVector = .zero,
        allowsUserInteraction: Bool = true
    ) -> Self