AbstractSearchEngine
public class AbstractSearchEngine : FeedbackManagerDelegate
Common root for SearchEngine and CategorySearchEngine.
Should never be instantiated directly
-
Provide a specific API type
Declaration
Swift
public let apiType: ApiType -
Location provider for search results
proximityargumentDeclaration
Swift
public let locationProvider: LocationProvider? -
Manager to provide feedback events
Declaration
Swift
public let feedbackManager: FeedbackManager -
OfflineManagerwithdefaultTileStore.Declaration
Swift
public private(set) var offlineManager: SearchOfflineManager { get } -
Default options to use when
nilwas passed to thesearch(…: options:)callFull
SearchOptionsstructure would be used when nothing was passed to thesearchfunction In other case, each structure field would be tested. Eachnilfield insearch(options:)parameter would be replaced with the value fromdefaultSearchOptionsDeclaration
Swift
public var defaultSearchOptions: SearchOptions -
Initializer with safe-to-go defaults
Declaration
Swift
public convenience init( accessToken: String? = nil, locationProvider: LocationProvider? = DefaultLocationProvider(), defaultSearchOptions: SearchOptions = SearchOptions(), apiType: ApiType )Parameters
accessTokenMapbox Access Token to be used. Info.plist value for key
MBXAccessTokenwill be used fornilargument.locationProviderProvider configuration of LocationProvider that would grant location data by default.
defaultSearchOptionsDefault options to use when
nilwas passed to thesearch(…: options:)call/apiTypeChoose which API provider to use through this search engine.
-
Initializer with safe-to-go defaults
Declaration
Swift
@available(*, deprecated, message: "Specify ApiType explicitly instead.") public convenience init( accessToken: String? = nil, locationProvider: LocationProvider? = DefaultLocationProvider(), defaultSearchOptions: SearchOptions = SearchOptions() )Parameters
accessTokenMapbox Access Token to be used. Info.plist value for key
MBXAccessTokenwill be used fornilargument.locationProviderProvider configuration of LocationProvider that would grant location data by default.
defaultSearchOptionsDefault options to use when
nilwas passed to thesearch(…: options:)call. -
Initializer with safe-to-go defaults.
Declaration
Swift
public convenience init( accessToken: String? = nil, locationProvider: LocationProvider? = DefaultLocationProvider(), defaultSearchOptions: SearchOptions = SearchOptions(), apiType: ApiType, baseURL: URL )Parameters
accessTokenMapbox Access Token to be used. Info.plist value for key
MBXAccessTokenwill be used fornilargument.locationProviderProvider configuration of
LocationProviderthat would grant location data by default.defaultSearchOptionsDefault options to use when
nilwas passed to thesearch(…: options:)callapiTypechoose which API provider to use through this search engine.
baseURLA custom Mapbox API endpoint.
-
Initializer with safe-to-go defaults.
Declaration
Swift
@available(*, deprecated, message: "Specify ApiType explicitly instead.") public convenience init( accessToken: String? = nil, locationProvider: LocationProvider? = DefaultLocationProvider(), defaultSearchOptions: SearchOptions = SearchOptions(), baseURL: URL )Parameters
accessTokenMapbox Access Token to be used. Info.plist value for key
MBXAccessTokenwill be used fornilargument.locationProviderProvider configuration of
LocationProviderthat would grant location data by default.defaultSearchOptionsDefault options to use when
nilwas passed to thesearch(…: options:)call.baseURLA custom Mapbox API endpoint.
-
Register indexable data provider to provide custom data layer for SearchEngine
Throws
SearchError.failedToRegisterDataProvider(error, dataProvider)Declaration
Swift
public func register(dataProvider: IndexableDataProvider, priority: Int) throws -> RecordsProviderInteractorParameters
dataProviderIndexableDataProvider to register
prioritydata layer priority compared with other layers. Bigger is higher in result’s list.
Return Value
interactor for data operations (add, update, delete)
AbstractSearchEngine Class Reference