A unit of measure for length.
SDKs
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
Framework
- Foundation
Declaration
class UnitLength : Dimension
Overview
You typically use instances of NSUnit
to represent specific quantities of length using the NSMeasurement
class.
Length
Length is the dimensional extent of matter. The SI unit for length is the meter (m), which is defined in terms of the distance traveled by light in a vacuum.
The NSUnit
class defines its base unit as meters
, and provides the following units, which are initialized using Unit
converters with the specified coefficients:
Name | Method | Symbol | Coefficient |
---|---|---|---|
Megameters | Mm |
| |
Kilometers | kM |
| |
Hectometers | hm |
| |
Decameters | dam |
| |
Meters | m |
| |
Decimeters | dm |
| |
Centimeters | cm |
| |
Millimeters | mm |
| |
Micrometers | µm |
| |
Nanometers | nm |
| |
Picometers | pm |
| |
Inches | in |
| |
Feet | ft |
| |
Yards | yd |
| |
Miles | mi |
| |
Scandinavian Miles | smi |
| |
Light Years | ly |
| |
Nautical Miles | NM |
| |
Fathoms | ftm |
| |
Furlongs | fur |
| |
Astronomical Units | ua |
| |
Parsecs | pc |
|