diff --git a/Sources/PathPresenter/Path.swift b/Sources/PathPresenter/Path.swift index 3a469b9..277fe99 100644 --- a/Sources/PathPresenter/Path.swift +++ b/Sources/PathPresenter/Path.swift @@ -243,7 +243,7 @@ public extension PathPresenter { Update `sheetPresented` state */ private mutating func updateSheet() { - if case .sheet = path.last { + if path.last?.isSheet ?? false { sheetPresented = true } else { sheetPresented = false diff --git a/Sources/PathPresenter/RoutingView.swift b/Sources/PathPresenter/RoutingView.swift index eca30eb..594d400 100644 --- a/Sources/PathPresenter/RoutingView.swift +++ b/Sources/PathPresenter/RoutingView.swift @@ -89,6 +89,7 @@ public extension PathPresenter { ZStack(alignment: .topLeading) { if let rootView = rootView, !sheet { rootView + .zIndex(-1) } ForEach(content, id: \.hashValue) { elem in switch elem { @@ -129,13 +130,13 @@ public extension PathPresenter { */ public var body: some View { coreView + .animation(path.relevantAnimation, value: path) .sheet(isPresented: $path.sheetPresented, onDismiss: { path.sheetDismissed() }, content: { shitView }) - .animation(path.relevantAnimation, value: path) } } }