This simple trick helps preventing the system from resizing the background view when the modal appears. It keeps the standard behavior (panning view, partial view with dark veil) but leave the background view untouched.
Simply set the following flag on your
UIViewController, for instance inside the
definesPresentationContext = true
If the presenting view controller is a child of a navigation controller, then we need to apply this flag to the
navigationController instead of
navigationController?.definesPresentationContext = true