Table view inside navigation controller inside popover

First: is there a way of gracefully animating the popover's size to the size of the view controller pushed onto the navigation controller, like Pages does for the three dots menu? When setting the navigation controller's preferredContentSize inside the pushed table view controller's viewWillAppear, first the push animation is run, and when it finishes, the popover is resized.

Second: how to get the correct size to set as preferredContentSize? That would probably be the table view's contentSize (which, unless calling reloadData(), is .zero in viewWillAppear) plus the navigation view's title bar height. How can one calculate this, without having to sum the different parts manually?

Table view inside navigation controller inside popover
 
 
Q