#16330·SDL

iOS SDK 27.0 orientation bugs

Author: StrangePanCreated Sep 16, 2026Updated Sep 16, 2026

Building an SDL app against the iPhoneOS27.0 SDK or iPhoneSimulator27.0 SDK causes some orientation-related problems in SDL. It's important that this get addressed quickly for the following reasons:

  • iPhoneOS27.0 SDK is distributed with Xcode 27 (and 26.6).
  • Xcode 27 is the only version of Xcode that runs on macOS Golden Gate 27.
  • Starting April 2027, Apple will require apps submitted to the App Store be built using the iOS 27 SDKs or later. (Apple news link)

Problem 1: Excessive console log warnings

Firstly, the application log gets spammed with the following warning message, especially when interacting with the system UI (e.g. home bar, window resize handles on iPad, notification center, control center, etc).

-[UIApplication statusBarOrientation] API has been deprecated and is a no-op on 27.0 and later.

Problem 2: Portrait orientation forced while in landscape

Second, there is a bug in SDL that is forcing the application into a portrait orientation when the device is in landscape mode. The bug is triggered when interacting with the system UI (e.g. home bar, window resize handles on iPad, notification center, control center, etc).

When triggered, the bug will cause the application contents to resize to "portrait" device dimensions, causing the content to extend below the bottom edge of the window, and to only render on the left side of the window, leaving a large black unused space on the right.

  1. Compile an SDL application using Xcode 27 or later.
  2. Launch the SDL application on an iPad device or simulator running iPadOS 27 or later. (I have not tested this on iPhone, but I would suspect a similar issue.)
  3. Rotate the device to landscape mode (before or after launching the application, it shouldn't matter). The application should be in landscape mode.
  4. Interact with the system UI in different ways until the bug triggers. It may take a few tries, but eventually the bug should trigger. It only takes me a few seconds.
  • Pull down control center.
  • Swipe down from the top to show the application menu and window resize controls (close, minimize, maximize).
  • Swipe up from the bottom to bring up the doc.
  • Resize the window using the handles in the corners.

More information on the issues

The instance property UIApplication.statusBarOrientation (docs link) was deprecated in iOS 13.0, but still worked. As of iOS SDK 27 however, the property is a no-op and returns UIInterfaceOrientationUnknown. SDL still uses this API, with 8 occurrences of the symbol across the codebase (search link).

Its replacement UIWindowScene::interfaceOrientation (docs link) was also deprecated in iOS 26. It does not appear to be used in SDL (search link), and I have not confirmed if it still works or is also a no-op, but my guess would be that it is not a suitable replacement for use after iOS 26.

Its second-order replacement UIWindowScene.Geometry.interfaceOrientation (docs link) appears to not be deprecated and may be a suitable replacement, though the semantics may be a little different.

Edit: using UIWindowScene.Geometry.interfaceOrientation seems to be a suitable replacement in the contexts where it is available.

The behavior change of UIApplication.statusBarOrientation appears to be causing Problem 2, specifically in SDL_uikitvideo.m::UIKit_ComputeViewframe(SDL_Window*, UIScreen*). The code appears to be swapping the width and height dimensions of the window frame if it thinks it needs to, but is failing to account for the fact that the returned orientation could be neither landscape NOR portrait.

Temporary Mitigations

Build using iPhoneOS26.5 SDK or earlier

Both Problem 1 and Problem 2 go away when I force Xcode to build using an older SDK. However, since applications will soon be required to use the latest SDK, this is not a viable long-term solution.

Local patch to SDL

Inserting the following lines into SDL_uikitvideo.m::UIKit_ComputeViewframe(SDL_Window*, UIScreen*) solves Problem 2 for me:

objc
UIInterfaceOrientation orient = [UIApplication sharedApplication].statusBarOrientation;
if (orient == UIInterfaceOrientationUnknown) {
    return frame;
}

This however does not quiet the runtime console warnings.