indexPath { } 直接进行左右两边进行侧滑操作 UIKIT_EXTERN API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos) @interface UIContextualAction *shareRowAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title: @"" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull *deleteRowAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void
{ let deleteAction = UIContextualAction(style: .normal, title: nil, handler: { (ac:UIContextualAction
{ let deleteAction = UIContextualAction(style: .normal, title: nil, handler: { (ac:UIContextualAction
cell.trailingSwipeActionsConfiguration = UISwipeActionsConfiguration( actions: [UIContextualAction cell.leadingSwipeActionsConfiguration = UISwipeActionsConfiguration( actions: [UIContextualAction
indexPath) else { return nil } return UISwipeActionsConfiguration( actions: [UIContextualAction indexPath in return UISwipeActionsConfiguration( actions: [UIContextualAction
tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath { //删除 UIContextualAction *deleteRowAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"delete" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView UISwipeActionsConfiguration configurationWithActions: @[deleteRowAction]]; return config; } 创建UIContextualAction UIContextualActionStyle) { UIContextualActionStyleNormal, UIContextualActionStyleDestructive } NS_SWIFT_NAME(UIContextualAction.Style
{ let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { \_, \_, done { let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { \_, \_, done
editActionsForRowAtIndexPath:)代理方法: 这两个代理方法返回的是UISwipeActionsConfiguration类型的对象,创建该对象及赋值可看下面的代码片段: 创建UIContextualAction
editActionsForRowAtIndexPath:)代理方法: 这两个代理方法返回的是UISwipeActionsConfiguration类型的对象,创建该对象及赋值可看下面的代码片段: 创建UIContextualAction
indexPath) else { return nil } return UISwipeActionsConfiguration( actions: [UIContextualAction indexPath in return UISwipeActionsConfiguration( actions: [UIContextualAction