RealmSearchViewController

class RealmSearchViewController: UITableViewController,
                                 RealmSearchResultsDataSource,
                                 RealmSearchResultsDelegate
extension RealmSearchViewController: UISearchResultsUpdating

Base class for displaying searchable Realm object lists

Initialization

  • Default initializer

    Declaration

    Swift

    override init(nibName nibNameOrNil: String?,
                  bundle nibBundleOrNil: Bundle?)

    Parameters

    nibNameOrNil

    Nib name (optional)

    nibBundleOrNil

    Nib bundle (optional

  • Style initializer

    Declaration

    Swift

    override init(style: UITableView.Style)

    Parameters

    style

    Table style

RealmSearchResultsDataSource

  • Cell for Object

    Declaration

    Swift

    func searchViewController(_ controller: RealmSearchViewController,
                              cellForObject object: Object,
                              atIndexPath indexPath: IndexPath) -> UITableViewCell

    Parameters

    controller

    RealmSearchViewController

    object

    Realm Object

    indexPath

    Index path

    Return Value

    Cell

RealmSearchResultsDelegate

UITableViewDelegate

  • Will Select Row AT

    Declaration

    Swift

    override func tableView(_ tableView: UITableView,
                            willSelectRowAt indexPath: IndexPath) -> IndexPath?

    Parameters

    tableView

    UITableView

    indexPath

    Index path

    Return Value

    selectable path

  • Will Select Row AT

    Declaration

    Swift

    override func tableView(_ tableView: UITableView,
                            didSelectRowAt indexPath: IndexPath)

    Parameters

    tableView

    UITableView

    indexPath

    Index path

    Return Value

    selectable path

UITableViewControllerDataSource

  • Create table cell

    Declaration

    Swift

    override func tableView(_ tableView: UITableView,
                            cellForRowAt indexPath: IndexPath) -> UITableViewCell

    Parameters

    tableView

    UITableView

    indexPath

    Index Path

    Return Value

    UITableViewCell

UISearchResultsUpdating

  • Update search results

    Declaration

    Swift

    func updateSearchResults(for searchController: UISearchController)

    Parameters

    searchController

    UISearchController