AWFPlaces
Objective-C
@interface AWFPlaces : AWFWeatherEndpoint
Swift
class AWFPlaces : AWFWeatherEndpoint
AWFPlaces
provides convenience methods for interacting with the
places
endpoint of the
Aeris API. In most cases, all requests will return instances of AWFPlace
that will be populated by the data returned by the API unless
otherwise indicated.
-
Requests a location’s complete profile data using a specified place.
Declaration
Objective-C
- (void)getPlace:(nonnull AWFPlace *)place options:(nullable AWFWeatherRequestOptions *)options completion:(nonnull AWFWeatherEndpointCompletionBlock)completionBlock;
Swift
func place(_ place: AWFPlace, options: AWFWeatherRequestOptions?) async -> AWFWeatherEndpointResult?
Parameters
place
The place to request data for.
options
An
AWFWeatherRequestOptions
instance containing additional parameters to be used with the request (optional).completionBlock
The block to be executed on the completion or failure of a request. This block has no return value and takes two arguments: an array of associated
AWFWeatherObject
instances returned by the request and the error that occurred during the request, if any. -
Searches for a location by city name, state and country. The state value is optional, use
nil
for locations that do not contain a state.Declaration
Objective-C
- (void)searchUsingName:(nonnull NSString *)name state:(nullable NSString *)state country:(nonnull NSString *)country options:(nullable AWFWeatherRequestOptions *)options completion: (nonnull AWFWeatherEndpointCompletionBlock)completionBlock;
Swift
func search(usingName name: String, state: String?, country: String, options: AWFWeatherRequestOptions?) async -> AWFWeatherEndpointResult?
Parameters
name
The city name to search for.
state
The two-letter abbreviation for the state or province to be used for the search (optional).
country
The two-letter abbreviation for the country to be used for the search.
options
An
AWFWeatherRequestOptions
instance containing additional parameters to be used with the request (optional).completionBlock
The block to be executed on the completion or failure of a request. This block has no return value and takes two arguments: an array of associated
AWFWeatherObject
instances returned by the request and the error that occurred during the request, if any. -
Searches for a location using a valid zip code string, which can be US (@“98109”) or Canadian (@“”).
Declaration
Objective-C
- (void)searchUsingZipcode:(nonnull NSString *)zipcode options:(nullable AWFWeatherRequestOptions *)options completion: (nonnull AWFWeatherEndpointCompletionBlock)completionBlock;
Swift
func search(usingZipcode zipcode: String, options: AWFWeatherRequestOptions?) async -> AWFWeatherEndpointResult?
Parameters
zipcode
The zip code string to search for.
options
An
AWFWeatherRequestOptions
instance containing additional parameters to be used with the request (optional).completionBlock
The block to be executed on the completion or failure of a request. This block has no return value and takes two arguments: an array of associated
AWFWeatherObject
instances returned by the request and the error that occurred during the request, if any. -
Searches for a location using an airport ICAO code.
Declaration
Objective-C
- (void)searchUsingICAO:(nonnull NSString *)icao options:(nullable AWFWeatherRequestOptions *)options completion: (nonnull AWFWeatherEndpointCompletionBlock)completionBlock;
Swift
func search(usingICAO icao: String, options: AWFWeatherRequestOptions?) async -> AWFWeatherEndpointResult?
Parameters
icao
The airport ICAO to search for
options
An
AWFWeatherRequestOptions
instance containing additional parameters to be used with the request (optional).completionBlock
The block to be executed on the completion or failure of a request. This block has no return value and takes two arguments: an array of associated
AWFWeatherObject
instances returned by the request and the error that occurred during the request, if any. -
Searches for a location by matching the beginning of a city’s name with the specified search string.
Declaration
Objective-C
- (void)searchUsingNameStartingWith:(nonnull NSString *)startsWith options:(nullable AWFWeatherRequestOptions *)options completion:(nonnull AWFWeatherEndpointCompletionBlock) completionBlock;
Swift
func searchUsingNameStarting(with startsWith: String, options: AWFWeatherRequestOptions?) async -> AWFWeatherEndpointResult?
Parameters
startsWith
The string that the returned location(s) must begin with.
options
An
AWFWeatherRequestOptions
instance containing additional parameters to be used with the request (optional).completionBlock
The block to be executed on the completion or failure of a request. This block has no return value and takes two arguments: an array of associated
AWFWeatherObject
instances returned by the request and the error that occurred during the request, if any. -
Searches for a location using a string, which can be a place name, zip code or latitude/longitude coordinate string.
Declaration
Objective-C
- (void)searchUsingString:(nonnull NSString *)placeString options:(nullable AWFWeatherRequestOptions *)options completion: (nonnull AWFWeatherEndpointCompletionBlock)completionBlock;
Swift
func search(using placeString: String, options: AWFWeatherRequestOptions?) async -> AWFWeatherEndpointResult?
Parameters
placeString
The string to use for the search request
options
An
AWFWeatherRequestOptions
instance containing additional parameters to be used with the request (optional).completionBlock
The block to be executed on the completion or failure of a request. This block has no return value and takes two arguments: an array of associated
AWFWeatherObject
instances returned by the request and the error that occurred during the request, if any.