Swift - Fit the table height to match it's contents
extension UITableView {
/** Fit the table height to match it's contents */
func fitToContentHeight() {
var frame = self.frame;
frame.size.height = self.contentSize.height;
self.frame = frame;
}
}