TimerTempo
@MainActor
public class TimerTempo : Tempo
TimerTempo uses an internal NSTimer
object to send out tempo updates.
-
This
NSTimer
object is used to provide tempo updates.Warning
Do not call theinvalidate
method on this object, as its state is handled by TimerTempo directly.Declaration
Swift
@MainActor public var timer: Timer?
-
Initializes a new
TimerTempo
object and starts the internal timer.Declaration
Swift
@MainActor public convenience init(withInterval interval: TimeInterval? = (1.0/60.0))
Parameters
interval
The rate, in number of seconds, between updates of the timer. The default value is 60 updates/second.
Return Value
A new
TimerTempo
object. -
Calling this method invalides the
Timer
object to prepare for deallocation.Declaration
Swift
@MainActor public override func cleanupResources()