TableViewCell内容复制

2017-06-16  本文已影响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;

}

结束。。。

上一篇 下一篇

猜你喜欢

热点阅读