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 {
|
- (void)onAction:(id)sender {
|
||||||
if (self.modal) {
|
if (self.modal) {
|
||||||
|
|
||||||
// Note that as of 5.0, parentViewController will no longer return the presenting view controller
|
// Note that as of 5.0, parentViewController will no longer return the presenting view controller
|
||||||
|
SEL presentingViewControllerSelector = NSSelectorFromString(@"presentingViewController");
|
||||||
UIViewController *presentingViewController = nil;
|
UIViewController *presentingViewController = nil;
|
||||||
|
if ([self respondsToSelector:presentingViewControllerSelector]) {
|
||||||
BW_IF_IOS5_OR_GREATER(presentingViewController = self.navigationController.presentingViewController;);
|
presentingViewController = [self performSelector:presentingViewControllerSelector];
|
||||||
BW_IF_PRE_IOS5(presentingViewController = self.navigationController.parentViewController;)
|
}
|
||||||
|
else {
|
||||||
|
presentingViewController = [self parentViewController];
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is no presenting view controller just remove view
|
||||||
if (presentingViewController) {
|
if (presentingViewController) {
|
||||||
[self.navigationController dismissModalViewControllerAnimated:YES];
|
[presentingViewController dismissModalViewControllerAnimated:YES];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
[self.navigationController.view removeFromSuperview];
|
[self.navigationController.view removeFromSuperview];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
[self.navigationController popViewControllerAnimated:YES];
|
[self.navigationController popViewControllerAnimated:YES];
|
||||||
|
}
|
||||||
|
|
||||||
[[UIApplication sharedApplication] setStatusBarStyle:statusBarStyle_];
|
[[UIApplication sharedApplication] setStatusBarStyle:statusBarStyle_];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user