Sending data from one tableView to another

Asked

Viewed 219 times

1

I would 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 appear different views.

  • Eduardo, was a little confused to understand your context and what you hope to accomplish. In one screen only you have two UITableView and the intention is to select a row from the first table, pass this value to the other table?

2 answers

1

Vlw Galera for the answers, but in some situations in Swift I prefer not to use init. So I solved it this way.

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

That’s right, if you don’t intend to ask about the cogido, :)

  • Oops, I’m sorry for writing in Obj-c, I’m editing it for Swift.

  • Quiet, if it is not too much trouble would be a good leave here. Thank you very much

0

There is also the possibility to store the data in a Singleton class, which is a design standard, if data needs to be available for several classes to use. As an example, classes that store user session data. Follow an example link of how to do, as well as more detailed explanations: Design Patterns in Swift

Browser other questions tagged

You are not signed in. Login or sign up in order to post.