mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-05 20:52:48 +00:00
Use window's root controller to present native controllers
This commit is contained in:
@@ -246,6 +246,10 @@ private final class WindowRootViewController: UIViewController, UIViewController
|
||||
self.previousPreviewingHostView = nil
|
||||
}
|
||||
}
|
||||
|
||||
override public func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) {
|
||||
super.present(viewControllerToPresent, animated: flag, completion: completion)
|
||||
}
|
||||
}
|
||||
|
||||
private final class NativeWindow: UIWindow, WindowHost {
|
||||
|
||||
@@ -448,8 +448,7 @@ public enum ViewControllerNavigationPresentation {
|
||||
}
|
||||
|
||||
override open func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) {
|
||||
super.present(viewControllerToPresent, animated: flag, completion: completion)
|
||||
return
|
||||
self.view.window?.rootViewController?.present(viewControllerToPresent, animated: flag, completion: completion)
|
||||
}
|
||||
|
||||
override open func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {
|
||||
|
||||
Reference in New Issue
Block a user