UITableView

public extension UITableView
  • Returns first section’s first row index path. If table view has zero sections returns (NSNotFound, NSNotFound). Invalid for scrolling. If table view has zero cells for the first section returns (0, NSNotFound) and this index path is valid for scrolling.

    Declaration

    Swift

    var firstRowIndexPath: IndexPath { get }
  • Returns last row index path or NSNotFound If table view has zero sections returns (NSNotFound, NSNotFound). Invalid for scrolling. If table view has zero cells for the last section returns (section, NSNotFound) and this index path is valid for scrolling.

    Declaration

    Swift

    var lastRowIndexPath: IndexPath { get }

Cell

  • Simplifies cell registration. Xib name must be the same as class name.

    Declaration

    Swift

    func registerNib(class: UITableViewCell.Type)
  • Simplifies cell dequeue.

    Declaration

    Swift

    func dequeue<T>(_ class: T.Type, for indexPath: IndexPath) -> T where T : UITableViewCell

    Parameters

    class

    Cell’s class.

    indexPath

    Cell’s index path.

  • Simplifies configurable cell dequeue.

    Declaration

    Swift

    typealias ConfigurableCell = UITableViewCell & Configurable
  • Undocumented

    Declaration

    Swift

    func dequeueConfigurable(class: ConfigurableCell.Type, for indexPath: IndexPath) -> ConfigurableCell

Header and Footer

  • Simplifies header/footer registration. Xib name must be the same as class name.

    Declaration

    Swift

    func registerNib(class: UITableViewHeaderFooterView.Type)
  • Simplifies header/footer dequeue.

    Declaration

    Swift

    func dequeue<T>(_ class: T.Type) -> T where T : UITableViewHeaderFooterView

    Parameters

    class

    Header or footer class.

Reload

Other

  • IndexPaths of visible cells

    Declaration

    Swift

    var visibleIndexPaths: [IndexPath] { get }