If you like to use the source code (which you really ), take a look at the Bitbucket repository .
I have a popover dialog that shows a list of settings. These settings are listed inside several UITableViews. UITableViews cannot be scrolled, since there is already a view of the general settings. In addition, the popover dialog should occupy as much vertical screen as needed, but should be compressed horizontally.
Thus, I conceived the following structure:
UIView => MySettingsViewController - UIScrollView - UIView (Content View) - Container View1 - UITableView (embedded) => MyTableViewController - Container View2 - UITableView (embedded)
The structure is assembled through Interface Builder, and Autolayout is used to determine the size.
I have both a scroll view and a content view (I started with just one) and a container view in the corresponding supervisors (or layout guides). I limited the size of the content view as follows:
contentView.width == (topmost) UIView.width contentView.height == 200 // removed at build time
In addition, I set the size of the table view to the size of its contents, because otherwise the popover looks empty:
class MyTableViewController: UITableViewController { override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated)
The popover settings are filled with content, but its size is not quite right:

To fix this, I tried the following approach, which does not work:
class MySettingsViewController: UIViewController { override var preferredContentSize: CGSize { get { let compressedSize = view.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize)
In conclusion: compression does not work.