AWFPlace
Objective-C
@interface AWFPlace : AWFGeographicObject
Swift
class AWFPlace : AWFGeographicObject
An AWFPlace object represents data returned by the places endpoint
of the Aeris Weather API.
-
The coordinate based on the defined latitude and longitude values.
Declaration
Objective-C
@property (nonatomic) CLLocationCoordinate2D coordinate;Swift
var coordinate: CLLocationCoordinate2D { get set } -
A
CLLocationinstance using the assigned coordinate for this object.Declaration
Objective-C
@property (nonatomic, strong, nullable) CLLocation *location;Swift
var location: CLLocation? { get set } -
Primary name of the location.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *name;Swift
var name: String? { get set } -
Abbreviated state or province for the location, if available.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *state;Swift
var state: String? { get set } -
Full state or province name for the location, if available.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *stateFull;Swift
var stateFull: String? { get set } -
Abbreviated country for the location.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *country;Swift
var country: String? { get set } -
Full country name for the location.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *countryFull;Swift
var countryFull: String? { get set } -
County name for the location.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *county;Swift
var county: String? { get set } -
Full place name formatted with the state and country when available.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *formattedNameFull;Swift
var formattedNameFull: String? { get } -
Zip code associated with the place, if defined.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *zipcode;Swift
var zipcode: String? { get set } -
The ICAO identifier which is only be defined when the place is associated with an airport.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *icao;Swift
var icao: String? { get set } -
Abbreviated geographical region for the location (US-based locations only).
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *region;Swift
var region: String? { get set } -
Geographical region for the location (US-based locations only).
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *regionFull;Swift
var regionFull: String? { get set } -
Abbreviated continent the location belongs to.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *continent;Swift
var continent: String? { get set } -
Full continent name the location belongs to.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *continentFull;Swift
var continentFull: String? { get set }
-
Local time zone object for the location.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSTimeZone *timeZone;Swift
var timeZone: TimeZone? { get set } -
Whether or not the location is current observing daylight savings time (DST).
Declaration
Objective-C
@property (nonatomic) BOOL isDst;Swift
var isDst: Bool { get set }
-
Elevation of the location in meters.
Declaration
Objective-C
@property (nonatomic) CGFloat elevationM;Swift
var elevationM: CGFloat { get set } -
Elevation of the location in feet.
Declaration
Objective-C
@property (nonatomic) CGFloat elevationFT;Swift
var elevationFT: CGFloat { get set } -
Population of the location.
Declaration
Objective-C
@property (nonatomic) CGFloat population;Swift
var population: CGFloat { get set } -
Array of public weather zones (US) or Canadian Location Codes (CLCs for Canada) that the location is within.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<NSString *> *weatherZones;Swift
var weatherZones: [String]? { get set } -
Array of public fire zones (US only) that the location is within.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<NSString *> *fireZones;Swift
var fireZones: [String]? { get set } -
Array of county FIPs codes (US only) that the location is within.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<NSString *> *fips;Swift
var fips: [String]? { get set } -
Array of county codes (US only) that the location is within.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<NSString *> *countyIds;Swift
var countyIds: [String]? { get set } -
Initializes and returns a newly allocated place object with the specified city, state, and/or country strings.
Declaration
Objective-C
- (nonnull instancetype)initWithCity:(nonnull NSString *)city state:(nullable NSString *)state country:(nonnull NSString *)country;Swift
init(city: String, state: String?, country: String)Return Value
An initialized place object.
-
Initializes and returns a newly allocated place object with the specified latitude and longitude values.
Declaration
Objective-C
- (nonnull instancetype)initWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;Swift
init(latitude: CGFloat, longitude: CGFloat)Return Value
An initialized place object.
-
Initializes and returns a newly allocated place object with the specified zip code string.
Only US and Canadian zip codes are currently supported.
Declaration
Objective-C
- (nonnull instancetype)initWithZipcode:(nonnull NSString *)zipcode;Swift
init(zipcode: String)Return Value
An initialized place object.
-
Generates the place string properly formatted for API requests based on this place configuration.
Declaration
Objective-C
- (nullable NSString *)stringForQuery;Swift
func stringForQuery() -> String? -
Generates the string required for direct-queries via the API based on this place configuration.
Declaration
Objective-C
- (nullable NSString *)stringForSearch;Swift
func stringForSearch() -> String? -
Returns whether the place is valid based on the resulting string used for API queries.
Declaration
Objective-C
- (BOOL)isValid;Swift
func isValid() -> Bool
-
Determines whether the receiver is equal to the specified place by comparing the
nameif present, otherwise thezipcodeif present, otherwise theicaoif present, otherwise thecoordinate.Declaration
Objective-C
- (BOOL)isEqualToPlace:(nonnull AWFPlace *)place;Swift
func isEqual(to place: AWFPlace) -> BoolParameters
placeThe place to compare
Return Value
YESif the receiver’sname/zipcode/icao/coodinateis equal to theplace, otherwiseNO -
Determines whether the receiver is equal to the specified place by comparing the place name.
Declaration
Objective-C
- (BOOL)isEqualToPlaceByComparingName:(nonnull AWFPlace *)place;Swift
func isEqualToPlace(byComparingName place: AWFPlace) -> BoolParameters
placeThe place to compare
Return Value
YESif the receiver’s name is equal to theplace, otherwiseNO
-
Initializes and returns a newly allocated place object with the specified city, state, and/or country strings.
Declaration
Objective-C
+ (nonnull instancetype)placeWithCity:(nonnull NSString *)city state:(nullable NSString *)state country:(nonnull NSString *)country;Return Value
An initialized place object.
-
Initializes and returns a newly allocated place object with the specified latitude and longitude values.
Declaration
Objective-C
+ (nonnull instancetype)placeWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;Return Value
An initialized place object.
-
Initializes and returns a newly allocated place object with the specified coordinate.
Declaration
Objective-C
+ (nonnull instancetype)placeWithCoordinate:(CLLocationCoordinate2D)coordinate;Swift
convenience init(coordinate: CLLocationCoordinate2D)Return Value
An initialized place object.
-
Initializes and returns a newly allocated place object with the specified zip code string.
Only US and Canadian zip codes are currently supported.
Declaration
Objective-C
+ (nonnull instancetype)placeWithZipcode:(nonnull NSString *)zipcode;Return Value
An initialized place object.
-
Initializes and returns a newly allocated place object with the specified place string. The string can be in the format of
city,state,country,city,country,lat,lon, orzipcode, etc.Declaration
Objective-C
+ (nonnull instancetype)placeFromString:(nonnull NSString *)string;Swift
convenience init(from string: String)Parameters
stringThe place string
Return Value
An initializes place object
-
Requests and returns a place object corresponding to the device’s current location. Location services must be enabled in order for the place to be returned.
Declaration
Objective-C
+ (void)getCurrentLocationWithCompletion: (nonnull AWFPlaceGeolocateCompletionBlock)completionBlock;Swift
class func currentLocation() async throws -> AWFPlaceParameters
completionBlockThe completion block to execute on the success or failure of the place request. This block has no return value and takes two arguments: the
AWFPlaceinstance associated with the device’s current location, if any, and the error that occurred during the request.
View on GitHub
AWFPlace Class Reference