ConstraintUnit

struct ConstraintUnit
extension ConstraintUnit : Equatable, Hashable, Sendable

Represents a unit of measurement which consists of a base unit and a scale.

For example, if a field has the unit centi-celsius, the base unit would be Celsius and the multiplier would be 0.01.

  • The base unit.

    Declaration

    Swift

    let baseUnit: BaseUnit
  • The multiplier used to derive a value expressed using baseUnit.

    Declaration

    Swift

    let scale: Double
  • Initializes a ConstraintUnit with a base unit and a scale.

    Declaration

    Swift

    init(baseUnit: BaseUnit, scale: Double)

    Parameters

    baseUnit

    The base unit.

    scale

    The multiplier used to derive a value expressed using baseUnit.