Measurement

@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
struct Measurement<UnitType> : ReferenceConvertible, Comparable, Equatable where UnitType : Unit
  • The hours component of the measurement.

    Declaration

    Swift

    public var hours: Int { get }
  • The minutes component of the measurement.

    Declaration

    Swift

    public var minutes: Int { get }
  • The seconds component of the measurement.

    Declaration

    Swift

    public var seconds: Int { get }
  • The duration represented by this measurement.

    Declaration

    Swift

    public var timeInterval: TimeInterval { get }
  • The value of the measurement in the given units.

    Declaration

    Swift

    public func valueConverted(to unit: UnitDuration) -> Double

    Parameters

    unit

    The unit of duration.

    Return Value

    The value of the converted measurement.

  • The whole number value of the component part represented by the given unit of duration.

    Declaration

    Swift

    public func component(of unit: UnitDuration) -> Int

    Parameters

    unit

    The unit for which return the component.

    Return Value

    The whole number value for the given component.