How to pass prepareForSegue: an object

后端 未结 10 2202
北荒
北荒 2020-11-21 11:18

I have many annotations in a mapview (with rightCalloutAccessory buttons). The button will perform a segue from this mapview to a tableview

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-21 11:51

    Just use this function.

     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        let index = CategorytableView.indexPathForSelectedRow
        let indexNumber = index?.row
        let VC = segue.destination as! DestinationViewController
       VC.value = self.data
    
    }
    

提交回复
热议问题