Protocols

The following protocols are available globally.

  • This protocol declares methods and properties that must be adopted by custom motion classes in order to participate in the MotionMachine ecosystem. All standard MotionMachine motion classes conform to this protocol.

    See more

    Declaration

    Swift

    @MainActor
    public protocol Moveable : AnyObject

PropertyCollection protocol

  • This protocol represents an object that holds a collection of PropertyData objects, such as a Motion class.

    See more

    Declaration

    Swift

    @MainActor
    public protocol PropertyCollection : AnyObject
  • This protocol defines methods and properties that must be adopted for any value assistant.

    See more

    Declaration

    Swift

    @MainActor
    public protocol ValueAssistant
  • This protocol represents physics solving systems that calculate the positions of values over time, and is used in PhysicsMotion and PathPhysicsMotion to update property values.

    See more

    Declaration

    Swift

    public protocol PhysicsSolving
  • Provides delegate updates when property values change.

    See more

    Declaration

    Swift

    @MainActor
    public protocol PropertyDataDelegate : AnyObject
  • This protocol declares methods and properties that must be adopted by custom Moveable classes who participate in additive animations with other MotionMachine classes.

    See more

    Declaration

    Swift

    @MainActor
    public protocol Additive : PropertyCollection
  • This delegate protocol defines a status update method in order for Moveable objects to communicate with one another. MotionMachine collection classes use this protocol method to keep track of child motion status changes. Any custom Moveable classes must send MoveableStatus status updates using this protocol.

    See more

    Declaration

    Swift

    @MainActor
    public protocol MotionUpdateDelegate : AnyObject
  • This protocol declares methods and properties that must be adopted by custom classes which control other Moveable classes in order to participate in the MotionMachine ecosystem. All standard MotionMachine collection classes (MotionSequence, MotionGroup) conform to this protocol.

    See more

    Declaration

    Swift

    @MainActor
    public protocol MoveableCollection
  • This protocol defines methods that are called on delegate objects which listen for update beats from a Tempo object.

    See more

    Declaration

    Swift

    @MainActor
    public protocol TempoDelegate : AnyObject
  • This protocol represents objects that subscribe to a Tempo object’s beats. Every movement of a value occurs because time has changed. These beats drive the motion, sending timestamps by which delta values can be calculated. All standard MotionMachine motion classes conform to this protocol.

    Important

    While you aren’t required to implement this protocol in order to update your own custom Moveable classes, it is the preferred way to interact with the MotionMachine ecosystem unless your requirements prevent using Tempo objects for updating your value interpolations.
    See more

    Declaration

    Swift

    @MainActor
    public protocol TempoDriven : TempoDelegate