TimeMonitor
public protocol TimeMonitor
Undocumented
-
Adds a periodic observer.
Declaration
Swift
func addPeriodicObserver(interval: TimeInterval, observeOn dispatchQueue: DispatchQueue?, using eventHandler: @escaping (TimeInterval) -> Void) -> UUIDParameters
intervalThe interval to invoke the handler.
dispatchQueueThe dispatch queue to observe the events on.
eventHandlerThe handler to invoke on when the time comes.
Return Value
A uuid token to represent the observation, used to later remove a single observation.
-
Adds a boundary observer.
Declaration
Swift
func addBoundaryObserver(times: [TimeInterval], observeOn dispatchQueue: DispatchQueue?, using eventHandler: @escaping (TimeInterval, Double) -> Void) -> UUIDParameters
timesThe times to use the event handler.
dispatchQueueThe dispatch queue to observe the events on.
eventHandlerThe handler to invoke on when the time comes.
Return Value
A uuid token to represent the observation, used to later remove a single observation.
-
removes a single periodic observer using the uuid provided when added the observation.
Declaration
Swift
func removePeriodicObserver(_ token: UUID) -
removes a single boundary observer using the uuid provided when added the observation.
Declaration
Swift
func removeBoundaryObserver(_ token: UUID) -
Removes all the periodic observers.
Declaration
Swift
func removePeriodicObservers() -
Removes all the boundary observers.
Declaration
Swift
func removeBoundaryObservers()
TimeMonitor Protocol Reference