1
This commit is contained in:
@@ -82,30 +82,39 @@
|
||||
}
|
||||
|
||||
/// 左滑删除
|
||||
- (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) {
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
// 删除按钮
|
||||
UIContextualAction *deleteAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive
|
||||
title:nil
|
||||
handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
|
||||
[weakSelf deleteItemAtIndexPath:indexPath];
|
||||
completionHandler(YES);
|
||||
}];
|
||||
deleteAction.backgroundColor = [UIColor colorWithHex:0xF44336];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
deleteAction.image = [UIImage systemImageNamed:@"trash.fill"];
|
||||
}
|
||||
|
||||
UISwipeActionsConfiguration *config = [UISwipeActionsConfiguration configurationWithActions:@[deleteAction]];
|
||||
config.performsFirstActionWithFullSwipe = NO;
|
||||
return config;
|
||||
}
|
||||
//- (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) {
|
||||
//
|
||||
// NSLog(@"[KBAIMessageListVC] trailingSwipeActionsConfigurationForRowAtIndexPath called for row: %ld", (long)indexPath.row);
|
||||
//
|
||||
// __weak typeof(self) weakSelf = self;
|
||||
//
|
||||
// // 删除按钮
|
||||
// UIContextualAction *deleteAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive
|
||||
// title:nil
|
||||
// handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
|
||||
// NSLog(@"[KBAIMessageListVC] Delete action triggered for row: %ld", (long)indexPath.row);
|
||||
// [weakSelf deleteItemAtIndexPath:indexPath];
|
||||
// completionHandler(YES);
|
||||
// }];
|
||||
// deleteAction.backgroundColor = [UIColor colorWithHex:0xF44336];
|
||||
// if (@available(iOS 13.0, *)) {
|
||||
// deleteAction.image = [UIImage systemImageNamed:@"trash.fill"];
|
||||
// }
|
||||
//
|
||||
// UISwipeActionsConfiguration *config = [UISwipeActionsConfiguration configurationWithActions:@[deleteAction]];
|
||||
// config.performsFirstActionWithFullSwipe = NO;
|
||||
// return config;
|
||||
//}
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return YES;
|
||||
}
|
||||
//- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
// NSLog(@"[KBAIMessageListVC] canEditRowAtIndexPath called for row: %ld", (long)indexPath.row);
|
||||
// return YES;
|
||||
//}
|
||||
|
||||
//- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
// NSLog(@"[KBAIMessageListVC] editingStyleForRowAtIndexPath called for row: %ld", (long)indexPath.row);
|
||||
// return UITableViewCellEditingStyleDelete;
|
||||
//}
|
||||
|
||||
#pragma mark - JXCategoryListContentViewDelegate
|
||||
|
||||
|
||||
Reference in New Issue
Block a user