Skip to content
Browse files

Merge pull request #295 from gcox/master

Fixed bug preventing ASIAuthenticationDialog from being dismissed on iOS5
  • Loading branch information...
2 parents 4afac5d + ba67fc8 commit 9d0776869bc8d7233ddb4da479cb013ca1a925cd @jogu jogu committed Jan 13, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 Classes/ASIAuthenticationDialog.m
View
10 Classes/ASIAuthenticationDialog.m
@@ -216,7 +216,10 @@ - (UITextField *)domainField
+ (void)dismiss
{
- [[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES];
+ if ([sharedDialog respondsToSelector:@selector(presentingViewController)])
+ [[sharedDialog presentingViewController] dismissModalViewControllerAnimated:YES];
+ else
+ [[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES];
}
- (void)viewDidDisappear:(BOOL)animated
@@ -233,7 +236,10 @@ - (void)dismiss
if (self == sharedDialog) {
[[self class] dismiss];
} else {
- [[self parentViewController] dismissModalViewControllerAnimated:YES];
+ if ([self respondsToSelector:@selector(presentingViewController)])
+ [[self presentingViewController] dismissModalViewControllerAnimated:YES];
+ else
+ [[self parentViewController] dismissModalViewControllerAnimated:YES];
}
}

0 comments on commit 9d07768

Please sign in to comment.
Something went wrong with that request. Please try again.