<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Dimension/baseUnit()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDimension(cm)baseUnit"
  },
  "title" : "baseUnit()"
}
-->

# baseUnit()

Returns the base unit.

```
class func baseUnit() -> Self
```

## Return Value

An `NSDimension` subclass object from which all other units provided by the subclass are defined.

## Discussion

The default implementation returns `nil` to indicate that the `NSDimension` class should not be used directly.

When implementing a subclass, you should return a unit converter that returns the inputted value for both the `baseUnitValueFromValue:` and `valueFromBaseUnitValue:` methods. You can create a unit converter for a base unit using the [`UnitConverterLinear`](/documentation/Foundation/UnitConverterLinear) [`init(coefficient:)`](/documentation/Foundation/UnitConverterLinear/init(coefficient:)) initializer, passing `1` as the coefficient.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)