Closed fso-msrl closed 1 year ago
Could you please attach the code where the problem occurred? I would like to understand your issue.
Thanks ! 😄
Hi! We are working in a solution for this behavior.
On master branch is implemented a solution for this behavior (available for iOS 16+). In Readme is available this documentation to work with that:
The user can also configure if the swipe action is enable or not (the swipe is based on a drag gesture) and setup what edges have the gesture disabled.
Params:
swipeGestureEnabled
: swipe is enabled or not (default is true).edgeSwipeGestureDisabled
: is an HorizontalContainerEdge (OptionSet) value where the array could have this options: .left, .right, .both or be empty (default is an empty array).What is the importance to have this parameter?
Regarding the next PagerTabStripView example in MyPagerView2
: if the pager is in the first page and the user try to swipe to the left, is possible to catch a parent view gesture (where this pager is embebbed) instead of catching the actual pager swipe gesture because it is disabled with the edgeSwipeGestureDisabled
paramenter.
struct MyPagerView2: View {
@State var selection = 1
var body: some View {
PagerTabStripView(swipeGestureEnabled: .constant(true),
edgeSwipeGestureDisabled: .constant([.left]),
selection: $selection) {
MyFirstView()
.pagerTabItem(tag: 1) {
TitleNavBarItem(title: "Tab 1")
}
...
..
.
}
}
}
Also is available an example in the Example App (in SegmentedView).
Here is the actual code:
Is your feature request related to a problem? Please describe. My use case is my page have 2 levels, one for main-categories: A, B, C, and one for sub-categories: B1, B2, B3 something like that: A is some view B is PagerTabStripView with 3 pages: B1, B2, B3 (both are some view) C is some view I can swipe from A to B, but I cant swipe from B1 to A, and I can swipe from C to B, but I cant swipe from B3 to C
Describe the solution you'd like I can swipe from B1 to A, and I can swipe from B3 to C
Describe alternatives you've considered none
Additional context none