TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Mar 2016 |
SPMSupports SPM | ✗ |
Maintained by Artur Jaworski.
Automatically takes care of custom UITableViewCell dynamic height. Written in Swift.
TableViewAutolayoutManager is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TableViewAutolayoutManager"
TableViewAutolayoutManager inherits from TableViewManager. Please see TableViewManager first.
Please be sure that you have to use this pod. In most cases self sizing cells is enough.
TableViewAutolayoutManager using UIView systemLayoutSizeFittingSize(_:)
to calculate height.
Do all steps described in TableViewManager, but do it with TableViewAutolayoutManager
instead of TableViewManager
and TableViewAutolayoutManagerProtocol
instead of TableViewManagerProtocol
.
import TableViewAutolayoutManager
extension ViewController: TableViewAutolayoutManagerProtocol {
// (...)
}
Implemment tableView(_:heightForRowAtIndexPath:)
as below.
extension ViewController: UITableViewDataSource, UITableViewDelegate {
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return self.tableViewAutolayoutManager(tableView, heightForRowAtIndexPath: indexPath)
}
// (...)
}
That's all!
TableViewAutolayoutManager is available under the MIT license. See the LICENSE file for more info.