CalStoreWeatherCitiesWithinRegionRequest Class Reference

Inherits from NSObject
Declared in CalStoreWeatherCitiesWithinRegionRequest.h

Overview

Requests cities for which weather calendars are available from the CalendarStore API.

Creating

+ requestWithRegion:

Creates a new request for cities withing a specific region

+ (instancetype)requestWithRegion:(MKCoordinateRegion)region

Parameters

region

the region to get cities for

Return Value

CalStoreWeatherCitiesWithinRegionRequest that will request cities within the given region

Discussion

Note: this only creates a request, use fetchCitiesWithCompletionHandler: to start requesting the page.

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h

+ requestWithNorthEastCoordinate:southWestCoordinate:

Creates a new request for cities withing a specific rectangle bounded by the northEast and southWest corner

+ (instancetype)requestWithNorthEastCoordinate:(CLLocationCoordinate2D)northEast southWestCoordinate:(CLLocationCoordinate2D)southWest

Parameters

northEast

the north-east corner of the region cities should be requested for

southWest

the south-west corner of the region cities should be requested for

Return Value

CalStoreWeatherCitiesWithinRegionRequest that will request cities within the given region

Discussion

Note: this only creates a request, use fetchCitiesWithCompletionHandler: to start requesting the page.

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h

Region

  region

The region for which this request will find cities

@property (nonatomic, readonly) MKCoordinateRegion region

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h

  northEastCoordinate

The northEast corner region for which this request will find cities

@property (nonatomic, readonly) CLLocationCoordinate2D northEastCoordinate

Discussion

makes up region together with the southWestCoordinate

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h

  southWestCoordinate

The southWest corner region for which this request will find cities

@property (nonatomic, readonly) CLLocationCoordinate2D southWestCoordinate

Discussion

makes up region together with the northEastCoordinate

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h

Authorization

  authorizationToken

The AuthorizationToken being used for this request. Defaults to [[CalStoreController sharedController]](../Classes/CalStoreController.html#//api/name/sharedController).authorizationToken.

@property (nonatomic, strong) NSString *authorizationToken

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h

Fetching Cities

  fetching

YES iff this object is busy fetching cities.

@property (nonatomic, getter=isFetching, readonly) BOOL fetching

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h

– cancel

Cancels an ongoing request

- (void)cancel

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h

– fetchCitiesWithCompletionHandler:

Fetches the requested cities asynchronously.

- (void)fetchCitiesWithCompletionHandler:(CalStoreWeatherCitiesWithinRegionRequestCompletionHandler)completionHandler

Parameters

completionHandler

block that will be invoked on the main queue if the fetch operation finishes. Check the error parameter of the block to see if the request succeeded. Cities will be returned as an array of CalStoreWeatherCity objects.

Declared In

CalStoreWeatherCitiesWithinRegionRequest.h