Browse Source

UIViewComponentPeer: Call setNeedsUpdateOfSupportedInterfaceOrientations on orientation change

v7.0.9
reuk 2 years ago
parent
commit
eecb8ad995
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm

+ 8
- 2
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -2192,8 +2192,14 @@ void Desktop::allowedOrientationsChanged()
{
if ([scene isKindOfClass: [UIWindowScene class]])
{
[static_cast<UIWindowScene*> (scene) requestGeometryUpdateWithPreferences: preferences.get()
errorHandler: ^([[maybe_unused]] NSError* error)
auto* windowScene = static_cast<UIWindowScene*> (scene);
for (UIWindow* window in [windowScene windows])
if (auto* vc = [window rootViewController])
[vc setNeedsUpdateOfSupportedInterfaceOrientations];
[windowScene requestGeometryUpdateWithPreferences: preferences.get()
errorHandler: ^([[maybe_unused]] NSError* error)
{
// Failed to set the new set of supported orientations.
// You may have hit this assertion because you're trying to restrict the supported orientations


Loading…
Cancel
Save