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.Clears data source: removes all results, resets table view content offset and the selected index path.
Declaration
Swift
public func clear()
Displays error text
Declaration
Swift
public func display(error: String)
Parameters
error
|
Description of the error |
Creates an instance of the SearchResultsView
using a viewModel
Declaration
Swift
public convenience init(withViewModel viewModel: SearchResultsViewModel)
Parameters
viewModel
|
|
Sets the bottom insets of the table view content.
Declaration
Swift
public func setBottomInsets(_ height: CGFloat)
Parameters
height
|
Height of the bottom inset. |
Configures SearchResultsView
an instance using a viewModel.
Use this method if the SearchResultsView
is initialized via IB.
Declaration
Swift
public func setup(withViewModel viewModel: SearchResultsViewModel)
Parameters
viewModel
|
|
Declaration
Swift
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
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
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 |