多种风格的手势滑动Cell

移动开发
MGSwipeTableCell是UITableViewCell的子类,用多种过渡方式展示可点击的按钮,该库兼容所有不同的方式来创建UITableViewCell。

源码简介

MGSwipeTableCell是UITableViewCell的子类,用多种过渡方式展示可点击的按钮,该库兼容所有不同的方式来创建UITableViewCell。
源码运行截图

源码片段

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

源码下载:http://down.51cto.com/data/1985034

责任编辑:chenqingxiang 来源: 网络整理
相关推荐

2013-06-20 10:50:51

Objective-CiOS左右滑动手势

2010-01-28 14:57:36

Android滑动手势

2011-06-28 09:53:43

iPhone诺基亚N9

2021-05-29 20:47:00

微软Windows 10Windows

2015-07-23 15:28:50

celluitableview

2015-07-22 10:34:59

手势密码源码

2015-07-17 10:51:01

滑动菜单

2013-12-08 22:02:24

手势交互交互设计交互体验

2014-12-31 16:48:43

Touch touchevent多点触摸

2013-07-10 11:32:57

编码风格

2017-08-28 15:00:20

软件系统架构风格

2013-07-18 18:06:53

UITableview

2010-04-01 09:11:05

Oracle函数

2013-06-21 16:03:40

用户体验设计UED手势

2015-01-20 17:09:21

Android源码手势锁

2013-05-14 11:18:24

AIR AndroidSwipe手势

2013-07-18 18:14:26

UITableViewiOS长按手势UILongPress

2022-05-17 12:25:59

物联网智能建筑楼宇自控

2021-05-20 09:00:27

SwiftUI Swift TapGesture
点赞
收藏

51CTO技术栈公众号