New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AlertView does not disable Interactive Pop Gesture #66
Comments
Yep, @guilhermearaujo you are right, to disable the pop gesture I need access to the The problem is: the viewController I get as a parameter can not have access to navigationController. What you think about it? |
What about this? UINavigationController *navController = [<#ViewController#> navigationController];
if (navController != nil) {
[[navController interactivePopGestureRecognizer] setEnabled:NO];
} Then set it back to enabled once the alert is dismissed. |
@guilhermearaujo Yep, almost this. Please test my fix 0ab2a30 |
Your change will work if the view controller passed is embedded into a |
Seems fine in all my tests, could you please provide me an sample? |
Here it goes: https://github.com/guilhermearaujo/SCLAlertView/commit/ff62b8cd21db1375ed06735bcd5f444c34e126ab I've added a NavigationController and a previous view before your list of buttons to display the alerts. Push any other button, and the swipe gesture is disabled. Push the error button and see what happens. |
Patched :D and thanks |
Perfect! |
Official release 0.5.4 |
When I show an alert which should not be cancellable by touching outside its view, I expect the user to be "blocked", restricted to one of the options I present him (using buttons in the alert).
I noticed, however, that if the alert is presented from a VC inside a UINavigationController, the pop gesture (swipe from left to go back) still works.
This is bad, in my case, for instance, because I show a Progress alert with a button to cancel the HTTP request I'm performing. If the view controller is dismissed prematurely, the request will still be processed in background, and its completion block will fail because the view controller is no longer available.
I suggest the interactive pop gesture to be disabled while the alert is visible.
The text was updated successfully, but these errors were encountered: