Type Method

baseUnit()

Returns the base unit.

Declaration

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 init(coefficient:) initializer, passing 1 as the coefficient.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software