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 {