CalStoreSearchRequest Class Reference

Inherits from CalStorePageRequest : NSObject
Declared in CalStoreSearchRequest.h

Overview

Requests a CalStorePage with results from a search from the CalendarStore, using a block-based API.

  • Create a request using one of the designated initializers, either for a free-text query, the top pages of a specific in-app purchase productIdentifier or the flattened list of calendars in an in-app purchase.
  • fetch the page using fetchPageWithCompletionHandler:

Results

Search Results are returned in the exact same format as a CalStorePage, so the same UI can be used for displaying regular pages as well as search results. The pageType property of a CalStorePage object can be used to differentiate between search results or regular pages: search result pages will have their pageType set to CalStorePageTypeSearchResults.

Creating Requests

Use one of the designated initializers only, using one of the base class initializers won’t work.

Getting Information

  searchQuery

The free-text query for this search, if this is a free-text search request. nil, otherwise.

@property (nonatomic, readonly, copy) NSString *searchQuery

Discussion

Only available when requestWithSearchQuery: or requestWithSearchQuery:locale: has been used.

Declared In

CalStoreSearchRequest.h

  searchProductIdentifier

The productIdentifier for this search, if this is an in-app purchase productIdentifier search request. nil, otherwise.

@property (nonatomic, readonly, copy) NSString *searchProductIdentifier

Declared In

CalStoreSearchRequest.h

Creating free-text Search Requests

+ requestWithSearchQuery:

Creates a request for a free-text search. Locale is taken from [CalStoreController sharedController].

+ (instancetype)requestWithSearchQuery:(NSString *)query

Parameters

query

the free-text query to search on. Should not be nil.

Return Value

CalStoreSearchRequest that will request a page with the result of the given free-text search, if valid, nil otherwise.

Discussion

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

Declared In

CalStoreSearchRequest.h

+ requestWithSearchQuery:locale:

Creates a request for a free-text search.

+ (instancetype)requestWithSearchQuery:(NSString *)query locale:(NSString *)locale

Parameters

query

the free-text query to search on. Should not be nil.

locale

locale to get the page in, ISO 639-1 code, or en_US (style). Can be nil, in which case the CalStoreController’s locale will be used.

Return Value

CalStoreSearchRequest that will request a page with the result of the given free-text search, if valid, nil otherwise.

Discussion

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

The locale of a page defines how it is localized (e.g. in English, Spanish, Dutch).

Declared In

CalStoreSearchRequest.h

Creating ProductIdentifier Search Requests

+ requestWithSearchByProductIdentifier:

Creates a request for the top items of the pages in in-app purchase search. Locale is taken from [CalStoreController sharedController].

+ (instancetype)requestWithSearchByProductIdentifier:(NSString *)productIdentifier

Parameters

productIdentifier

the in-app productIdentifier to search on. Should not be nil.

Return Value

CalStoreSearchRequest that will request a page with the result of the given in-app purchase search, if valid, nil otherwise.

Discussion

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

Items being part of the specific in-app purchase will be returned

Declared In

CalStoreSearchRequest.h

+ requestWithSearchByProductIdentifier:locale:

Creates a request for the top items of the pages in in-app purchase search

+ (instancetype)requestWithSearchByProductIdentifier:(NSString *)productIdentifier locale:(NSString *)locale

Parameters

productIdentifier

the in-app productIdentifier to search on. Should not be nil.

locale

locale to get the page in, ISO 639-1 code, or en_US (style). Can be nil, in which case the CalStoreController’s locale will be used.

Return Value

CalStoreSearchRequest that will request a page with the result of the given free-text search, if valid, nil otherwise.

Discussion

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

The locale of a page defines how it is localized (e.g. in English, Spanish, Dutch).

Items being part of the specific in-app purchase will be returned

Declared In

CalStoreSearchRequest.h

Creating Calendar Items Search Requests

+ requestWithSearchForCalendarsByProductIdentifier:

Creates a request for the calendars in an in-app purchase. Locale is taken from [CalStoreController sharedController].

+ (instancetype)requestWithSearchForCalendarsByProductIdentifier:(NSString *)productIdentifier

Parameters

productIdentifier

the in-app productIdentifier to search the calendars for. Should not be nil.

Return Value

CalStoreSearchRequest that will request a page with the calendars of the given in-app purchase search, if valid, nil otherwise.

Discussion

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

A flattenned page with items being the calendars of the specific in-app purchase will be returned

Declared In

CalStoreSearchRequest.h

+ requestWithSearchForCalendarsByProductIdentifier:locale:

Creates a request for the calendars in an in-app purchase. Locale is taken from [CalStoreController sharedController].

+ (instancetype)requestWithSearchForCalendarsByProductIdentifier:(NSString *)productIdentifier locale:(NSString *)locale

Parameters

productIdentifier

the in-app productIdentifier to search the calendars for. Should not be nil.

locale

locale to get the page in, ISO 639-1 code, or en_US (style). Can be nil, in which case the CalStoreController’s locale will be used.

Return Value

CalStoreSearchRequest that will request a page with the calendars of the given in-app purchase search, if valid, nil otherwise.

Discussion

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

The locale of a page defines how it is localized (e.g. in English, Spanish, Dutch).

A flattenned page with items being the calendars of the specific in-app purchase will be returned

Declared In

CalStoreSearchRequest.h