For Swift 2.3, swift3, and swift4:
Create a Segue Performance on didSelectRowAtindexPath
For example:
self.performSegue(withIdentifier: "uiView", sender: self)
After that, create the prepareforSegue function to catch the Destination transition and pass the value:
Example:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "uiView"{ let destView = segue.destination as! WebViewController let indexpath = self.newsTableView.indexPathForSelectedRow let indexurl = tableDatalist[(indexpath?.row)!].link destView.UrlRec = indexurl
You need to create a variable called UrlRec in the Destination ViewController
Sandu Nov 28 '16 at 10:18 2016-11-28 10:18
source share