📌  相关文章
📜  在表格视图单元格中快速获取选定的行数据 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:57.749000             🧑  作者: Mango

代码示例1
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

    let indexPath = tableView.indexPathForSelectedRow() //optional, to get from any UIButton for example

    let currentCell = tableView.cellForRowAtIndexPath(indexPath) as UITableViewCell

    print(currentCell.textLabel!.text)