UITableView DidSelectRowAtIndexPath?

前端 未结 5 791
余生分开走
余生分开走 2020-12-23 10:07

I have a table view with a few items (all text). When the user clicks the row I want that text in that cell to be added to an array.

How Do I grab the text out of th

5条回答
  •  無奈伤痛
    2020-12-23 10:58

    Swift Version:

    let cell: UITableViewCell = tableView.cellForRowAtIndexPath(indexPath)!
    let cellText: String = cell.textLabel.text
    

提交回复
热议问题