no message

This commit is contained in:
Peter Iakovlev
2018-02-21 01:46:32 +04:00
parent 2d79df7e75
commit 14f0fc94f4
32 changed files with 1681 additions and 142 deletions

View File

@@ -11,6 +11,7 @@ private let defaultOrientations: UIInterfaceOrientationMask = {
private class WindowRootViewController: UIViewController {
var presentController: ((UIViewController, PresentationSurfaceLevel, Bool, (() -> Void)?) -> Void)?
var orientations: UIInterfaceOrientationMask = defaultOrientations {
didSet {
if oldValue != self.orientations {
@@ -73,6 +74,7 @@ private final class NativeWindow: UIWindow, WindowHost {
var updateIsUpdatingOrientationLayout: ((Bool) -> Void)?
var updateToInterfaceOrientation: (() -> Void)?
var presentController: ((ViewController, PresentationSurfaceLevel) -> Void)?
var presentControllerInGlobalOverlay: ((_ controller: ViewController) -> Void)?
var hitTestImpl: ((CGPoint, UIEvent?) -> UIView?)?
var presentNativeImpl: ((UIViewController) -> Void)?
var invalidateDeferScreenEdgeGestureImpl: (() -> Void)?
@@ -150,6 +152,10 @@ private final class NativeWindow: UIWindow, WindowHost {
self.presentController?(controller, level)
}
func presentInGlobalOverlay(_ controller: ViewController) {
self.presentControllerInGlobalOverlay?(controller)
}
func presentNative(_ controller: UIViewController) {
self.presentNativeImpl?(controller)
}
@@ -226,6 +232,10 @@ public func nativeWindowHostView() -> WindowHostView {
hostView?.present?(controller, level)
}
window.presentControllerInGlobalOverlay = { [weak hostView] controller in
hostView?.presentInGlobalOverlay?(controller)
}
window.presentNativeImpl = { [weak hostView] controller in
hostView?.presentNative?(controller)
}