-
Notifications
You must be signed in to change notification settings - Fork 43
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
Incorrect checking if destinationViewController has moduleInput method #7
Comments
Hi! As i understand, you'd like to return some ViewController as it's module input. If so, you can just add moduleInput method with return of self to it.
|
Thanks for your reply! The solution is easy, but not obvious for those who just start to move from MVC. I think you should write about this case on main page, because you announce full support of old MVC pattern, but it isn't so. |
also using of
|
I'll add FAQ section with this question and some others. Why do you think instancetype will be better? |
When you use |
|
Yes, Anyway And one more thing. I think lines 106-110 is little bit confusing:
Of course, it's great if you will get |
Developer should know what module will be called. In case of custom container or tab bar you can return any child controller from moduleInput method to configure it. Moreover it's better to configure all child controllers via parent container in such case. |
Look
UIViewController+RamblerViperModuleTransitionHandlerProtocol.m
at lines 112-115, there you can see the following:and lines 28-34:
This checking is incorrect, because if you implement method in category of some object (for example UIViewController), like you do at lines 28-34, all objects of this class (all UIViewControllers) will respond to this method even if you won't import this category.
Also look
UIViewController+RamblerViperModuleTransitionHandlerProtocol.h
at line 11, there you can see the following:This mean that all objects of this class (all UIViewControllers) will conform to this protocol, so even if you will try to change old checking with something like this:
every UIViewController will pass this check.
Because of this, when i try to combine VIPER module with old MVC like this:
i got
nil
inmoduleInput
, instead of expectedsegue.destinationViewController
.The text was updated successfully, but these errors were encountered: