Other Functions
The following functions are available globally.
-
Returns the unit string for the specified
AWFMeasurementand Metric designation.Declaration
Objective-C
AWFUnit _Nonnull AWFUnitForMeasurement(AWFMeasurement type, BOOL metric)Swift
func AWFUnitForMeasurement(_ type: AWFMeasurement, _ metric: Bool) -> AWFUnit -
Returns the unit of measurement for the specified data type.
Declaration
Objective-C
NSString *_Nullable AWFUnitForWeatherDataType(AWFWeatherDataType type, BOOL metric)Swift
func AWFUnitForWeatherDataType(_ type: AWFWeatherDataType, _ metric: Bool) -> String?Parameters
typeThe data type to return the unit for
metricWhether the metric unit should be returned
-
Returns whether or not the specified
unitcorresponds to a Metric value.Declaration
Objective-C
BOOL AWFUnitIsMetric(AWFUnit _Nonnull unit)Swift
func AWFUnitIsMetric(_ unit: AWFUnit) -> BoolParameters
unitThe
AWFUnitvalueReturn Value
YESif the unit is for Metric values, otherwiseNO. -
Converts a value from one unit to another. The units must belong to the same measurement type (e.g., temperature, speed, distance, etc).
Declaration
Objective-C
CGFloat AWFConvert(CGFloat value, AWFUnit _Nonnull from, AWFUnit _Nonnull to)Swift
func AWFConvert(_ value: CGFloat, _ from: AWFUnit, _ to: AWFUnit) -> CGFloatParameters
valueThe value to convert
fromThe current units the value is provided in
toThe units to convert the specified value to
Return Value
The converted value
-
Tests if an object is empty.
Declaration
Objective-C
BOOL AWFIsEmpty(id _Nonnull object)Swift
func AWFIsEmpty(_ object: Any) -> Bool -
Returns whether the specified
objectis a valid place string in the format city, state, city, country or city, state, country (e.g. seattle,wa or paris,france).Declaration
Objective-C
BOOL AWFIsValidPlaceString(id _Nonnull object)Swift
func AWFIsValidPlaceString(_ object: Any) -> BoolParameters
objectThe object to validate.
Return Value
YESif the object is a valid place string, otherwiseNO. -
Returns whether the specified
objectis a valid zip code or postal code string (e.g. 55415 or V5K 1L5).Declaration
Objective-C
BOOL AWFIsValidZipcodeString(id _Nonnull object)Swift
func AWFIsValidZipcodeString(_ object: Any) -> BoolParameters
objectThe object to validate.
Return Value
YESif the object is a valid zip code/postal code string, otherwiseNO. -
Returns whether the specified
objectis a valid coordinate string in the format latitude, longitude (e.g. 30.26715, -97.74306).Declaration
Objective-C
BOOL AWFIsValidCoordinateString(id _Nonnull object)Swift
func AWFIsValidCoordinateString(_ object: Any) -> BoolParameters
objectThe object to validate.
Return Value
YESif the object is a valid coordinate string, otherwiseNO. -
Returns whether the specified
coordinateis empty, meaning both its latitude and longitude values are defined as0.0.Declaration
Objective-C
BOOL AWFCLLocationCoordinate2DIsEmpty(CLLocationCoordinate2D coordinate)Swift
func AWFCLLocationCoordinate2DIsEmpty(_ coordinate: CLLocationCoordinate2D) -> BoolParameters
coordinateThe coordinate to validate.
Return Value
YESif the coordinate has its latitude and longitude values defined as0.0, otherwiseNO.
View on GitHub
Other Functions Reference