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.

Lifecycle

Public

  • 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

    withViewModel

    SearchResultsViewModel a viewModel that defines SearchResultsView 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

    withResults

    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