Various styles of gesture sliding Cell

Various styles of gesture sliding Cell

Source code introduction

MGSwipeTableCell is a subclass of UITableViewCell that displays clickable buttons in a variety of transition methods. The library is compatible with all different ways to create UITableViewCell.
Source code running screenshot

Source code snippet

  1. #pragma mark Trigger Actions
  2.   
  3. -( void ) handleClick: (id) sender fromExpansion:(BOOL) fromExpansion
  4. {
  5. bool autoHide = false ;
  6. #pragma clang diagnostic push
  7. #pragma clang diagnostic ignored "-Wundeclared-selector"  
  8. if ([sender respondsToSelector: @selector (callMGSwipeConvenienceCallback:)]) {
  9. //call convenience block callback if exits (usage of MGSwipeButton class is not compulsory)  
  10. autoHide = [sender performSelector: @selector (callMGSwipeConvenienceCallback:) withObject:_cell];
  11. }
  12. #pragma clang diagnostic pop
  13.       
  14. if (_cell.delegate && [_cell.delegate respondsToSelector: @selector (swipeTableCell:tappedButtonAtIndex:direction:fromExpansion:)]) {
  15. NSInteger index = [_buttons indexOfObject:sender];
  16. if (!_fromLeft) {
  17. index = _buttons.count - index - 1 ; //right buttons are reversed  
  18. }
  19. autoHide|= [_cell.delegate swipeTableCell:_cell tappedButtonAtIndex:index direction:_fromLeft ? MGSwipeDirectionLeftToRight : MGSwipeDirectionRightToLeft fromExpansion:fromExpansion];
  20. }
  21.       
  22. if (fromExpansion) {
  23. _expandedButton = nil;
  24. _cell.swipeOffset = 0 ;
  25. }
  26. else   if (autoHide) {
  27. [_cell hideSwipeAnimated:YES];
  28. }
  29.   
  30. }

Source code download: http://download..com/data/1985034

<<:  Forward SMS to a specified mobile number by keyword

>>:  96% of mobile malware targets Android: More than 5 billion apps can be attacked

Recommend

Sharing practical experience in operating and promoting Xiaohongshu

As of January this year, Xiaohongshu has more tha...

"Help me up!" New research: Even at 60, your brain is still alive

Written by: Hao Jing: Editor: Kou Jianchao Layout...

Data Operations: How to build an efficient data analysis system?

With the advent of the data-driven and refined op...

360 search advertising promotion statistics report data!

How long can I view data? You can query data with...

Why is marijuana banned?

Marijuana is listed as one of the world's thr...

Mitsubishi China recalls imported ASX and Pajero Sport

Recently, Mitsubishi Motors Sales (China) Co., Lt...

How to develop mini programs in the pharmaceutical industry?

In our environment, getting sick may be a normal ...