AWFPlaces
@interface 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 getPlace(_ place: AWFPlace, options: AWFWeatherRequestOptions?, completion completionBlock: @escaping AWFWeatherEndpointCompletionBlock)
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 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?, completion completionBlock: @escaping AWFWeatherEndpointCompletionBlock)
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 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?, completion completionBlock: @escaping AWFWeatherEndpointCompletionBlock)
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 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?, completion completionBlock: @escaping AWFWeatherEndpointCompletionBlock)
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?, completion completionBlock: @escaping AWFWeatherEndpointCompletionBlock)
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.