First, thanks for this stack, really useful for my small side project as a SwiftUI rookie.
I believe this is not really a bug but I'm wondering if this could be solved by this stack. Note: I can probably use state and enhance my custom transition to workaround (even though tbh custom transitions are a bit buggy when I want to deal with timing/delays).
struct DestinationView: View {
var body: some View {
VStack {
Spacer()
HStack {
PopView {
Text("Page 2").onAppear {
print("Page 2 onAppear") // Printed immediately
}
}
}
Spacer()
}
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .center)
}
}
struct Transition_Previews: PreviewProvider {
static var previews: some View {
VStack {
NavigationStackView(transitionType: .default,
easing: Animation.linear(duration: 5)) {
PushView(destination: DestinationView()) {
HStack {
Spacer()
Text("Page 1").onAppear {
print("Page 1 onAppear") // Printed immediately
}
Spacer()
}
}
}
}
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .center)
}
}