Fix: UIActivityViewController Share Sheet Icons Oversized and Overlapping on iOS 26

Fix: UIActivityViewController Share Sheet Icons Oversized and Overlapping on iOS 26

Written by

in

Quick answer: The oversized, overlapping icons in UIActivityViewController on iOS 26 are caused by initializing the window with UIWindow(frame: UIScreen.main.bounds) in SceneDelegate. Replace it with UIWindow(windowScene: windowScene) to restore correct share sheet layout.

Why this happens

On iOS 26, UIActivityViewController relies on the window’s scene connection to calculate proper layout metrics for the share sheet. When the app’s SceneDelegate creates the window using the legacy UIWindow(frame: UIScreen.main.bounds) initializer, the window loses its association with the UIWindowScene. This breaks the internal geometry that the share sheet uses to size service icons and position the controller, resulting in oversized, overlapping icons on iPhone (while iPad with explicit sourceView/sourceRect continues to work).

The issue does not appear on iOS 18 because the older layout path was more tolerant of a window without a scene. iOS 26’s updated share sheet implementation (part of the broader Liquid Glass / system UI refresh) strictly requires a scene-backed window.

How to fix it

1. Update SceneDelegate to use the window scene initializer

Open your SceneDelegate.swift and locate the scene(_:willConnectTo:options:) method. Replace the window creation line:

// ❌ Old code – breaks share sheet layout on iOS 26
self.window = UIWindow(frame: UIScreen.main.bounds)

with the scene-based initializer:

// ✅ Correct – preserves windowScene connection
if let windowScene = scene as? UIWindowScene {
    let window = UIWindow(windowScene: windowScene)
    self.window = window
    // … rest of your setup (rootViewController, makeKeyAndVisible, etc.)
}

Full context example:

func scene(_ scene: UIScene,
           willConnectTo session: UISceneSession,
           options connectionOptions: UIScene.ConnectionOptions) {
    guard let windowScene = scene as? UIWindowScene else { return }

    let window = UIWindow(windowScene: windowScene)
    self.window = window

    let rootVC = ShareViewController() // your root view controller
    window.rootViewController = UINavigationController(rootViewController: rootVC)
    window.makeKeyAndVisible()
}

2. Verify the fix

  1. Run the app on an iOS 26 simulator or device.
  2. Trigger the share sheet (e.g., tap the action bar button).
  3. Confirm the service icons appear at the correct size and no longer overlap.
  4. Test on iPad as well to ensure the popover presentation still works.

No changes to the UIActivityViewController presentation code are required. The original bare-bones implementation from the question works correctly once the window is scene-backed.

How to prevent it

  • Always initialize UIWindow with UIWindow(windowScene:) in SceneDelegate.
  • Avoid UIScreen.main.bounds for window sizing; the scene provides the correct bounds automatically.
  • When migrating older projects, audit SceneDelegate (or AppDelegate on iOS 12-) for legacy window creation.
  • Test share sheets and other system-presented controllers on the latest iOS beta during development cycles.

FAQ

Does this affect SwiftUI apps using WindowGroup?

No. SwiftUI’s WindowGroup creates scene-backed windows automatically. The issue only appears in UIKit apps that manually instantiate UIWindow in SceneDelegate.

Why does iPad work while iPhone fails?

On iPad the share sheet is presented as a popover anchored to a sourceView/sourceRect (or barButtonItem). That explicit anchor gives the layout engine enough geometry to size icons correctly even when the window lacks a scene. On iPhone the sheet is full-screen and depends entirely on the window’s scene metrics.

Will disabling Liquid Glass fix the layout?

No. The user in the original report tried disabling Liquid Glass system-wide and the icons remained oversized. The root cause is the missing windowScene connection, not the visual material.

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.