dkydheeraj / gtm-oauth2

Automatically exported from code.google.com/p/gtm-oauth2
0 stars 0 forks source link

Hiding view before the pop animation completes is ugly #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The code of GTMOAuth2ViewControllerTouch's -popView make the pop animation ugly:
    if (!self.view.isHidden) {
      // Set the flag to our viewWillDisappear method so it knows
      // this is a disappearance initiated by the sign-in object,
      // not the user cancelling via the navigation controller
      didDismissSelf_ = YES;

      if (popViewBlock) {
#if NS_BLOCKS_AVAILABLE
        popViewBlock();
        self.popViewBlock = nil;
#endif
      } else {
        [self.navigationController popViewControllerAnimated:YES];
      }
      self.view.hidden = YES;
    }

I think didViewAppear_ or didDismissSelf_ can by used instead of 
self.view.isHidden as the flag to determine the run path of code so that 
self.view.hidden need not be set to YES here.

Original issue reported on code.google.com by an0...@gmail.com on 3 Aug 2012 at 2:02

GoogleCodeExporter commented 9 years ago
Hiding the view immediately is important because the server typically displays 
some inappropriate instructions for the user once sign-in has completed.

I'm not sure which flow you are saying is ugly. Dismissal of the view 
controller without completing sign-in will not go through the popView method. 

Original comment by grobb...@google.com on 7 Aug 2012 at 6:07

GoogleCodeExporter commented 9 years ago
Dismissal after signed-in is ugly.

Original comment by an0...@gmail.com on 7 Aug 2012 at 3:42

GoogleCodeExporter commented 9 years ago
When the user has signed in, the server will display an html message asking the 
user to copy an auth token. In the context of the sign-in controller, this 
messages does not make sense for the user, so the controller is trying to hide 
the message as quickly as possible.

Original comment by grobb...@google.com on 7 Aug 2012 at 5:01

GoogleCodeExporter commented 9 years ago
Then I think we can let the web view to show a more user friendly message such 
as "You've Signed In Successfully", instead of hiding the whole view.

Try presenting and dismissing GTMOAuth2ViewControllerTouch as a model view, 
you'll see it is really ugly to hide the view before the dismissing animation 
completes.

Original comment by an0...@gmail.com on 7 Aug 2012 at 5:13

GoogleCodeExporter commented 9 years ago
We do not have control over what text the server displays in the html following 
sign-in.

Original comment by grobb...@google.com on 7 Aug 2012 at 11:25

GoogleCodeExporter commented 9 years ago
No but you have absolute control over what the webview shows up.

Original comment by julien.c...@gmail.com on 20 Apr 2013 at 3:53