Esempio n. 1
0
            public void PresentViewController(SignIn signIn, UIViewController viewController)
            {
                if (Google.PresentViewController != null)
                {
                    Google.PresentViewController(SignIn, viewController);
                    return;
                }

                var window = UIApplication.SharedApplication.KeyWindow;
                var root   = window.RootViewController;

                if (root != null)
                {
                    var current = root;
                    while (current.PresentedViewController != null)
                    {
                        current = current.PresentedViewController;
                    }
                    var authenticator = (authenticatorReference.Target as GoogleAuthenticator);
                    viewController.Title = authenticator.Title;
                    if (authenticator.AllowsCancel)
                    {
                        viewController.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(
                            UIBarButtonSystemItem.Cancel,
                            delegate {
                            Cancel();
                            viewController.DismissViewController(true, null);
                        });
                    }
                    current.PresentViewControllerAsync(new UIKit.UINavigationController(viewController), true);
                }
            }
Esempio n. 2
0
            public void DismissViewController(SignIn signIn, UIViewController viewController)
            {
                if (Google.DismissViewController != null)
                {
                    Google.DismissViewController(SignIn, viewController);
                    return;
                }

                viewController.DismissViewController(true, null);
            }