Framework for expanding table view cells.
Table view infrastructure supporting expanding cells.
github "jozsef-vesza/ExpandingTableView"
use_frameworks!
pod 'ExpandingTableView'
Supporting expanding cells is really simple, just follow these two steps:
-
Your table view cell has to be a sublass of
ExpandingTableViewCell
. Additionally you must connect the following outlets:- mainContainerView: will contain your primary view, which is always visible.
- detailContainerView: the expanding part of your cell.
- detailViewHeightConstraint: the height constraint of the expanding part.
-
Your table view controller has to be a subclass of
ExpandingTableViewController
, which will handle the initial setup, and manage the expanding behavior by default.
You can dequeue cells the following way:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = super.tableView(tableView, cellForRowAtIndexPath: indexPath) as! ExampleCell
// customize cell here.
return cell
}
For a complete walkthrough, see the included example project.
For the details, see the original project.