Hi I make tableviewcontroller class and I want to get cell height dynamicly so i use UITableViewAutomaticDimension but it always return me -1.
tableView.rowHeight = UITableViewAutomaticDimension
println("\(tableView.rowHeight)")
tableView.estimatedRowHeight = 44
when I do tableView.rowHeight = 44 everything works great. My superclass is UIViewController.
You can only use
UITableViewAutomaticDimension
for footer/header height and only if you implement:If you're implementing the:
it will not work.
UITableViewAutomaticDimension
is not intended to be used to set the row height. UserowHeight
and specify your value or implement: