TIMEX TIMEX - 1 year ago 53
iOS Question

Would you use autolayout or calculate the height of each UITableViewCell if you were building the Facebook iOS app?

I'm building an app that has very complex and dynamic UITableViewCells (similar to facebook's app). Each cell is very complicated and has dynamic heights (which are always changing as things happen)

Would it be better to use the autolayout method (

self.tableView.rowHeight = UITableViewAutomaticDimension
) or calculate the height of each cell manually using

For extremely complicated cells, which route should I go?

Answer Source

As Far as, I suggest and using since Xcode 6.4 that UITableViewAutomaticDimension works much better than calculating the height manually.

One thing, I notice that if you have content in UITableViewCell that changing constantly then you don't go for calculating the height manually because every time cellForRowAtIndexPath will call and height will be calculated accordingly.

So, in that case, you will get a lag while scrolling up / down. That's the reason UITableViewAutomaticDimension is best.

I have developed an app which has almost same UI as of Facebook and in that I have used UITableViewAutomaticDimension and it works smoothly.

Here is an app, which you can look at it. Dancinglog


If you can say then I can show that particular code in that I have managed 5 different types of UITableViewCell having different views and contents.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download