Skip to content
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

Merged
merged 7 commits into from
Jul 31, 2017

Conversation

nmilcoff
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Bug fix & improvements

⤵️ What is the current behavior?

#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.CloseChildViewModel now closes Tabs that are NavigationControllers (previously only worked for Tabs that were plain ViewControllers)
  • MvxTabBarController.ShowChildView now uses as operator instead of a direct cast (app could potentially crash because of that)
  • Also improved doc for MvxIosViewPresenter

💥 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

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated (docs style guide)
  • Nuspec files were updated (when applicable)
  • Rebased onto current develop

@mention-bot
Copy link

@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.

Copy link
Contributor

@mvanbeusekom mvanbeusekom left a 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;
Copy link
Contributor

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.

Copy link
Contributor Author

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

@martijn00 martijn00 added this to the 5.2.0 milestone Jul 31, 2017
@martijn00 martijn00 merged commit 65bbe87 into MvvmCross:develop Jul 31, 2017
@nmilcoff nmilcoff deleted the fix-ios-presenter branch August 5, 2017 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants