Tweener

public final class Tweener

A factory class to create, queue, and manage Tween animations.

Instance

  • The default assigned instance of Tweener.

    Declaration

    Swift

    public static var `default`: Tweener { get }
  • The main shared instance of Tweener.

    Declaration

    Swift

    public static let shared: Tweener
  • An instance of Tweener where all tweens are manually controlled and updated.

    Declaration

    Swift

    public static let manual: Tweener
  • Returns a reference to a custom Tweener instance by its identifier. The Tweener instance is created if it does not already exist.

    Declaration

    Swift

    public static func custom(_ identifier: String) -> Tweener

    Parameters

    identifier

    The identifier of the custom Tweener instance.

    Return Value

    The custom Tweener instance for the given identifier.

  • The identifier of this Tweener instance.

    Declaration

    Swift

    public let identifier: String
  • Assigns this instance of Tweener as the default instance.

    Declaration

    Swift

    public func setAsDefault()

Factory Creation

  • Creates a Tween that can be customized to animate properties on a target instance.

    Declaration

    Swift

    @discardableResult
    func animate<Target>(_ target: Target) -> TweenAnimator<Target> where Target : Tweenable

    Parameters

    target

    The Tweenable instance on which properties are animated.

    Return Value

    The Tween handle that manages and controls the animation.

Tracking

  • The number of tweens crrently being tracked.

    Declaration

    Swift

    var count: Int { get }
  • Checks if a tween is being tracked.

    Declaration

    Swift

    func isTracking(_ tween: Tween) -> Bool

    Parameters

    tween

    The Tweencontrol to be checked.

    Return Value

    true if the tween is contained in the list of tracked tweens.

  • Adds a tween to the list of tracked tweens.

    Declaration

    Swift

    func track(_ tween: Tween)

    Parameters

    tween

    The Tween control to be added.

  • Removes a tween from the list of tracked tweens.

    Declaration

    Swift

    func untrack(_ tween: Tween)

    Parameters

    tween

    The Tween control to be removed.

Global State Control

  • Invokes update on all currently tracked tweens.

    Declaration

    Swift

    func updateAll(by deltaTime: TimeInterval)

    Parameters

    deltaTime

    The amount of seconds passed since the last update.

  • Invokes start on all currently tracked tweens.

    Declaration

    Swift

    func startAll()
  • Invokes stop on all currently tracked tweens.

    Declaration

    Swift

    func stopAll()
  • Invokes stop on all currently tracked tweens.

    Declaration

    Swift

    func restartAll()
  • Invokes pause on all currently tracked tweens.

    Declaration

    Swift

    func pauseAll()
  • Invokes resume on all currently tracked tweens.

    Declaration

    Swift

    func resumeAll()
  • Invokes complete on all currently tracked tweens.

    Declaration

    Swift

    func completeAll()
  • Invokes kill on all currently tracked tweens.

    Declaration

    Swift

    func killAll()