答案 0 :(得分:1)
结帐UIMenuController
和https://developer.apple.com/documentation/uikit/uitableviewdelegate/1614950-tableview
以下是Obj-C的例子
UIMenuController *menu = [UIMenuController sharedMenuController];
UIMenuItem *deleteAction = [[UIMenuItem alloc] initWithTitle:@"DELETE" action:@selector(deleteMessage:)];
[menu setMenuItems:@[deleteAction]];
另外,请确保实施此方法:
- (BOOL)tableView:(UITableView *)tableView
canPerformAction:(SEL)action
forRowAtIndexPath:(NSIndexPath *)indexPath
withSender:(id)sender
{
return YES;
}