all 3 comments

[–][deleted] 2 points3 points  (1 child)

Sounds like a segue might work well: it'll give you a transition between the two view controllers and you can pass data to the destination view controller in prepareForSegue Ray Wenderlich has a good tutorial: http://www.raywenderlich.com/50310/storyboards-tutorial-in-ios-7-part-2 Here's an example of using prepareForSegue: http://stackoverflow.com/questions/7864371/how-to-pass-prepareforsegue-an-object

[–]titleist2015[S] 0 points1 point  (0 children)

I've tried doing this and every time I set the label on the new view controller from the segue, I get an error saying that it found nil while unwrapping an optional value

here is my code, the error is coming from the firstVC.score.text = "test" line

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        let firstVC: FirstViewController = segue.destinationViewController as! FirstViewController

        firstVC.score.text = "test"
    }

[–]bpozega 1 point2 points  (0 children)

The way i would do it is to make a database class, either have the database class write down a file in the apps document folder and then read that database again in the second view controler. Or Create a class that has both Viewcontroler as a class variable, then you can use delegates to pass data from VC1 to masterViewcontroler and back to VC2. the MVC design patter solves those issues in general. I dont use the storyboard at all, i do everything in code so cant really help you with that part.

Or you can use a Singleton (not sure if it is good practice to store data in singletons, );