Hello,
I'm developing my first app and I have a question.
I have a tableview, and I would like the indexpath.row to be visible in the 2 viewcontroller of a tabbar, to load a label. I tried to do it as below but it did not work.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if(segue.identifier == "detail"){
let indexPath : NSIndexPath = self.tableView.indexPathForSelectedRow!
let tabVC = segue.destinationViewController as! UITabBarController
let Detalhe1 = tabVC.viewControllers![0] as! Detalhe1ViewController
let Detalhe2 = tabVC.viewControllers![1] as! Detalhe2ViewController
//Labels da primeira viewcontroller
Detalhe1.ID.text = arr1[indexPath.row]
//Labels da segunda viewcontroller
Detalhe2.ID.text = arr2[indexPath.row]
}
}