Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI adding custom UIViewControllerTransitioningDelegate

I'm trying to create SwiftUI custom segue animation, like this

enter image description here

I try to chain the animation to Destination but no use, it just animates inside the contents of Destination after presentation animation finish.

struct ContentView : View {
    var body: some View {
        NavigationView {
            VStack {
                List {
                    NavigationButton(destination: withAnimation{
                        Destination()
                        }.frame(width: 300, height: 300)
                         .animation(.basic())) {
                            CellView()
                        }
                    }
                }
            }

    }
}

struct CellView : View {
    var body: some View {
        VStack {
            Text("Cell")
        }
    }
}

struct Destination : View {
    var body: some View {
        VStack {
            Text("GFD")
        }
    }
}
like image 424
Wimal Weerawansa Avatar asked Jul 21 '19 10:07

Wimal Weerawansa


1 Answers

you can try with removing the animation

like image 145
sugansoft Avatar answered Nov 05 '22 14:11

sugansoft