Returns a boolean value indicating whether the quantity is compatible with the provided unit.
- iOS 8.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
The target unit.
Yes if the quantity is compatible; otherwise,
Individual units are compatible if they measure the same feature. For example, all length units are compatible. All mass units are also compatible. However, a length unit is not compatible with a mass unit.
Complex units are compatible if the equation defining the units are compatible. Specifically, it must use the same operators, and the operands must be compatible. For example, meters per second and miles per hour are compatible. The left operands are both length units, the right operands are both time units and they all use a division operator.