UITableView

class UITableView : UIScrollView, NSCoding, UIDataSourceTranslating

This extesion adds some useful functions to UITableView.

  • Retrive all the IndexPaths for the section.

    Declaration

    Swift

    public func indexPaths(section: Int) -> [IndexPath]

    Parameters

    section

    The section.

    Return Value

    Return an array with all the IndexPaths.

  • Retrive the next index path for the given row at section.

    Declaration

    Swift

    public func nextIndexPath(row: Int, forSection section: Int) -> IndexPath?

    Parameters

    row

    Row of the index path.

    section

    Section of the index path

    Return Value

    Returns the next index path.

  • Retrive the previous index path for the given row at section

    Declaration

    Swift

    public func previousIndexPath(row: Int, forSection section: Int) -> IndexPath?

    Parameters

    row

    Row of the index path.

    section

    Section of the index path.

    Return Value

    Returns the previous index path.

  • Create an UITableView and set some parameters

    Declaration

    Swift

    public convenience init(frame: CGRect, style: UITableView.Style, cellSeparatorStyle: UITableViewCell.SeparatorStyle, separatorInset: UIEdgeInsets, dataSource: UITableViewDataSource?, delegate: UITableViewDelegate?)

    Parameters

    frame

    TableView frame.

    style

    TableView style.

    cellSeparatorStyle

    Cell separator style.

    separatorInset

    Cell separator inset.

    dataSource

    TableView data source.

    delegate

    TableView delegate.