Skip to content

Commit 8e9c44b

Browse files
committed
Fixed accidental removal of optional delegate interface check
Fixes #11970
1 parent 4dd585f commit 8e9c44b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/video/uikit/SDL_uikitwindow.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,11 @@ void UIKit_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int
398398

399399
/* Get all possible valid orientations. If the app delegate doesn't tell
400400
* us, we get the orientations from Info.plist via UIApplication. */
401-
validOrientations = [app.delegate application:app supportedInterfaceOrientationsForWindow:data.uiwindow];
401+
if ([app.delegate respondsToSelector:@selector(application:supportedInterfaceOrientationsForWindow:)]) {
402+
validOrientations = [app.delegate application:app supportedInterfaceOrientationsForWindow:data.uiwindow];
403+
} else {
404+
validOrientations = [app supportedInterfaceOrientationsForWindow:data.uiwindow];
405+
}
402406

403407
if (hint != NULL) {
404408
NSArray *orientations = [@(hint) componentsSeparatedByString:@" "];

0 commit comments

Comments
 (0)