OfflineStructuredSearchSession
@available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.")
public final class OfflineStructuredSearchSession : StructuredSearchSession
StructuredSearchSession implementation that uses offline map data.
For more information, see StructuredSearchSession.
-
Fetch the current structured search state. This can be used to retrieve the initial state with candidates representing the top level of address, such as country.
Declaration
Swift
public func fetchStructuredSearchState(completion: @escaping (Result<StructuredSearchResponse, Error>) -> ())Parameters
completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
StructuredSearchResponsecontains the latest structured search state. -
Select a specific candidate in the current step. This will advance to the next step of the search path.
Declaration
Swift
public func selectCandidate( candidate: StructuredSearchCandidate, completion: @escaping (Result<StructuredSearchResponse, Error>) -> () )Parameters
candidateThe candidate to select in the current step.
completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
StructuredSearchResponsecontains the latest structured search state. -
Go back to previous selection from current step.
stepmust be a positive value. Ifstepis larger than the number of steps that have been taken, e.g.goBackis called withstepset to 9 at the third step, it goes back to the first step.Declaration
Swift
public func goBack(step: Int, completion: @escaping (Result<StructuredSearchResponse, Error>) -> ())Parameters
stepThe number of step to go back.
completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
StructuredSearchResponsecontains the latest structured search state. -
Set locale for the search session. The locale is used to find the best representation of strings in
StructuredSearchCandidate.Declaration
Swift
public func setLocale(locale: Locale, completion: @escaping (Result<StructuredSearchResponse, Error>) -> ())Parameters
localeThe preferred
Locale.completionThe completion closure is called after changing locale has been finished. If no errors occurred,
StructuredSearchResponsecontains the latest structured search state.
TomTom SDK for iOS (0.71.1)
OfflineStructuredSearchSession