An abstract class representing a unit of measure.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
NSDimension subclass is an abstract class that represents a dimensional unit, which can be converted into different units of the same type. The Foundation framework provides several concrete
NSDimension subclasses to represent the most common physical quantities, including mass, length, duration, and speed.
NSUnit is intended for subclassing. For dimensional units, you should use one of the Apple provided
NSDimension subclasses listed in Table 1, or create a custom subclass of
NSDimension. You can create a direct subclass of
NSUnit to represent a custom dimensionless unit, such as a count, score, or ratio.