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
placeThe place to request data for.
optionsAn
AWFWeatherRequestOptionsinstance containing additional parameters to be used with the request (optional).completionBlockThe 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
AWFWeatherObjectinstances 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
nilfor 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
nameThe city name to search for.
stateThe two-letter abbreviation for the state or province to be used for the search (optional).
countryThe two-letter abbreviation for the country to be used for the search.
optionsAn
AWFWeatherRequestOptionsinstance containing additional parameters to be used with the request (optional).completionBlockThe 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
AWFWeatherObjectinstances 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
zipcodeThe zip code string to search for.
optionsAn
AWFWeatherRequestOptionsinstance containing additional parameters to be used with the request (optional).completionBlockThe 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
AWFWeatherObjectinstances 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
icaoThe airport ICAO to search for
optionsAn
AWFWeatherRequestOptionsinstance containing additional parameters to be used with the request (optional).completionBlockThe 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
AWFWeatherObjectinstances 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
startsWithThe string that the returned location(s) must begin with.
optionsAn
AWFWeatherRequestOptionsinstance containing additional parameters to be used with the request (optional).completionBlockThe 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
AWFWeatherObjectinstances 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
placeStringThe string to use for the search request
optionsAn
AWFWeatherRequestOptionsinstance containing additional parameters to be used with the request (optional).completionBlockThe 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
AWFWeatherObjectinstances returned by the request and the error that occurred during the request, if any.
View on GitHub
AWFPlaces Class Reference