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
TempoProviding
protocol that provides an update “beat” while a motion operation occurs.Note
By default, this class will assign an instance ofDisplayLinkTempo
to 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 aCADisplayLink
object for updates. For watchOS and non-Apple platforms,TimerTempo
is chosen asCADisplayLink
is not available.Declaration
Swift
@MainActor var tempo: TempoProviding? { get set }
-
Tells a
TempoDriven
object to cease listening to updates from itsTempoProviding
object.Declaration
Swift
@MainActor func stopTempoUpdates()