Generic Structure
Measurement A numeric quantity labeled with a unit of measure, with support for unit conversion and unit-aware calculations.
SDKs
iOS 10.0+ macOS 10.12+ tvOS 10.0+ watchOS 3.0+ Xcode 8.0+ Declaration struct Measurement <UnitType > where UnitType : Unit
Overview Measurements support a large set of operators, including +
, -
, *
, /
, and a full set of comparison operators.
Topics
Accessing the Value and Units
Converting to Other Units
Operating on a Measurement
Using Reference Types class NSMeasurement
An object representing a numeric quantity with a unit of measure that bridges to Measurement
; use NSMeasurement
when you need reference semantics or other Foundation-specific behavior.
See Also
First Steps class Unit
An abstract class representing a unit of measure.
class Dimension
An abstract class representing a dimensional unit of measure.