Merge pull request #295 from gcox/master
Fixed bug preventing ASIAuthenticationDialog from being dismissed on iOS5
Showing
1 changed file
with
8 additions
and
2 deletions
| @@ -216,7 +216,10 @@ static const NSUInteger kDomainSection = 1; | @@ -216,7 +216,10 @@ static const NSUInteger kDomainSection = 1; | ||
| 216 | 216 | ||
| 217 | + (void)dismiss | 217 | + (void)dismiss |
| 218 | { | 218 | { |
| 219 | - [[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES]; | 219 | + if ([sharedDialog respondsToSelector:@selector(presentingViewController)]) |
| 220 | + [[sharedDialog presentingViewController] dismissModalViewControllerAnimated:YES]; | ||
| 221 | + else | ||
| 222 | + [[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES]; | ||
| 220 | } | 223 | } |
| 221 | 224 | ||
| 222 | - (void)viewDidDisappear:(BOOL)animated | 225 | - (void)viewDidDisappear:(BOOL)animated |
| @@ -233,7 +236,10 @@ static const NSUInteger kDomainSection = 1; | @@ -233,7 +236,10 @@ static const NSUInteger kDomainSection = 1; | ||
| 233 | if (self == sharedDialog) { | 236 | if (self == sharedDialog) { |
| 234 | [[self class] dismiss]; | 237 | [[self class] dismiss]; |
| 235 | } else { | 238 | } else { |
| 236 | - [[self parentViewController] dismissModalViewControllerAnimated:YES]; | 239 | + if ([self respondsToSelector:@selector(presentingViewController)]) |
| 240 | + [[self presentingViewController] dismissModalViewControllerAnimated:YES]; | ||
| 241 | + else | ||
| 242 | + [[self parentViewController] dismissModalViewControllerAnimated:YES]; | ||
| 237 | } | 243 | } |
| 238 | } | 244 | } |
| 239 | 245 |
-
Please register or login to post a comment