Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
445 views
in Technique[技术] by (71.8m points)

ios - swipe to delete in a UITableView which is embeded in a UIScrollView

I've encountered a problem the same as UIScrollview enable delete row by swipe
It is a tableView and another view work as subViews of a scrollView , and I can't enable "swipe to delete" until I set the scrollEnable property of the scrollView to NO , but it brings another problem : I can't swipe between the tableView and another view
Is there any ways other than setting the scrollEnable property to enable "swipe to delete" ?
If not , when should I set self.scrollEnable = NO, and when should I set self.scrollEnable = YES to have the "swipe to delete" and "swipe between views" both work fine ?

Thank you

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I've successfully used

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer

in a UIScrollView subclass containing the tableview to enable a UISwipeGestureRecognizer residing in the tableview to trigger instead of being swallowed by the "main" scrollview's gesture recognizers.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...