OnlineSearchFactory
public enum OnlineSearchFactory
Factory for accessing the implementations for the Search APIs. The Online Search API is a REST wrapper for a suite of web services that allow developers to use our scalable search engine.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Creates an instance conforming to the
Search
protocol.Note
if you need cancellation support usecreateCancellableOnlineSearch(apiKey:customAPIURL:geopoliticalView:)
instead.Declaration
Swift
public static func createOnlineSearch( apiKey: String, customAPIURL: URL? = nil, geopoliticalView: String? = nil ) -> Search
Parameters
apiKey
A valid TomTom API Key.
customAPIURL
Custom base URL for online APIs. Defaults to nil, and “https://api.tomtom.com/search/2” is the base URL. Can be used to change to another service that implements the same API.
geopoliticalView
The country code in the ISO 3166-1 alpha-2 format whose view on disputed areas should be used. If not provided or not supported, the international geopolitical view is used.
Return Value
an instance conforming to
Search
that provides access to Online Search functionality. -
Creates a search instance conforming to
CancellableSearch
.Declaration
Swift
public static func createCancellableOnlineSearch( apiKey: String, customAPIURL: URL? = nil, geopoliticalView: String? = nil ) -> CancellableSearch
Parameters
apiKey
A valid TomTom API Key.
customAPIURL
Custom base URL for online APIs. Defaults to nil and “https://api.tomtom.com/search/2” will be the base URL. Can be used to change to another service that implements the same API.
geopoliticalView
The country code in the ISO 3166-1 alpha-2 format whose view on disputed areas should be used. If not provided or not supported, the international geopolitical view is used.
Return Value
an instance conforming to
CancellableSearch
that provides access to Online Search functionality.