Moveable
@MainActor
public protocol Moveable : AnyObjectThis 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.
- 
                  REPEAT_INFINITEDefault implementationRepresents an infinite number of repeat motion cycles. Default ImplementationDeclarationSwift @MainActor static var REPEAT_INFINITE: UInt { get }
- 
                  
                  Stops a motion that is currently moving. (required) Remark When this method is called, a motion should only enter a stopped state if it currently moving.DeclarationSwift @MainActor func stop()
- 
                  
                  Starts a motion that is currently stopped. (required) Remark This method can be chained when initializing the object.Note When this method is called, a motion should only start moving if it is stopped.DeclarationSwift @discardableResult @MainActor func start() -> SelfReturn ValueA reference to the Moveable instance; used to method chain initialization methods when the Moveable instance is created. 
- 
                  
                  Pauses a motion that is currently moving. (required) Remark When this method is called, a motion should only enter a paused state if it is currently moving.DeclarationSwift @MainActor func pause()
- 
                  
                  Resumes a motion that is currently paused. (required) Remark When this method is called, a motion should only resume moving if it is currently paused.DeclarationSwift @MainActor func resume()
- 
                  
                  Resets a motion to its initial state. Custom classes implementing this method must reset all relevant properties, including totalProgress. (required)Remark This method is used byMoveablecollection classes to properly reset child motions for new movement cycles and when starting a motion again using thestartmethod.DeclarationSwift @MainActor func reset()
- 
                  
                  An enum which represents the current state of the motion operation. This state should be updated by the class implementing this protocol. DeclarationSwift @MainActor var motionState: MoveableState { get }
- 
                  
                  A Boolean which determines whether a motion operation, when it has moved to the ending value, should move from the ending value back to the starting value. Remark When set totrue, the motion plays in reverse after completing a forward motion. In this state, a motion cycle represents the combination of the forward and reverse motions. The default value should befalse.DeclarationSwift @MainActor var isReversing: Bool { get set }
- 
                  
                  A Boolean which determines whether the sequence should repeat. When set to true, the sequence repeats for the number of times specified by therepeatCyclesproperty. The default value isfalse.Note By design, setting this value totruewithout changing therepeatCyclesproperty from its default value (0) will cause the sequence to repeat infinitely.DeclarationSwift @MainActor var isRepeating: Bool { get set }
- 
                  
                  The number of complete sequence cycle operations to repeat. Remark This property is only used whenisRepeatingis set totrue. AssigningREPEAT_INFINITEto this property signals an infinite amount of motion cycle repetitions. The default value isREPEAT_INFINITE.DeclarationSwift @MainActor var repeatCycles: UInt { get set }
- 
                  
                  A value between 0.0 and 1.0, which represents the current overall progress of a motion. This value should include all reversing and repeat motion cycles. (read-only) DeclarationSwift @MainActor var totalProgress: Double { get }
- 
                  
                  Provides a delegate for sending MoveableStatusupdates from aMoveableobject. This property is used byMoveablecollection classes. Any customMoveableclasses must send status updates using this delegate.Warning This delegate is only used byMoveableobjects to communicate with otherMoveableobjects. End-users should not assign their own delegate to this property. If you need status updates for aMoveableobject, please use the provided callback closures.DeclarationSwift @MainActor var updateDelegate: MotionUpdateDelegate? { get set }
- 
                  
                  An internal property used to track Moveable objects globally. This value is set by MotionMachine and should not be altered. DeclarationSwift @MainActor var operationID: UInt { get }
- 
                  
                  This method is called to prompt a motion class to update its current movement values. DeclarationSwift @MainActor func update(withTimeInterval currentTime: TimeInterval)ParameterscurrentTimeA timestamp that can be used in easing calculations. 
- 
                  cleanupResources()Default implementationCalling this method on the conforming object should cleanup any resources to prepare for deallocation. Default ImplementationDeclarationSwift @MainActor func cleanupResources()
 View on GitHub
            View on GitHub
          