Auto resize a cell in tableview based on dynamic input

How to auto resize a cell in tableview based on user input. So that if user inputs a lot of words the cell expands in order so label could expand and all the text could wrap and fit.

Sort of exactly how it is done in iPhone reminder application.


Basic implementation is to add constraints on all four side i.e. top, bottom, leading and trailing.

and in viewDidLoad(), setTableViewHeight to UITableViewAutomaticDimension

- (void)viewDidLoad
   self.tableView.estimatedRowHeight = 50.0;
   self.tableView.rowHeight = UITableViewAutomaticDimension;

  /*To hide separator from empty space at bottom*/
  [[self tableView] setTableFooterView:[UIView new]]; 


Follow this nice tutorial, and you will be able to implement the required in no time

Dynamic Height Cell in iOS

I think what you need is this -

tableView.estimatedRowHeight = 100
//You can put anything in place of 100.
tableView.rowHeight = UITableViewAutomaticDimension

Hope this helps


 ? IOS:Multiple PrototypeCells in UITableView
 ? Dynamic cell height for tableview
 ? UITableViewCell of different heights
 ? UITableViewCell, UITextView with dynamic height
 ? UITableViewCell becomes unresponsive
 ? Calculate dynamic height of uitableviewcell
 ? UITableViewCell dynamic height programmatically
 ? Dynamic UITableCellView height
 ? Dynamic UITableCellView height
 ? Dynamic UITableCellView height