moifort/swiftUI-slide-over-card

bug: card animation

dudutwizer opened this issue · 1 comments

Hi,

Thank you for developing this..

I manage to get it work but the card animation is somehow unstable:

Main issues:

  1. When I slide the card to the .middle , the animation start again and it looks like it have a bug
  2. Same thing if I push it up to the .top
  3. On iPhone 10 it stuck on the .top and you it doesn't recognize the 'pulling down'

here is how I implement it:

struct Main: View {
.. bla bla..
@State private var position = CardPosition.bottom
@State private var background = BackgroundStyle.blur
.. bla bla..
var body: some View {
            NavigationView {
                   ZStack(alignment: Alignment.top) {
                          .. some code..
                   VStack {
                       ...... some code...
                      } //end of VStack


            SlideOverCard(self.$position, backgroundStyle: $background) {
                    VStack {
                        Image("open-menu")
                        .resizable()
                        .scaledToFit()
                        .frame(width: 50, height: 50)
                        .foregroundColor(Color.white)
                        .padding(.bottom, 10)
                        
                        VStack(alignment: .leading)
                        {
                           .. buttons...
                        }
} // end of VStack
} // end of SlideOverCard
} // end of ZStack
.edgesIgnoringSafeArea(.vertical)
} // end of NavigationView
} // end of View
} // end of main view

thank you in advance!!

Sorry for the late answer I wasn't notified, I will take a look!