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

Apple's new product launch tomorrow: Apple TV launch is unlikely

[September 10 news] In the early morning of Septe...

HTTPS for the entire site is here

Recently, when you use Baidu, Google or Taobao, h...

Selling 196 million in one day, how did Himalaya achieve growth?

Himalaya was established in 2012. Its previous po...

Witnesses, not just stones

Witnesses Are Not Just Stones Author: Mao Ning Sc...

Oculus founder: Virtual reality is still 10 years away from you

In a recent interview with the Financial Times, O...

Are bees also "doing early childhood education"? Scientists tell you

Bees are an important type of pollinating insect....

The 2022 rumor list is out, have you believed it?

Is wearing a mask for a long time harmful to your...

Why do social traffic platforms flock to offline festivals?

Social traffic platforms refer to platforms that ...

Cryo-EM sees real atoms! Does it look like what science predicts?

All matter on Earth is made up of atoms, which ar...