I have this Objective-C code that works well if placed inside viewDidAppear method - rotates view into the Portrait orientation;
UIWindowScene *windowScene = self.view.window.windowScene;
if (!windowScene) { return; }
UIWindowSceneGeometryPreferences *preferences = [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:UIInterfaceOrientationMaskPortrait];
[windowScene requestGeometryUpdateWithPreferences:preferences errorHandler:^(NSError * _Nonnull error) {
// Handle error here
}];
Now I need to do that same rotation after user pressed Read button but before the selected document is loaded in another view. The problem - I can't figure out how to force view update after the code is executed. I see initial view rotated only after exiting that selected document, but I need it rotated before entering it.
Thank you