-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MvxIosViewPresenter: Fix ShowRootViewController #2085
Conversation
…or null values in ViewControllers prop
…tire stack of navigation in a Tab
@nmilcoff, thanks for your PR! By analyzing the history of the files in this pull request, we identified @slodge, @mvanbeusekom and @g0rdan to be potential reviewers. |
…efore releasing ViewControllers of MasterNavigationController
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good, just had a small remark on some left over commented out code.
@@ -424,7 +445,7 @@ protected virtual void SetWindowRootViewController(UIViewController controller) | |||
foreach (var v in _window.Subviews) | |||
v.RemoveFromSuperview(); | |||
|
|||
_window.AddSubview(controller.View); | |||
//_window.AddSubview(controller.View); | |||
_window.RootViewController = controller; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good practise not to leave commented out code in the code base. Just remove it, or if there is a good reason to leave it mention it with a comment in the code so other people also know why it is commented out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely right @mvanbeusekom! Good spot, forgot to remove it before commiting
✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)
Bug fix & improvements
#2076 introduced a refactor of ShowRootViewController method that broke the logic in some scenarios. Reason for this is that some properties of the ViewPresenter were being assigned too late (like TabBarViewController property, which caused #2084).
🆕 What is the new behavior (if this is a feature change)?
The logic was reverted without loosing the feature introduced in #2076. Also improved some other parts:
MvxTabBarController.ShowChildView
now usesas
operator instead of a direct cast (app could potentially crash because of that)💥 Does this PR introduce a breaking change?
No.
🐛 Recommendations for testing
Run Playground.iOS
📝 Links to relevant issues/docs
Related PR: #2076.
Related issue: #2084
🤔 Checklist before submitting