Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass information to parent view controller #89

Closed
joekw opened this issue Jul 23, 2019 · 9 comments
Closed

Pass information to parent view controller #89

joekw opened this issue Jul 23, 2019 · 9 comments
Labels
wait more Further information is requested

Comments

@joekw
Copy link

joekw commented Jul 23, 2019

Hi, loving the library however i have one question (might be an easy one).
How do i pass information from the modal view controller to the parent on custom dismiss?
E.g. i've got a tableview cell in the modal view controller that will dismiss the modal on tap and set a label text in the parent view. I assume something like:

SPStorkController.dismissWithConfirmation(controller: self, completion: {
    //pass information here?
})

Thanks!

@ivanvorobei
Copy link
Owner

You want pass after closing?
If no - use delegates

@ivanvorobei ivanvorobei added the wait more Further information is requested label Jul 23, 2019
@joekw
Copy link
Author

joekw commented Jul 23, 2019

In your debts app, you tap a cell in the modal view controller to set the Currency in the parent view controller (shown in the .gif in the readme). How is this done?

@ivanvorobei
Copy link
Owner

After click on cell simple dismiss controller

@joekw
Copy link
Author

joekw commented Jul 23, 2019

Yes, i get that, but how do you then change the currency label to whatever currency was selected from the table view?

@ivanvorobei
Copy link
Owner

Updated screenshoot of parent controller

@ivanvorobei
Copy link
Owner

Make changes, after update screenshoot, after dismiss

@joekw
Copy link
Author

joekw commented Jul 23, 2019

Sorry, i don't understand.
How exactly can i refer to and change a text label in the parent view controller from the modal view controller? You're saying i have to do it after dismissing the modal? But how does my parent view controller know what cell was tapped in the modal?

@ivanvorobei
Copy link
Owner

For change use delegates

@shanelic
Copy link

May I ask a simple question about passing value between view controllers?
Why you prefer delegations instead of callbacks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wait more Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants