0

My app does a lot of math. In order to display all the steps, I need another ViewController, but I also need the same data (of course). I've found a lot of tutorials on internet, but they're too complex to do as I have a lot of different inputs. Usually they had only 1 input, what makes the task simple. Is there any way to transfer the data in a simple way?

Caio Gomes
  • 139
  • 11

2 Answers2

0

It depends on what you have to pass through your controller. What you can do is create an object that stores all what you want to pass to your other controller then use a segue and the prepareForSegue and performSegueWithIdentifier to load your data in your next controller.

Chajmz
  • 729
  • 5
  • 11
0

There are several ways to do it.

  1. Delegate
  2. Properties
  3. Singleton Class
  4. NSUserdefaults

You can choose as per your requirement. as you are asking simple I will suggest you a vary simple way from it is NSUserdefaluts

If you need a example code then add comment below, I will provide you example for this as well ;)

NSAnant
  • 816
  • 8
  • 18