mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Merge pull request #19 from diederich/develop
fix UIActionSheet rotation when presented modally
This commit is contained in:
commit
4b614da47b
@ -269,16 +269,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (UIView*) viewForShowingActionSheetOnPhone {
|
- (UIView*) viewForShowingActionSheetOnPhone {
|
||||||
if(self.view.window.rootViewController) {
|
//find the topmost presented viewcontroller
|
||||||
//try to show it in the rootviewcontroller's view
|
//and use its view
|
||||||
//so it covers the UITabBar or works if this
|
UIViewController* topMostPresentedViewController = self.view.window.rootViewController;
|
||||||
//controller is inside a UIScrollView
|
while(topMostPresentedViewController.presentedViewController) {
|
||||||
return self.view.window.rootViewController.view;
|
topMostPresentedViewController = topMostPresentedViewController.presentedViewController;
|
||||||
} else {
|
}
|
||||||
|
UIView* view = topMostPresentedViewController.view;
|
||||||
|
|
||||||
|
if(nil == view) {
|
||||||
//hope for the best. Should work
|
//hope for the best. Should work
|
||||||
//on simple view(controller) hierarchies
|
//on simple view(controller) hierarchies
|
||||||
return self.view;
|
view = self.view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - BITFeedbackUserDataDelegate
|
#pragma mark - BITFeedbackUserDataDelegate
|
||||||
|
Loading…
x
Reference in New Issue
Block a user