Segue not getting selected row number

后端 未结 3 1697
花落未央
花落未央 2021-02-09 00:37

I am passing data from a table view controller to a detail view. I tried using indexPath.row directly in my prepareForSegue method, however it displays

3条回答
  •  有刺的猬
    2021-02-09 01:00

    Swift 3 update:

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        let selectedIndex = tableView.indexPath(for: sender as! UITableViewCell)!
        // Do your actual preparing here...
    }
    

提交回复
热议问题