FortechRomania / ios-mvp-clean-architecture

Demo iOS application built to highlight MVP (Model View Presenter) and Clean Architecture concepts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to navigate to another UIViewController, choose something and return it to the first VC?

haemi opened this issue · comments

On my first UIViewController, I have a button which leads to another VC with a list of entries. When I select an entry on this, I would like to return it back to the first UIViewController.

But currently I really have problems implementing this with this architecture...

Hi,

You can use the delegate pattern.
For instance AddBookPresenter notifies its delegate (BooksPresenter) that a Book was added.

You can do something similar, notifying that an entry was selected, by passing back either the entry itself or the selected index path.

Regards,
Cosmin

sorry, didn't see that you already answered long time ago... thanks a lot!

I'm using this architecture in my current project, would love to open issues if I have questions/discussion material, if that's ok for you!