Support storyboard embed modules#34
Support storyboard embed modules#34RomanTruba wants to merge 1 commit intorambler-digital-solutions:masterfrom
Conversation
|
Please review |
There was a problem hiding this comment.
ViperMcFlurry allows us open modules using following methods: openModuleUsingSegue: and openModuleUsingFactory: which return RamblerViperOpenModulePromise.
RamblerViperOpenModulePromise has thenChainUsingBlock: method which receives RamblerViperModuleLinkBlock. This block is not only used for configuring newly initialized module (via moduleInput) but also for returning moduleOutput for this module. Returned module output is used in implementation of thenChainUsingBlock: and links to module which was previously initialised.
When I dive into your solution I discovered that with your changes moduleOutput will be set twice if we use openModuleUsingSegue: method:
- in RamblerViperPrepareForSegueSender;
- in RamblerViperOpenModulePromise`s thenChainUsingBlock: method.
Could you please fix that?
| if ([targetModuleTransitionHandler respondsToSelector:@selector(moduleInput)]) { | ||
| moduleInput = [targetModuleTransitionHandler moduleInput]; | ||
| } else { | ||
| return; |
There was a problem hiding this comment.
I don't really sure that "return" is needed there.
In case sender is RamblerViperOpenModulePromise and targetModuleTransitionHandler does not respond to selector "moduleInput", variable moduleInput will be nil.
Value of this variable will be assigned to property moduleInput of RamblerViperOpenModulePromise instance and in setter (setModuleInput:) will be performed some inner setup which will allow to perform linkBlock but whith moduleInput == nil. If we do not call setModuleInput: inner setup won`t be performed and linkBlock will be never called too.
This pull request support "Storyboard Embed" segue.
It will allow to automatically wire parent view-controller's presenter with embed view-controller's presenter, which were instantiated from a storyboard.