Skip to content

Instantly share code, notes, and snippets.

@mlabraca
Created July 23, 2015 10:08
Show Gist options
  • Save mlabraca/a218bb2a8da054b93f65 to your computer and use it in GitHub Desktop.
Save mlabraca/a218bb2a8da054b93f65 to your computer and use it in GitHub Desktop.
Automatic row height cell for iOS 8 (Swift)
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.estimatedRowHeight = 80
self.tableView.rowHeight = UITableViewAutomaticDimension
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment