If during the swipe back to turn the device, then a black area appearing, see the images. (https://i.stack.imgur.com/e8JcM.png) (https://i.stack.imgur.com/95bMG.png)
If in the project settings to enable "Require full screen", then this problem disappears, but I cannot enable "Require full screen" as I also need to use my application in "Split Mode". If someone faced this let me know how to fix it.
Need to call
self.navigationController?.view.setNeedsLayout()
in theviewDidAppear()
method in the controller in which an error occurs.