davdroman / swiftui-navigation-transitions

Pure SwiftUI Navigation transitions ✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic change of interactivity is not supported?

pvl2061 opened this issue · comments

My code is:

@State var enableInteractivity = false

NavigationStack(path: $stack) {
    ...
}
.navigationTransition(.default, interactivity: enableInteractivity ? .edgePan : .disabled)

I change enableInteractivity flag in the onAppear { } of views in the NavigationStack, however, it doesn't work on iOS 16 and iOS 17 - the initial value of enableInteractivity is always used.

Oh, I realized that simply changing the flag in onAppear { } is wrong because it's called during the back transition too. No issue in the library, sorry.