You are probably still 1 (or more) views off.
The parent view controller needs to do layout to adjust to your changes, and
there is no guarantee that self.view.superview is the view that needs layout to
do it. You probably want self.parentViewController.view for that.
It likely works if you
This is odd. This seems to eventually work
self.edgesForExtendedLayout = UIRectEdge.None
self.view.superview?.setNeedsUpdateConstraints()
self.view.superview?.updateConstraintsIfNeeded()
but only after the 2nd call.
So as a work around I am calling it like this: