Skip to content

Instantly share code, notes, and snippets.

@deapsquatter
Last active December 18, 2015 03:39
Show Gist options
  • Save deapsquatter/5719733 to your computer and use it in GitHub Desktop.
Save deapsquatter/5719733 to your computer and use it in GitHub Desktop.
An iPhone presenter for use with MvxTabBarViewController (MvvmCross)
class IPhoneViewPresenter : MvxModalNavSupportTouchViewPresenter
{
public IPhoneViewPresenter (UIApplicationDelegate applicationDelegate, UIWindow window)
:base(applicationDelegate, window)
{
}
HomeView homeView;
protected override UIViewController CurrentTopViewController
{
get { return MasterNavigationController.TopViewController; }
}
public override UINavigationController MasterNavigationController
{
get{
var navController = homeView.ViewControllers [homeView.SelectedIndex];
return (UINavigationController)navController;
}
}
public override void Show (Cirrious.MvvmCross.Touch.Views.IMvxTouchView view)
{
if (homeView != null)
base.Show (view);
else{
homeView = view as HomeView;
base.SetWindowRootViewController (homeView);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment