Ribs: Creating a viewless RIB from template doesn't compile

Created on 19 Dec 2017  路  3Comments  路  Source: uber/RIBs

When creating a viewless RIB from the template, say for example you call it MyRib, the MyRibRouter class inherits from Router. The template has the MyRibRouter overriding Router's initializer:
public init(interactor: InteractorType, viewController: ViewControllerType) { ... }

But that's the initializer for a ViewableRouter, a Router's initializer is:
public init(interactor: InteractorType) { ... }

The code doesn't compile because the initializer does not override a designated initializer from MyRibRouter's superclass. The issue seems to be related to PR #179 Maybe I don't understand those changes?

Steps to reproduce:

  1. create a RIB from the template
  2. uncheck Owns corresponding view
  3. try to compile the code

I can open a PR if desired. Unless these changes were on purpose? @neakor

bug

Most helpful comment

The template wasn't correctly updated. I just put up a PR to fix it.

All 3 comments

Good catch! I'll put up a fix.

@edrew08 @neakor put up a change, it is intentional for the Router to have a ViewController passed in as a dependency in the template but just not to pass it up to its super class.

The template wasn't correctly updated. I just put up a PR to fix it.

Was this page helpful?
0 / 5 - 0 ratings