swift UITableView cell自适应高度
ios8支持:
1.
override func viewDidLoad() {  
    super.viewDidLoad()  
      
    self.tableView.estimatedRowHeight = 100  
    self.tableView.rowHeight = UITableViewAutomaticDimension  
}  
2.
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {  
......  
            cell.textLabel?.numberOfLines = 0  
            cell.textLabel?.preferredMaxLayoutWidth = CGRectGetWidth(tableView.bounds)  
}  
3.
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {  
    return UITableViewAutomaticDimension  
}  
原文:http://www.cnblogs.com/OrangesChen/p/5107521.html