GenericController
@MainActor
public class GenericController<T: GenericCell<ModelType>, ModelType>: UITableViewController,
UISearchResultsUpdating, UISearchControllerDelegate
Generic Controller
-
The item list to be displayed
Declaration
Swift
@MainActor public var items: [ModelType] { get set } -
The filtered items
Declaration
Swift
@MainActor public var filteredItems: [ModelType] -
Event handler to indicate if the item cell should be marked
Declaration
Swift
@MainActor public var shouldMarkCellAction: ((_ value: ModelType) -> Bool)? -
Delegate to customise the filter content.
Declaration
Swift
@MainActor public var filterContentForSearchTextAction: ((_ items: [ModelType], _ searchText: String) -> [ModelType])? { get set } -
The typealias for event handler to return the item selected
Declaration
Swift
public typealias SelectedHandler = (_ value: ModelType) -> Void -
Event handler to return the item selected
Declaration
Swift
@MainActor public var selectedHandler: SelectedHandler?
-
Called after the view controller has loaded its view hierarchy into memory.
Declaration
Swift
@MainActor override public func viewDidLoad() -
Notifies the view controller that its view is about to be added to a view hierarchy.
Declaration
Swift
@MainActor override public func viewWillAppear(_ animated: Bool) -
UIKit calls this method before changing the size of a presented view controller’s view
Declaration
Swift
@MainActor override public func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator)Parameters
sizeThe new size for the container’s view.
coordinatorThe transition coordinator object managing the size change.
-
Called when the search controller is automatically dismissed.
Declaration
Swift
@MainActor public func didDismissSearchController(_ searchController: UISearchController) -
Returns number of items
Declaration
Swift
@MainActor override public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int -
Displays the retrieved items
Declaration
Swift
@MainActor override public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
-
Returns headerview
Declaration
Swift
@MainActor override public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? -
Returns height of headerview
Declaration
Swift
@MainActor override public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat -
Declaration
Swift
@MainActor override public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat -
To select the items
Declaration
Swift
@MainActor override public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
-
To update search result
Declaration
Swift
@MainActor public func updateSearchResults(for searchController: UISearchController)
View on GitHub