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

"Cricket Pupa" Earthworm: Who says only those who stand in the light are heroes?

Produced by: Science Popularization China Author:...

Flyme security guide! Use it now

When comparing the operating systems of various m...

Memoori: Commercial Office Analytics Market Reached $1.54 Billion in 2017

199IT original compilation According to Memoori&#...

An article reveals the "marketing decoding" of MINISO

How to build a good store brand? For example, fir...

In global navigation, China's Beidou is on par with the US GPS

If Beidou is still just a noun in your eyes After...

Analysis of the four major user needs of the financial community!

I have been operating in the financial management...

Chat Weapon Arsenal, teach you how to make him/her talk to you endlessly 1PDF

Chat Weapon Arsenal,, teach you how to make him/h...

Solution to iOS 14.5 UDP broadcast Sendto returns -1

[[400268]] This article is reprinted from the WeC...