XLPagerTabStrip icon indicating copy to clipboard operation
XLPagerTabStrip copied to clipboard

Unable to access tableview's swipe/edit feature

Open hamzabinamin opened this issue 5 years ago • 5 comments

Is there a way to disable the horizontal scroll so that I can access the swipe feature of the table view to delete or edit an item?

If not then maybe something that can achieved by keeping the horizontal scroll enabled?

hamzabinamin avatar Aug 30 '18 16:08 hamzabinamin

self.containerView.isScrollEnabled = false put this line in viewDidLoad() block in your base class file

angelinec avatar Sep 05 '18 03:09 angelinec

@angelinec this solution worked for me, however it's worth noting that this (as the code suggests) disables the ability to swipe between pages.

For the user, the effect is that they must use the tabs for navigation, rather than swipe. For the developer, they must decide what's more important - swipe-activated features on their rows, or swipe navigation between different tabs.

On larger devices, such as + models of iPhones, this may not be a trivial decision

I don't know if there's a way to have both, if that's even possible with the way iOS handles gestures. In my case I decided that having row actions was more important, because users would need a quicker action on a row item, rather than quicker navigation.

aurora14 avatar Sep 10 '18 06:09 aurora14

@aurora14 yes, I'm fully aware that it disables the ability to swipe between pages. I did forgo that ability in my project because, like you, I needed the row actions more than the former :)

I don't know if there's a way to have both, if that's even possible with the way iOS handles gestures.

If there's a way to have both, I don't think it would work great, UX wise 😕 what say you?

angelinec avatar Sep 10 '18 07:09 angelinec

@angelinec I have noticed that when you swipe a little (but not too much) the row actions on the tableview do work sometimes. So maybe if we can find a way to force the page swipe only when the horizontal scroll distance is larger than a certain threshold that might work for both cases. What do you think?

hamzabinamin avatar Sep 10 '18 12:09 hamzabinamin

how can disable swipe left in last page only?

chienpm304 avatar Aug 25 '21 15:08 chienpm304