I have a UIViewController that contains a UITableView. This UIViewController is being displayed in a UIPopoverController.
UIViewController
UITableView
UIPopoverController
This should do the trick
override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() self.preferredContentSize = CGSizeMake(0, self.tableView.contentSize.height)}