美文网首页
TableViewCell内容复制

TableViewCell内容复制

作者: 真的很菜 | 来源:发表于2017-06-16 17:09 被阅读0次

在代理方法中实现下面三个方面即可

- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath {

return YES;

}

- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {

return YES;

}

- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {

UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

[UIPasteboard generalPasteboard].string = cell.textLabel.text;

}

结束。。。

相关文章

网友评论

      本文标题:TableViewCell内容复制

      本文链接:https://www.haomeiwen.com/subject/glsmqxtx.html