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

US research team uses iPhone to detect cancer: 99% accuracy

Apple's grand plans to enter the health care f...

up to date! Data rankings of 60 information flow advertising platforms!

Today I bring you the latest traffic rankings of ...

If you want to watch birds, you no longer have to wait by the window!

Author: Duan Yuechu In today's era of integra...

The genius idea that afternoon led Time magazine to compare him to Galileo

In his more than 50 years of academic career, Sch...

The method of increasing users by “old customers bringing in new customers”!

Before talking about the method of “old employees...

Summary of bidding data analysis: How to analyze bidding data?

Summary of bidding data analysis: How to analyze ...

How is the world's most poisonous mushroom made?

“Red umbrellas, white poles, after eating we lie ...

8 Tik Tok promotion skills to teach you how to play Tik Tok from scratch!

In the mobile era, traffic entrances were Weibo a...

Android 2.3.7 devices are blocked: no Google account logins in September

On August 2, according to The Verge, if your devi...

QQ space stretchable head

Source code introduction: Imitating QQ space with...