DomiDiDongo DomiDiDongo - 6 months ago 32
iOS Question

Passing Value while changing ViewController

I want to create a

array in one ViewController, but also use it in an different Viewcontroller, so I have to pass it.

I made my own class, which creates and holds this array, but how do I pass this class-instance when switching?

Answer Source

For passing value to one class to another there are many ways like

  • create a global variable
  • create a singleton class
  • NSUserDefault
  • Segue
  • Properties

As per your requirement use any one from it

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download