aheze / SwipeActions

Add customizable swipe actions to any view.
https://twitter.com/aheze0/status/1646399867764510721
MIT License
1.08k stars 46 forks source link

Bug when swipe left and right #22

Open LomachenkoMA opened 6 months ago

LomachenkoMA commented 6 months ago
                    VStack {
                        SwipeViewGroup{
                            ForEach(outRecord, id:\.self){ out in
                                SwipeView {
                                    OutCardView(out)
                                        .onTapGesture {
                                            outVM.loadSingle(out: out)
                                            mainStack.append(.outSummary)
                                        }
                                        .frame(maxWidth: .infinity)
                                        .contentShape(Rectangle())
                                } leadingActions: { _ in
                                    SwipeAction("delete", systemImage: "trash.circle", backgroundColor: .red) {

                                    }.allowSwipeToTrigger()
                                        .foregroundColor(.white)
                                } trailingActions: { _ in
                                    SwipeAction("copy", systemImage: "doc.circle", backgroundColor: .yellow) {

                                    }.allowSwipeToTrigger()
                                        .foregroundColor(.white)
                                }
                                .swipeActionCornerRadius(1)

                                Divider()
                                    .padding()
                            }
                        }
                    }

when i swipe left and right, there is an error kept shown up:

Invalid sample AnimatablePair<AnimatablePair<CGFloat, CGFloat>, AnimatablePair<CGFloat, CGFloat>>(first: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: 18.0, second: 0.0), second: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: 0.0, second: 0.0)) with time Time(seconds: 0.0) > last time Time(seconds: 0.016702291672118008)

ijunfly commented 6 months ago

+1