Parcourir la source

Fixed accidental removal of optional delegate interface check

Fixes https://github.com/libsdl-org/SDL/issues/11970
Sam Lantinga il y a 3 mois
Parent
commit
8e9c44bc3b
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      src/video/uikit/SDL_uikitwindow.m

+ 5 - 1
src/video/uikit/SDL_uikitwindow.m

@@ -398,7 +398,11 @@ UIKit_GetSupportedOrientations(SDL_Window *window)
 
         /* Get all possible valid orientations. If the app delegate doesn't tell
          * us, we get the orientations from Info.plist via UIApplication. */
-        validOrientations = [app.delegate application:app supportedInterfaceOrientationsForWindow:data.uiwindow];
+        if ([app.delegate respondsToSelector:@selector(application:supportedInterfaceOrientationsForWindow:)]) {
+            validOrientations = [app.delegate application:app supportedInterfaceOrientationsForWindow:data.uiwindow];
+        } else {
+            validOrientations = [app supportedInterfaceOrientationsForWindow:data.uiwindow];
+        }
 
         if (hint != NULL) {
             NSArray *orientations = [@(hint) componentsSeparatedByString:@" "];