0

I don't know why it's crashing when I am trying to create an object of Controller.

func pushScreen() {
        var context = SelectModeInterfaceController()
        context.delegate = self
        pushController(withName: "SelectModeInterface", context: nil)    
}

I have two screens A and B. I want to send some data from A to B and B to A. It's pretty simple to send the data from A to B using context while B to A seems something different. I have knowledge about how to use delegates in iOS but in watchKit it seems different. If anybody has come up with the solution please share.

Parth Adroja
  • 13,198
  • 5
  • 37
  • 71

1 Answers1

0

I create an singleton class which is just for the purpose of data sharing. Send the instance of this class, say created in A, to B using context. Updates that B makes will remain after B is dismissed.

Owen Hartnett
  • 5,925
  • 2
  • 19
  • 35