CRSUnits
Objective-C
@interface CRSUnits : NSObject
Swift
class CRSUnits : NSObject
Common Units
-
Get a unit from the units type
Declaration
Objective-C
+ (CRSUnit *)unitFromType:(enum CRSUnitsType)type;
Swift
class func unit(from type: CRSUnitsType) -> CRSUnit!
Parameters
type
units type
Return Value
unit
-
Get a units type from the unit name
Declaration
Objective-C
+ (enum CRSUnitsType)typeFromName:(NSString *)name;
Swift
class func type(fromName name: String!) -> CRSUnitsType
Parameters
name
unit name
Return Value
units type
-
Get a units type from the unit
Declaration
Objective-C
+ (enum CRSUnitsType)typeFromUnit:(CRSUnit *)unit;
Swift
class func type(from unit: CRSUnit!) -> CRSUnitsType
Parameters
unit
unit
Return Value
units type
-
Get a micrometre unit
Return Value
micrometre unit
-
Get a millimetre unit
Return Value
millimetre unit
-
Get a metre unit
Return Value
metre unit
-
Get a kilometre unit
Return Value
kilometre unit
-
Get a US survey foot unit
Return Value
US survey foot unit
-
Get a foot unit
Return Value
foot unit
-
Get a microradian unit
Return Value
microradian unit
-
Get a milliradian unit
Return Value
milliradian unit
-
Get a radian unit
Return Value
radian unit
-
Get an arc-second unit
Return Value
arc-second unit
-
Get an arc-minute unit
Return Value
arc-minute unit
-
Get a degree unit
Return Value
degree unit
-
Get a grad unit
Return Value
grad unit
-
Get a unity unit
Return Value
unity unit
-
Get a bin unit
Return Value
bin unit
-
Get a pascal unit
Return Value
pascal unit
-
Get a hectopascal unit
Return Value
hectopascal unit
-
Get a microsecond unit
Return Value
microsecond unit
-
Get a millisecond unit
Return Value
millisecond unit
-
Get a second unit
Return Value
second unit
-
Get a minute unit
Return Value
minute unit
-
Get a hour unit
Return Value
hour unit
-
Get a day unit
Return Value
day unit
-
Get a year unit
Return Value
year unit
-
Get a calendar second unit
Return Value
calendar second unit
-
Get a calendar month unit
Return Value
calendar month unit
-
Get the unit type from the name
Declaration
Objective-C
+ (enum CRSUnitType)unitTypeFromName:(NSString *)name;
Swift
class func unitType(fromName name: String!) -> CRSUnitType
Parameters
name
unit name
Return Value
unit type
-
Get the default unit for the unit type
Declaration
Objective-C
+ (CRSUnit *)defaultUnit:(enum CRSUnitType)type;
Swift
class func defaultUnit(_ type: CRSUnitType) -> CRSUnit!
Parameters
type
unit type
Return Value
default unit or null if no default
-
Determine if values can be converted between the two units
Declaration
Parameters
unit1
first unit
unit2
second unit
Return Value
true if can convert
-
Convert the value from a unit to a same typed unit, both with conversion factors
Declaration
Parameters
value
value to convert
from
unit to convert from
to
unit to convert to
Return Value
converted value