UITableView
public extension UITableView
-
SwifterSwift: Index path of last row in tableView.
Declaration
Swift
var indexPathForLastRow: IndexPath? { get }
-
SwifterSwift: Index of last section in tableView.
Declaration
Swift
var lastSection: Int? { get }
-
SwifterSwift: Number of all rows in all sections of tableView.
Declaration
Swift
func numberOfRows() -> Int
Return Value
The count of all rows in the tableView.
-
SwifterSwift: IndexPath for last row in section.
Declaration
Swift
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).
-
SwifterSwift: Reload data with a completion handler.
Declaration
Swift
func reloadData(_ completion: @escaping () -> Void)
Parameters
completion
completion handler to run after reloadData finishes.
-
SwifterSwift: Remove TableFooterView.
Declaration
Swift
func removeTableFooterView()
-
SwifterSwift: Remove TableHeaderView.
Declaration
Swift
func removeTableHeaderView()
-
SwifterSwift: Scroll to bottom of TableView.
Declaration
Swift
func scrollToBottom(animated: Bool = true)
Parameters
animated
set true to animate scroll (default is true).
-
SwifterSwift: Scroll to top of TableView.
Declaration
Swift
func scrollToTop(animated: Bool = true)
Parameters
animated
set true to animate scroll (default is true).
-
SwifterSwift: Dequeue reusable UITableViewCell using class name
Declaration
Swift
func dequeueReusableCell<T>(withClass name: T.Type) -> T where T : UITableViewCell
Parameters
name
UITableViewCell type
Return Value
UITableViewCell object with associated class name.
-
SwifterSwift: Dequeue reusable UITableViewCell using class name for indexPath
Declaration
Swift
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.
-
SwifterSwift: Dequeue reusable UITableViewHeaderFooterView using class name
Declaration
Swift
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
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
func register<T>(headerFooterViewClassWith name: T.Type) where T : UITableViewHeaderFooterView
Parameters
name
UITableViewHeaderFooterView type
-
SwifterSwift: Register UITableViewCell using class name
Declaration
Swift
func register<T>(cellWithClass name: T.Type) where T : UITableViewCell
Parameters
name
UITableViewCell type
-
SwifterSwift: Register UITableViewCell using class name
Declaration
Swift
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
func register<T>(nibWithCellClass name: T.Type, at bundleClass: AnyClass? = nil) where T : UITableViewCell
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
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
func safeScrollToRow(at indexPath: IndexPath, at scrollPosition: UITableView.ScrollPosition, animated: Bool)
Parameters
indexPath
Target IndexPath to scroll to
scrollPosition
Scroll position
animated
Whether to animate or not