第一范文网 - 专业文章范例文档资料分享平台

[无限互联]框架学习 - MCSwipeTableViewCell

来源:用户分享 时间:2025/10/10 16:43:40 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

65.

66. [self deleteCell:cell]; 67. }]; 68. }

69. //第三个单元格

70. else if (indexPath.row % kMCNumItems == 2) { 71. //设置单元格的主标题、副标题

72. [cell.textLabel setText:@\];

73. [cell.detailTextLabel setText:@\]; 74.

75. //设置单元格的选中视图、颜色、状态、完成后的block 76. [cell setSwipeGestureWithView:checkView color:greenColor

mode:MCSwipeTableViewCellModeSwitch state:MCSwipeTableViewCellState1 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

77. NSLog(@\Checkmark\\\ 78. }]; 79.

80. //设置单元格的删除视图、颜色、状态、完成后的block 81. [cell setSwipeGestureWithView:crossView color:redColor

mode:MCSwipeTableViewCellModeExit state:MCSwipeTableViewCellState2 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

82. NSLog(@\Cross\\\ 83.

84. [self deleteCell:cell]; 85. }]; 86. }

87. //第四个单元格

88. else if (indexPath.row % kMCNumItems == 3) { 89. //设置单元格的主标题、副标题

90. [cell.textLabel setText:@\]; 91. [cell.detailTextLabel setText:@\]; 92.

93. //设置图标是否移动

94. cell.shouldAnimateIcons = NO; 95.

96. //设置单元格的选中视图、颜色、状态、完成后的block 97. [cell setSwipeGestureWithView:checkView color:greenColor

mode:MCSwipeTableViewCellModeSwitch state:MCSwipeTableViewCellState1 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

98. NSLog(@\Checkmark\\\ 99. }]; 100.

101. //设置单元格的删除视图、颜色、状态、完成后的block 102. [cell setSwipeGestureWithView:crossView color:redColor

mode:MCSwipeTableViewCellModeExit state:MCSwipeTableViewCellState2 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

103. NSLog(@\Cross\\\ 104.

105. [self deleteCell:cell]; 106. }]; 107. }

108. //第五个单元格

109. else if (indexPath.row % kMCNumItems == 4) { 110. //设置单元格的主标题、副标题

111. [cell.textLabel setText:@\]; 112. [cell.detailTextLabel setText:@\]; 113.

114. //设置单元格的定时视图、颜色、状态、完成后的block 115. [cell setSwipeGestureWithView:clockView color:yellowColor

mode:MCSwipeTableViewCellModeSwitch state:MCSwipeTableViewCellState3 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

116. NSLog(@\Clock\\\ 117. }]; 118.

119. //设置单元格的列表视图、颜色、状态、完成后的block

120. [cell setSwipeGestureWithView:listView color:brownColor

mode:MCSwipeTableViewCellModeSwitch state:MCSwipeTableViewCellState4 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

121. NSLog(@\List\\\ 122. }]; 123. }

124. //第六个单元格

125. else if (indexPath.row % kMCNumItems == 5) { 126. //设置单元格的主标题、副标题

127. [cell.textLabel setText:@\];

128. [cell.detailTextLabel setText:@\]; 129.

130. //设置第一个触发事件的距离百分比 131. cell.firstTrigger = 0.1; 132.

133. //设置第二个触发事件的距离百分比 134. cell.secondTrigger = 0.5; 135.

136. //设置单元格的选中视图、颜色、状态、完成后的block 137. [cell setSwipeGestureWithView:checkView color:greenColor

mode:MCSwipeTableViewCellModeSwitch state:MCSwipeTableViewCellState1 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

138. NSLog(@\Checkmark\\\ 139. }]; 140.

141. //设置单元格的删除视图、颜色、状态、完成后的block 142. [cell setSwipeGestureWithView:crossView color:redColor

mode:MCSwipeTableViewCellModeExit state:MCSwipeTableViewCellState2 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

143. NSLog(@\Cross\\\ 144.

145. [self deleteCell:cell];

146. }]; 147. }

148. //第七个单元格

149. else if (indexPath.row % kMCNumItems == 6) { 150. //设置单元格的主标题、副标题

151. [cell.textLabel setText:@\]; 152. [cell.detailTextLabel setText:@\]; 153.

154. //设置单元格的删除视图、颜色、状态、完成后的block 155. [cell setSwipeGestureWithView:crossView color:redColor

mode:MCSwipeTableViewCellModeExit state:MCSwipeTableViewCellState1 completionBlock:^(MCSwipeTableViewCell *cell, MCSwipeTableViewCellState state, MCSwipeTableViewCellMode mode) {

156. NSLog(@\Cross\\\ 157.

158. //设置要删除的单元格 159. _cellToDelete = cell; 160.

161. //创建弾框

162. UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@\删除?\ 163. message:@\你确定要删除这个单元格?\ 164. delegate:self

165. cancelButtonTitle:@\否\ 166. otherButtonTitles:@\是\, nil nil]; 167. [alertView show]; 168. }]; 169. } 170. }

5.创建图片视图

[objc] view plaincopyprint?

1. //创建图片视图

2. - (UIView *)viewWithImageName:(NSString *)imageName { 3. UIImage *image = [UIImage imageNamed:imageName];

搜索更多关于: [无限互联]框架学习 - MCSwipeTableViewC 的文档
[无限互联]框架学习 - MCSwipeTableViewCell.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c2b0kn9trsf3pebf0ilau_2.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top