6

I'm attempting to have a NavigationLink load a view from the bottom of the screen instead of transitioning from the right, but the "obvious" approach (using a .transition(.move(edge: .bottom))) doesn't seem to be having any effect.

The below is inside a NavigationView:

List {
    ForEach(self.message, id: \.self) { message in
        HStack(alignment: .center) {
            MessageListCell(....)
        }
    }
}

and MessageListCell:

    var body: some View {
        HStack {
            VStack(alignment: .leading, spacing: 0) {
                Text(person.firstName).lineLimit(1)
                    .foregroundColor(.main)
            }
            Spacer()
            NavigationLink(destination: MessageDetail(otherPerson: otherPerson,
                                                   subject: subject,
                                                   profileHandler: { ProfileReducer($0) })
                .transition(.move(edge: .bottom)),
                           tag: 1, selection: $action) {
                NextButton("Proceed")
            }
        }
    }

Tapping the NextButton consistently transitions from the right side of the screen instead of the bottom. I've tried variations on the above but I'm starting to think that transition might not be the right approach.

JaredH
  • 2,338
  • 1
  • 30
  • 40
  • 3
    For now it is not possible to do this with `NavigationView`, so either wait till next major version of SwiftUI (hoping it will appear there) or create custom navigation stack, thus implementing any transition you like, as for example in topic [How do I add Animations to Transitons between custom NavigationItems made from AnyView?](https://stackoverflow.com/a/59087574/12299030) – Asperi Jan 21 '20 at 06:08
  • 1
    @Asperi implementing the stack myself does also mean I loose stuff like the swipe back gesture, right? – swalkner Feb 07 '21 at 12:14

0 Answers0