0

I am currently working on a app which will create a modal view, and I know how to send data to the modal view, but how do I have the modal view to send data back to the parent view?

RobRoyRyan
  • 45
  • 1
  • 10

1 Answers1

0

The conventional mechanism would be to define a protocol, and have the modal view support the setting of a delegate that implements the protocol.

From there it's simple: the parent view implements the protocol, and sets itself as the delegate. Then, when you've got data to publish from the modal view, pass it to the delegate, and the parent view receives it via its protocol implementation.

Andrew
  • 11,894
  • 12
  • 69
  • 85