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
SearchResultsView
using a viewModelDeclaration
Swift
public convenience init(withViewModel viewModel: SearchResultsViewModel)
Parameters
viewModel
SearchResultsViewModel
a viewModel that definesSearchResultsView
behavior and appearance
-
Configures
SearchResultsView
an instance using a viewModel. Use this method if theSearchResultsView
is initialized via IB.Declaration
Swift
public func setup(withViewModel viewModel: SearchResultsViewModel)
Parameters
viewModel
SearchResultsViewModel
a viewModel that definesSearchResultsView
behavior 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
height
Height 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
results
Array of SearchResult instances which will be displayed in the search results table view.
query
A query string that produced search results
-
Displays error text
Declaration
Swift
public func display(error: String)
Parameters
error
Description 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