Sending data from one tableView to another

1

I'd like to pass values from one tableView to another.

I took a value through indexPath.row, I would like to send the value to another tableView so that it can make a switch to display different views.

    
asked by anonymous 27.07.2015 / 15:19

2 answers

1

Vlw Galera for the answers, but in some situations in swift I prefer not to use init. So I decided that way.

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        var ProxViewController = segue.destinationViewController as! ViewControllerAnalseOP1
        ProxViewController.indice = self.indiceClicado
}

So, if you do not understand, you can ask about the catch,:)

    
28.07.2015 / 14:40
0

There is also the possibility of storing the data in a Singleton class, which is a design pattern, if in case it is necessary that the data be available for several classes to use. As an example, classes that store user session data. Here's an example how-to link, with more detailed explanations: Design Patterns in Swift

    
29.12.2015 / 15:31