Reputation: 7525
I am trying to pass data from one view controller to another.... I have a collection view in the first view controller which is populated dynamically with an array and want it so that when an item is clicked... it opens up the second view controller (which I've done) but sends along data (in this case an array)
Ive looked into core data, but after trying to implement it thought it might be a bit "overkill" for such a basic function? (or am i wrong?)
Anyone have any ideas?
Thanks, Dave
Upvotes: 0
Views: 439
Reputation: 8588
Have you tried using prepareForSegue:
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
// pass data to next view
}
Or NSUserDefaults:
NSUserDefaults.standardUserDefaults().setObject(VALUE, forKey:YOUR_KEY)
NSUserDefaults.standardUserDefaults().synchronize()
Upvotes: 1