SearchResultsView
public class SearchResultsView : DesignableView
extension SearchResultsView: UITableViewDelegate
extension SearchResultsView: UITableViewDataSource
A view to display list of SearchResults.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Creates an instance of the
SearchResultsViewusing a viewModelDeclaration
Swift
public convenience init(withViewModel viewModel: SearchResultsViewModel)Parameters
viewModelSearchResultsViewModela viewModel that definesSearchResultsViewbehavior and appearance
-
Configures
SearchResultsViewan instance using a viewModel. Use this method if theSearchResultsViewis initialized via IB.Declaration
Swift
public func setup(withViewModel viewModel: SearchResultsViewModel)Parameters
viewModelSearchResultsViewModela viewModel that definesSearchResultsViewbehavior and appearance -
Clears data source: removes all results, resets table view content offset and the selected index path.
Declaration
Swift
public func clear() -
Sets the bottom insets of the table view content.
Declaration
Swift
public func setBottomInsets(_ height: CGFloat)Parameters
heightHeight of the bottom inset.
-
Updates the search results table view with a new list of SearchResult, table view offset, and information about the selected item.
Declaration
Swift
public func update(withResults results: [SearchResult], query: String?)Parameters
resultsArray of SearchResult instances which will be displayed in the search results table view.
queryA query string that produced search results
-
Displays error text
Declaration
Swift
public func display(error: String)Parameters
errorDescription of the error
-
Declaration
Swift
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) -
Declaration
Swift
public func tableView(_: UITableView, heightForRowAt _: IndexPath) -> CGFloat
-
Declaration
Swift
public func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int -
Declaration
Swift
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
TomTom SDK for iOS (0.53.1)
SearchResultsView