Andrej Malyhin
Aug 28, 2017 · 2 min read

That is totally different question, your are right! My original article was written like 10 months ago, so I should probably update it with my new expirience.

I wasn’t aware of Uber’s RIBlets architecture but in my latest application I’m using something similar. Phew! If a huge company uses it probably I’m on the right track.

So my module consists from:

  1. Interactor
  2. Configurator
  3. ViewController

NOTE: Routing in my app is really simple so I decided not to spawn Router object for a sole propuse of trigerring one method. I’m also not using Presenter. Basically, Presenter is a ViewModel in MVVM approach. I don’t think that you need a whole object to convert one format into another. I’m solving these in extensions to corresponding classes and some additions in styling for my UI controls (see my article).

I’m sure that you should not connect yout Router with Presenter. As I mention above, Presenter (probably, Converter is a better name for it) does not present anything. Router or Wireframe does. So I think you should definetly connect your Interactor with Router. This way it does not really matter if module has a view (everything in VIPER module is isolated for mocking during testing, so module does not have to contain a view) logic is responsible for routing at all times.

Rigth now I’m using very simple yet not “pretty” or “right” solution.

In Storyboard I’m using an Object
 
@objc public final class CreateReminderConfigurator: NSObject {
let interactor = CreateReminderInteractor()@IBOutlet weak var view: CreateReminderViewController!public override func awakeFromNib() { super.awakeFromNib() configure() } func configure() { view.interactor = interactor interactor.view = view }}

Here you will able to set your Router object to Interactor (* I’m not using one).

But this is not the right solution! I’m sure that you sould not use Storyboards if you are implementing VIPER-like architecture. Implement your own routing. This will allow you to connect directly to another module’s Configurator and pass the data. In this article guys are using their own routing.

UPD: I’ve watched Uber’s videos and read article. It is in fact really similar to VIPER but really specialized for their case. Apps are different and for smaller or simplier apps you need to transform your architecture. RIBs actually gives you that flexibility: everything is optional there. So I think it is a better version if VIPER.

Hope this helps!
Andrei.

)

    Andrej Malyhin

    Written by

    iOS developer at Flo. @ankoma22

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade