mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
Merged changed from 80cd88e976 (thanks to https://github.com/mackross).
This commit is contained in:
parent
b1a4f22c2b
commit
6cd1549136
1 changed files with 14 additions and 8 deletions
|
|
@ -268,21 +268,27 @@
|
|||
|
||||
- (void)onAction:(id)sender {
|
||||
if (self.modal) {
|
||||
|
||||
// Note that as of 5.0, parentViewController will no longer return the presenting view controller
|
||||
SEL presentingViewControllerSelector = NSSelectorFromString(@"presentingViewController");
|
||||
UIViewController *presentingViewController = nil;
|
||||
|
||||
BW_IF_IOS5_OR_GREATER(presentingViewController = self.navigationController.presentingViewController;);
|
||||
BW_IF_PRE_IOS5(presentingViewController = self.navigationController.parentViewController;)
|
||||
|
||||
if ([self respondsToSelector:presentingViewControllerSelector]) {
|
||||
presentingViewController = [self performSelector:presentingViewControllerSelector];
|
||||
}
|
||||
else {
|
||||
presentingViewController = [self parentViewController];
|
||||
}
|
||||
|
||||
// If there is no presenting view controller just remove view
|
||||
if (presentingViewController) {
|
||||
[self.navigationController dismissModalViewControllerAnimated:YES];
|
||||
} else {
|
||||
[presentingViewController dismissModalViewControllerAnimated:YES];
|
||||
}
|
||||
else {
|
||||
[self.navigationController.view removeFromSuperview];
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
[[UIApplication sharedApplication] setStatusBarStyle:statusBarStyle_];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue