LWKCAAnimation

public class LWKCAAnimation : LWKAction

An LWKAction wrapper for CAAnimation.

The interface for LWKCAAnimation work similarly to CAKeyframeAnimation. Values are either an array of key values stored in LWKCAAnimation.values or a bezier path stored in LWKCAAnimation.path. The property animated is stored in LWKCAAnimation.keyPath and corresponds to the animated keypaths of CALayer. Timing of the animation is determined by a single direction playthrough time LWKCAAnimation.duration, the LWKCAAnimation.repeatCount, LWKCAAnimation.autoreverses, normalized keyframe times LWKCAAnimation.keyTimes, and per keyframe easing functions LWKCAAnimation.timingFunctions.

Note that if keyTimes are defined the number of times needs to be the same as the number of values, or the number of segments in path + 1. Similarly, the number of timingFunctions must be equal to the number of keyTimes - 1.

  • The animated property of the target. Defined by CALayer.

    Declaration

    Swift

    public private(set) var keyPath: String? { get set }
  • The keyframe values. Mutually exclusive with path.

    Declaration

    Swift

    public var values: [Any]? { get set }
  • The key values defined as a bezier path. Mutually exclusive with values.

    Declaration

    Swift

    public var path: UIBezierPath? { get set }
  • Specifies length in time of a single direction playthrough.

    Declaration

    Swift

    public var duration: TimeInterval { get set }
  • Specifies the time within the animation corresponding to each keyframe value or cap/join of a path segment. Times are normalized between 0.0 and 1.0, where 0.0 denotes the beginning of the animation (t=0) and 1.0 denotes the end of the animation (t=duration).

    Declaration

    Swift

    public var keyTimes: [NSNumber]? { get set }
  • Specifies the easing function between two neighboring keyframe values. If specified, the length of timingFunctions must be the length of keyTimes - 1.

    Declaration

    Swift

    public var timingFunctions: [CAMediaTimingFunction]? { get set }
  • Specifies how to interpolate values along a path. Since bezier paths are parameterized, this determines how to weight that parameterization. Only effects animations using path. Animations using values are unaffected.

    Declaration

    Swift

    public var calculationMode: String { get set }
  • Specifies the number of play throughs of the animation will occur with a single call to run. Note that an autoreversing animation will reverse before the next playthrough begins.

    Declaration

    Swift

    public var repeatCount: Float { get set }
  • Specifies wether the animation to reverse back to the beginning after finishing a single playthrough.

    Declaration

    Swift

    public var autoreverses: Bool { get set }
  • Specifies wether the value should replace the current targets’ values or should add onto the current properties’ values and other animations.

    Declaration

    Swift

    public var isAdditive: Bool { get set }
  • Specifies how to display the animation before the first keyframe and after the last keyframe. Note that if the fill mode is forwards, the action will update the property value of the target when the animation completes.

    Declaration

    Swift

    public var fillMode: String { get set }
  • The targets of the animation determine which layers are animated. Note that targets are stored as weak references, and the animation will finish immediately if no targets are specified, or if all targets have been released when the animation is beginning.

    Declaration

    Swift

    public var targets: [UIView] { get set }
  • Declaration

    Swift

    public override func stop()