Answers for "how to get the selected row from the section in swift 5"

0

swift get slected row data in tableview cell

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)
Posted by: Guest on December-15-2020

Code answers related to "how to get the selected row from the section in swift 5"

Code answers related to "Swift"

Browse Popular Code Answers by Language