File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,10 @@ - (UITextField *)domainField
216216
217217+ (void )dismiss
218218{
219- [[sharedDialog parentViewController ] dismissModalViewControllerAnimated: YES ];
219+ if ([sharedDialog respondsToSelector: @selector (presentingViewController )])
220+ [[sharedDialog presentingViewController ] dismissModalViewControllerAnimated: YES ];
221+ else
222+ [[sharedDialog parentViewController ] dismissModalViewControllerAnimated: YES ];
220223}
221224
222225- (void )viewDidDisappear:(BOOL )animated
@@ -233,7 +236,10 @@ - (void)dismiss
233236 if (self == sharedDialog) {
234237 [[self class ] dismiss ];
235238 } else {
236- [[self parentViewController ] dismissModalViewControllerAnimated: YES ];
239+ if ([self respondsToSelector: @selector (presentingViewController )])
240+ [[self presentingViewController ] dismissModalViewControllerAnimated: YES ];
241+ else
242+ [[self parentViewController ] dismissModalViewControllerAnimated: YES ];
237243 }
238244}
239245
You can’t perform that action at this time.
0 commit comments