From 41d58f47a37044762f0c2c60e8f24cdab28aa715 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 23 Jul 2026 23:09:47 +0200 Subject: [PATCH] Disable zoom navigation transitions when running on a Mac Dismissing any SwiftUI sheet while a .navigationTransition(.zoom) is registered traps inside UIKit's _UIZoomTransitionController on the Mac presentation path (macOS 26.4.1, builds 259/261 crash reports). The same code path is stable on iOS and iPadOS, so this is an Apple framework bug on Mac that can only be avoided. Gate both zoom-transition modifiers on a cached runtime check for isMacCatalystApp / isiOSAppOnMac so the Mac build falls into the existing no-op branch while iOS and iPadOS keep the zoom animation. --- Yattee/Extensions/View+ZoomTransition.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Yattee/Extensions/View+ZoomTransition.swift b/Yattee/Extensions/View+ZoomTransition.swift index 260cbd13..5a65e91a 100644 --- a/Yattee/Extensions/View+ZoomTransition.swift +++ b/Yattee/Extensions/View+ZoomTransition.swift @@ -9,6 +9,14 @@ import SwiftUI +#if os(iOS) +/// Whether the iOS binary is running on a Mac (Catalyst or "Designed for iPad"). +/// Zoom transitions trap inside UIKit's _UIZoomTransitionController when a sheet +/// is dismissed on the Mac presentation path, so they must stay off there. +private let zoomTransitionsRunningOnMac: Bool = + ProcessInfo.processInfo.isMacCatalystApp || ProcessInfo.processInfo.isiOSAppOnMac +#endif + // MARK: - Environment Keys /// Environment key to pass the navigation transition namespace through the view hierarchy. @@ -49,7 +57,7 @@ struct ZoomTransitionSourceModifier: ViewModifier { func body(content: Content) -> some View { #if os(iOS) - if zoomTransitionsEnabled, let namespace { + if zoomTransitionsEnabled, !zoomTransitionsRunningOnMac, let namespace { content .matchedTransitionSource(id: id, in: namespace) } else { @@ -75,7 +83,7 @@ struct ZoomTransitionDestinationModifier: ViewModifier { func body(content: Content) -> some View { #if os(iOS) - if zoomTransitionsEnabled, let namespace { + if zoomTransitionsEnabled, !zoomTransitionsRunningOnMac, let namespace { content .navigationTransition(.zoom(sourceID: id, in: namespace)) } else {