ThoDangVN / gtm-oauth2

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

GTMOAuth2ViewControllerTouch doesn't correctly handle dismissal with a pop gesture #26

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. [in code] Create a new GTMOAuth2ViewControllerTouch instance and push it 
onto the navigation stack.
2. Build and run the app and cause the GTMOAuth2ViewControllerTouch controller 
to be presented.
3. Use the iOS 7 navigation stack pop gesture, but tap and drag from the left 
edge of the screen instead of doing a quick tap and swipe. Don't allow the pop 
to complete by dragging part-way across the screen then back so that the pop 
operation is effectively started and canceled.

What is the expected output? What do you see instead?

The problem is that -viewWillDisappear: is implemented instead of 
-viewDidDisappear:, so as the pop gesture is started, -viewWillDisappear: is 
called and does a state cleanup. When you cancel the pop by dragging back then 
the controller is still active but it's in an inconsistent state. By just 
renaming -viewWillDisappear: to -viewDidDisappear: (both the controller's 
method and its call to super), then the cleanup only happens when the pop has 
actually completed.

This is not something that you would notice if you tapped on the Back button 
since the pop operation always runs to completion.

What version of the product are you using? On what operating system?

This is being built against the iOS 7 SDK and is in the current source as of 
today.

Please provide any additional information below.

Original issue reported on code.google.com by steve.ch...@foliumpartners.com on 7 Mar 2014 at 8:24