init
TypeScriptstatic init(object: CMClock): CMClockSwift declarationinit(referencing object: CMClock)class · iOS 6.0+ · SDK 27.1
class CMClockstatic init(object: CMClock): CMClockSwift declarationinit(referencing object: CMClock)anchorTime(): { "anchorTime": CMTime; "referenceTime": CMTime }Swift declarationfunc anchorTime() throws -> (anchorTime: CMTime, referenceTime: CMTime)Retrieves the current time from a clock and also the matching time from the clock's reference clock. To make practical use of this, you may need to know what the clock's reference clock is.
invalidate(): voidSwift declarationfunc invalidate()Makes the clock stop functioning. After invalidation, the clock will return errors from all APIs. This should only be called by the "owner" of the clock, who knows (for example) that some piece of hardware has gone away, and the clock will no longer work (and might even crash).
mightDrift(otherClock: CMClock): booleanSwift declarationfunc mightDrift(relativeTo otherClock: CMClock) -> BoolIndicates whether it is possible for the clock to drift relative to the `otherClock`.
static get hostTimeClock(): CMClockSwift declarationstatic var hostTimeClock: CMClock { get }The singleton clock logically identified with host time. On Mac OS X, the host time clock uses `mach_absolute_time` but returns a value with a large integer timescale (eg, nanoseconds).
static convertHostTimeToSystemUnits(hostTime: CMTime): numberSwift declarationstatic func convertHostTimeToSystemUnits(_ hostTime: CMTime) -> UInt64Converts a host time from `CMTime` to the host time's native units. This function performs a scale conversion, not a clock conversion. It can be more accurate than `CMTimeConvertScale` because the system units may have a non-integer timescale. On Mac OS X, this function converts to the units of `mach_absolute_time`.
static convertSystemUnitsToHostTime(systemUnits: number): CMTimeSwift declarationstatic func convertSystemUnitsToHostTime(_ systemUnits: UInt64) -> CMTimeConverts a host time from native units to `CMTime`. The returned value will have a large integer timescale (eg, nanoseconds). This function handles situations where host time's native units use a non-integer timescale. On Mac OS X, this function converts from the units of `mach_absolute_time`.
nextPreferredStartTimePattern(): (CMClock_StartTimePattern) | nullSwift declarationfunc nextPreferredStartTimePattern() -> CMClock.StartTimePattern?Returns the pattern of preferred start times, such as for synchronization with an external genlock signal. When a genlock signal is present and disciplined, this function returns a matched time pair in the near future and the delta between successive times.
get implementsPreferredStartTimePattern(): booleanSwift declarationvar implementsPreferredStartTimePattern: Bool { get }Indicates whether this clock implements preferred start time patterns.
get time(): CMTimeSwift declarationvar time: CMTime { get }The current time.
static get typeID(): numberSwift declarationstatic var typeID: CFTypeID { get }The `CFTypeID` corresponding to `CMClock`.
4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
CMClock.rate(relativeTo:)
This declaration needs Swift generic type arguments. (no canonical witness for T)
CMClock.rateAndAnchorTime(relativeTo:)
This declaration needs Swift generic type arguments. (no canonical witness for T)
CMClock.convertTime(_:to:)
This declaration needs Swift generic type arguments. (no canonical witness for T)
CMClock.mightDrift(relativeTo:)
This declaration needs Swift generic type arguments. (no canonical witness for T)