let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: .portrait) )
This work perfectly for me.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: