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

How to Pass UIViewController instance to FeedListController? #1

Open
cresouls opened this issue Dec 3, 2018 · 2 comments
Open

How to Pass UIViewController instance to FeedListController? #1

cresouls opened this issue Dec 3, 2018 · 2 comments

Comments

@cresouls
Copy link

cresouls commented Dec 3, 2018

Hi @koromiko, great tutorial.

I am wondering how we can pass ViewController instance to FeedListController. In many occasion, we need to push a viewController on didSelect. How can I achieve it without violating MVVM architectural rule?

Thanks in advance!

@koromiko
Copy link
Owner

koromiko commented Dec 7, 2018

hi Sreejith,
Thank you for your kind words :)
Normally the viewController is actually pushed by the FeedListViewController. As for the implementation, we create a function in the FeedListViewController, which performs the push.
Then we could create an Observable in the viewModel for receiving the events from the Controller. You might want to check this example, the viewModel.showAlertClosure does a similar thing.
Hope this helps :)

@cresouls
Copy link
Author

Thank you so much @koromiko for your help. I will look into it. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants