UITableView

class UITableView : UIScrollView, NSCoding, UIDataSourceTranslating
  • SwifterSwift: Index path of last row in tableView.

    Declaration

    Swift

    public var indexPathForLastRow: IndexPath? { get }
  • SwifterSwift: Index of last section in tableView.

    Declaration

    Swift

    public var lastSection: Int { get }
  • SwifterSwift: Number of all rows in all sections of tableView.

    Declaration

    Swift

    public func numberOfRows() -> Int

    Return Value

    The count of all rows in the tableView.

  • SwifterSwift: IndexPath for last row in section.

    Declaration

    Swift

    public func indexPathForLastRow(inSection section: Int) -> IndexPath?

    Parameters

    section

    section to get last row in.

    Return Value

    optional last indexPath for last row in section (if applicable).

  • Reload data with a completion handler.

    Declaration

    Swift

    public func reloadData(_ completion: @escaping () -> Void)

    Parameters

    completion

    completion handler to run after reloadData finishes.

  • SwifterSwift: Remove TableFooterView.

    Declaration

    Swift

    public func removeTableFooterView()
  • SwifterSwift: Remove TableHeaderView.

    Declaration

    Swift

    public func removeTableHeaderView()
  • SwifterSwift: Scroll to bottom of TableView.

    Declaration

    Swift

    public func scrollToBottom(animated: Bool = true)

    Parameters

    animated

    set true to animate scroll (default is true).

  • SwifterSwift: Scroll to top of TableView.

    Declaration

    Swift

    public func scrollToTop(animated: Bool = true)

    Parameters

    animated

    set true to animate scroll (default is true).

  • SwifterSwift: Dequeue reusable UITableViewCell using class name

    Declaration

    Swift

    public func dequeueReusableCell<T>(withClass name: T.Type) -> T where T : UITableViewCell

    Parameters

    name

    UITableViewCell type

    Return Value

    UITableViewCell object with associated class name.

  • SwiferSwift: Dequeue reusable UITableViewCell using class name for indexPath

    Declaration

    Swift

    public func dequeueReusableCell<T>(withClass name: T.Type, for indexPath: IndexPath) -> T where T : UITableViewCell

    Parameters

    name

    UITableViewCell type.

    indexPath

    location of cell in tableView.

    Return Value

    UITableViewCell object with associated class name.

  • SwiferSwift: Dequeue reusable UITableViewHeaderFooterView using class name

    Declaration

    Swift

    public func dequeueReusableHeaderFooterView<T>(withClass name: T.Type) -> T where T : UITableViewHeaderFooterView

    Parameters

    name

    UITableViewHeaderFooterView type

    Return Value

    UITableViewHeaderFooterView object with associated class name.

  • SwifterSwift: Register UITableViewHeaderFooterView using class name

    Declaration

    Swift

    public func register<T>(nib: UINib?, withHeaderFooterViewClass name: T.Type) where T : UITableViewHeaderFooterView

    Parameters

    nib

    Nib file used to create the header or footer view.

    name

    UITableViewHeaderFooterView type.

  • SwifterSwift: Register UITableViewHeaderFooterView using class name

    Declaration

    Swift

    public func register<T>(headerFooterViewClassWith name: T.Type) where T : UITableViewHeaderFooterView

    Parameters

    name

    UITableViewHeaderFooterView type

  • SwifterSwift: Register UITableViewCell using class name

    Declaration

    Swift

    public func register<T>(cellWithClass name: T.Type) where T : UITableViewCell

    Parameters

    name

    UITableViewCell type

  • SwifterSwift: Register UITableViewCell using class name

    Declaration

    Swift

    public func register<T>(nib: UINib?, withCellClass name: T.Type) where T : UITableViewCell

    Parameters

    nib

    Nib file used to create the tableView cell.

    name

    UITableViewCell type.

  • SwifterSwift: Register UITableViewCell with .xib file using only its corresponding class. Assumes that the .xib filename and cell class has the same name.

    Declaration

    Swift

    public func register<T: UITableViewCell>(nibWithCellClass name: T.Type, at bundleClass: AnyClass? = nil)

    Parameters

    name

    UITableViewCell type.

    bundleClass

    Class in which the Bundle instance will be based on.

  • SwifterSwift: Check whether IndexPath is valid within the tableView

    Declaration

    Swift

    public func isValidIndexPath(_ indexPath: IndexPath) -> Bool

    Parameters

    indexPath

    An IndexPath to check

    Return Value

    Boolean value for valid or invalid IndexPath

  • SwifterSwift: Safely scroll to possibly invalid IndexPath

    Declaration

    Swift

    public func safeScrollToRow(at indexPath: IndexPath, at scrollPosition: UITableViewScrollPosition, animated: Bool)

    Parameters

    indexPath

    Target IndexPath to scroll to

    scrollPosition

    Scroll position

    animated

    Whether to animate or not