Skip to content

Commit

Permalink
对滚动做了兼容性处理
Browse files Browse the repository at this point in the history
  • Loading branch information
fatbobman committed Dec 5, 2024
1 parent 96609ff commit d2a50d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Binary file not shown.
13 changes: 12 additions & 1 deletion Sources/SwipeCell/SwipeCellViewModifier2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extension SwipeCellModifier {
}
}
.contentShape(Rectangle())
.simultaneousGesture(getGesture())
.myGesture(getGesture())
.onAppear {
self.setStatus(status)
switch status {
Expand Down Expand Up @@ -178,3 +178,14 @@ extension SwipeCellModifier {
}

}

extension View {
@ViewBuilder
func myGesture(_ g:_EndedGesture<_ChangedGesture<DragGesture>>) -> some View {
if #available(iOS 18, *) {
simultaneousGesture(g)
} else {
gesture(g)
}
}
}

0 comments on commit d2a50d3

Please sign in to comment.