TempoDriven
@MainActor
public protocol TempoDriven : TempoDelegate
This protocol represents objects that subscribe to a TempoProviding object’s update 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 customMoveable classes, it is the preferred way to interact with the MotionMachine ecosystem unless your requirements prevent using TempoProviding objects for updating your value interpolations.
-
An object conforming to the
TempoProvidingprotocol that provides an update “beat” while a motion operation occurs.Note
By default, this class will assign an instance ofDisplayLinkTempoto this property, which automatically chooses the best tempo class for the system platform. For iOS, visionOS, and tvOS the class chosen isCATempo, but for macOS it isMacDisplayLinkTempo. Both classes internally use aCADisplayLinkobject for updates. For watchOS and non-Apple platforms,TimerTempois chosen asCADisplayLinkis not available.Declaration
Swift
@MainActor var tempo: TempoProviding? { get set } -
Tells a
TempoDrivenobject to cease listening to updates from itsTempoProvidingobject.Declaration
Swift
@MainActor func stopTempoUpdates()
View on GitHub