0
Hello,
I’m developing my first app and I’m having a question.
I have a tableview, and I would like her indexpath.Row to be visible in the 2 viewcontroller of a tabbar, to click on a label. I tried to do it the way below, but it didn’t 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]
    }
}
						
Thanks Celso, I’ll test later and tell you if it worked! Abs
– Ricardo