Skip to content

Instantly share code, notes, and snippets.

@michaelevensen
Last active October 28, 2016 18:20
Show Gist options
  • Save michaelevensen/12297eb78462d615dec7b71b8ee8bed2 to your computer and use it in GitHub Desktop.
Save michaelevensen/12297eb78462d615dec7b71b8ee8bed2 to your computer and use it in GitHub Desktop.
Allows UITableViewCells to dynamically size based on content. Make sure to set all vertical autolayout constrains for all elements in UITableViewCell for this to work properly. Also make sure to set UILabel Lines to 0.
// Dynamically sizing cells
self.tableView.rowHeight = UITableViewAutomaticDimension
self.tableView.estimatedRowHeight = 400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment