mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merged changed from 80cd88e976
(thanks to https://github.com/mackross).
This commit is contained in:
parent
b1a4f22c2b
commit
6cd1549136
@ -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…
x
Reference in New Issue
Block a user