1- // --------------------------------------------------------------------------------------------------------------------
2- // <summary>
3- // Defines the AppDelegate type.
4- // </summary>
5- // --------------------------------------------------------------------------------------------------------------------
6-
71using System . Collections . Generic ;
82using System ;
93using MvvmCross . Core . ViewModels ;
2923
3024namespace CodeHub . iOS
3125{
32- /// <summary>
33- /// The UIApplicationDelegate for the application. This class is responsible for launching the
34- /// User Interface of the application, as well as listening (and optionally responding) to
35- /// application events from iOS.
36- /// </summary>
3726 [ Register ( "AppDelegate" ) ]
3827 public class AppDelegate : MvxApplicationDelegate
3928 {
@@ -43,6 +32,8 @@ public class AppDelegate : MvxApplicationDelegate
4332
4433 public IosViewPresenter Presenter { get ; private set ; }
4534
35+ public static AppDelegate Instance => UIApplication . SharedApplication . Delegate as AppDelegate ;
36+
4637 /// <summary>
4738 /// This is the main entry point of the application.
4839 /// </summary>
@@ -161,14 +152,16 @@ public void RegisterUserForNotifications()
161152
162153 private void GoToStartupView ( )
163154 {
164- var startup = new CodeHub . iOS . ViewControllers . Application . StartupViewController ( ) ;
155+ var startup = new ViewControllers . Application . StartupViewController ( ) ;
165156 TransitionToViewController ( startup ) ;
166- MessageBus . Current . Listen < LogoutMessage > ( )
157+
158+ MessageBus
159+ . Current . Listen < LogoutMessage > ( )
167160 . ObserveOn ( RxApp . MainThreadScheduler )
168- . Subscribe ( _ => startup . DismissViewController ( true , null ) ) ;
161+ . Subscribe ( _ => TransitionToViewController ( startup ) ) ;
169162 }
170163
171- private void TransitionToViewController ( UIViewController viewController )
164+ public void TransitionToViewController ( UIViewController viewController )
172165 {
173166 UIView . Transition ( Window , 0.35 , UIViewAnimationOptions . TransitionCrossDissolve , ( ) =>
174167 Window . RootViewController = viewController , null ) ;
0 commit comments