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

MVC with RIBS #5

Open
mohammad19991 opened this issue Aug 28, 2019 · 3 comments
Open

MVC with RIBS #5

mohammad19991 opened this issue Aug 28, 2019 · 3 comments

Comments

@mohammad19991
Copy link

Hi @dev4jam,

I have an application which is already built using MVC and now I'm planning to start using RIBs and migrate the app step by step. So I created a RIB for example ProfileRIB and I want to added it to my TabBarController. is there a way I can combine RIBs with MVC or the whole application have to be built using RIBs?

Thanks

@dev4jam
Copy link
Owner

dev4jam commented Aug 30, 2019

Hi @mohammad19991. Definitely, it's possible. In fact, I've done this several times. One concern though - you'll need to implement several protocols from RIBs.

@mohammad19991
Copy link
Author

but for me it still not clear what needs to be done, for example I created ProfileRIB and now I want to add it to my TabBarController:

let builder = ProfileBuilder(dependency: AppComponent()).build(with: context)
let profileViewController = builder.viewControllable.uiviewController
tabbar.viewControllers = [vc1, vc2, profileViewController]

doing this will cause memory leak and crash the app because am not attaching this (child)RIB to a parent RIB.

@dev4jam
Copy link
Owner

dev4jam commented Sep 9, 2019

@mohammad19991 you may try to implement your Profile RIB as your own LaunchRouter (just name it differently) and confirm to LaunchRouting protocol. And override launch method to embed your viewcontroller into the tabbar.

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