Instance Method

isNull()

Returns a Boolean value indicating whether the unit is null.

Declaration

func isNull() -> Bool

Return Value

true if the unit is null; otherwise, false.

Discussion

Null units occur only when you create compound units in which all the units cancel out. For example, if you tried to create a unit by dividing deciliters by liters (dL/L), you would end up with a null unit.

See Also

Working with Units

init(from: String)

Returns the unit instance described by the provided string.

var unitString: String

A string representation of the unit object.