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

One view, multiple modules #121

Open
pgawlowski opened this issue Feb 19, 2020 · 0 comments
Open

One view, multiple modules #121

pgawlowski opened this issue Feb 19, 2020 · 0 comments

Comments

@pgawlowski
Copy link

pgawlowski commented Feb 19, 2020

Is it any neat way to use one view (storyboard/xib/whatever) with multiple modules?
Example:
We've got same, template style overlay view. Let's call it ActionOverlayView.
It has always exactly same construction: header, description, button1, button2 etc. but totally different behaviour.
Once it will redirect to different parts of app, other time it's going to resend verification email, logout user etc.
There is totally no point of copy pasting whole view only for the same of module.

That is why I think it might be useful to move viewIdentifier to ViperItModuleProtocol and allow us to change default viewIdentifier.

VipertitModuleProtocol
var viewIdentifier: String? { get }

Module
let viewIdentifier = module.viewIdentifier ?? safeString(NSStringFromClass(viewClass).components(separatedBy: ".").last)

In that case we might be able to use one view with multi-purpose modules.

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

1 participant