{
  "id": 6482485,
  "title": "iPhone Duo for iOS Developers: What Actually Changes in Your Swift Code",
  "url": "https://urgent.news/2026/09/09/iphone-duo-for-ios-developers-what-actually-changes-in-your-swift-code",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-09T21:16:11.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/arshtechpro/iphone-duo-for-ios-developers-what-actually-changes-in-your-swift-code-5gc5"
  },
  "original_language": "en",
  "account": "Apple unveiled the iPhone Duo, its first foldable iPhone, featuring a 5.4-inch outer screen and a 7.6-inch inner screen upon opening. The announcement primarily focuses on hardware, but developers must adapt their Swift code to handle the new display capabilities. Here's a breakdown of the changes and what developers need to do to make their apps work seamlessly on the iPhone Duo.\n\nFirstly, your app will still run even without changes, but it may not utilize the full screen effectively. Building against older SDKs will result in letterboxing or reduced app size, while using the iOS 27 SDK will allow your app to extend to the edge of the screen.\n\nThe most significant shift in your app's behavior is the removal of orientation-based layout decisions. Instead of relying on UIDevice.orientation or supportedInterfaceOrientations, use size classes to adapt your layout. In SwiftUI, use @Environment(\\.horizontalSizeClass) and @Environment(\\.verticalSizeClass) to create layouts for different screen configurations. In UIKit, override traitCollectionDidChange to reconfigure your layout based on the horizontalSizeClass.\n\nAvoid using UIScreen.main, as it is ambiguous in a two-display device. Instead, query the displayScale from the trait collection or the window scene's screen property. Prefer using the scene's bounds for layout sizing or the environment.\n\nSafe areas are now asymmetric, especially with the camera on one side. Handle each side independently when calculating usableWidth. For background artwork, use ignoresSafeArea to ensure it extends past the safe area, while interactive foreground content should stay inside the safe area.\n\nLastly, be aware of reserved regions, such as the hinge and under-display camera. Use GeometryReader in SwiftUI to detect and handle these regions, or reserveRegions in UIKit to avoid visual artifacts and ensure proper layout.",
  "summary": "Apple announced the iPhone Duo today — its first foldable iPhone. A 5.4-inch outer display, a 7.6-inch inner display when you open it, ships with iOS 27.x. The marketing story is the hardware. The developer story is that a lot of assumptions baked into iPhone apps since 2007 just stopped being true. There is now more than one screen. The screen can change shape while your app is running. The safe…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}