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 requires 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. Remember that you don't need to use enum if you don't want to.
Remember about import.
import TableViewAutolayoutManagerclass ViewController: UIViewController, TableViewAutolayoutManager {
// (...)
}Implemment tableView(_:heightForRowAtIndexPath:) as below.
extension ViewController: 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.
