IMeasureUnitConverter
@objc
public protocol IMeasureUnitConverter
Interface for MeasureUnit converters.
-
Checks if conversion from the specified source MeasureUnit to the specified target MeasureUnit is possible.
Declaration
Swift
func canConvertTo(_ sourceUnit: MeasureUnit, targetUnit: MeasureUnit) -> Bool
Parameters
sourceUnit
The MeasureUnit to convert from.
targetUnit
The MeasureUnit to convert to.
Return Value
true if the conversion is possible; otherwise false.
-
Checks if conversion of the specified value, bound to the specified axis and with the specified parameter and source MeasureUnit to the specified target MeasureUnit is possible.
Declaration
Swift
func convertTo(_ sourceUnit: MeasureUnit, targetUnit: MeasureUnit, value: Double, axis: Int, param: AnyObject?) -> Double
Parameters
sourceUnit
The MeasureUnit to convert from.
targetUnit
The MeasureUnit to convert to.
value
The value to convert.
axis
The index of the axis.
param
Paramter to use with the conversion.
Return Value
true if the conversion is possible; otherwise false.
-
Checks if conversion from the specified source MeasureUnit to the specified target MeasureUnit is possible.
Declaration
Swift
func canConvertFrom(_ targetUnit: MeasureUnit, sourceUnit: MeasureUnit) -> Bool
Parameters
sourceUnit
The MeasureUnit to convert from.
targetUnit
The MeasureUnit to convert to.
Return Value
true if the conversion is possible; otherwise false.
-
Checks if conversion from the specified value, bound to the specified axis and with the specified parameter and source MeasureUnit to the specified target MeasureUnit is possible.
Declaration
Swift
func convertFrom(_ targetUnit: MeasureUnit, sourceUnit: MeasureUnit, value: Double, axis: Int, param: AnyObject?) -> Double
Parameters
sourceUnit
The MeasureUnit to convert from.
targetUnit
The MeasureUnit to convert to.
value
The value to convert.
axis
The index of the axis.
param
Paramter to use with the conversion.
Return Value
true if the conversion is possible; otherwise false.