编辑uitableviewcell视图中单词的菜单

时间:2016-11-21 04:14:52

标签: ios swift xcode

如何显示UITableview中每个单元格中每个单词的编辑菜单? 下面的图片是我想要做的一个例子。我希望能够从每个单元格中查看的标签中选择一个单词,并显示该单词的编辑菜单。

enter image description here

1 个答案:

答案 0 :(得分:-1)

您需要在tableview委托中添加一些代码。

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  //fetch the content of label ex: "cell.labelName.text"
  //Then put it on text box and allow editing ex:   

  textBox1.text=cell.labelName.text
  textBox1.userInteractionEnabled=YES;

}