Skip to content

One view, multiple modules #121

Description

@pgawlowski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions