This commit is contained in:
DDIsFriend
2023-08-18 17:28:57 +08:00
commit f0e8a1709d
4282 changed files with 192396 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
//
// EKWindow.swift
// SwiftEntryKit
//
// Created by Daniel Huri on 4/19/18.
// Copyright (c) 2018 huri000@gmail.com. All rights reserved.
//
import UIKit
class EKWindow: UIWindow {
var isAbleToReceiveTouches = false
init(with rootVC: UIViewController) {
if #available(iOS 13.0, *) {
// TODO: Patched to support SwiftUI out of the box but should require attendance
if let scene = UIApplication.shared.connectedScenes.filter({$0.activationState == .foregroundActive}).first as? UIWindowScene {
super.init(windowScene: scene)
} else {
super.init(frame: UIScreen.main.bounds)
}
} else {
super.init(frame: UIScreen.main.bounds)
}
backgroundColor = .clear
rootViewController = rootVC
accessibilityViewIsModal = true
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
if isAbleToReceiveTouches {
return super.hitTest(point, with: event)
}
guard let rootVC = EKWindowProvider.shared.rootVC else {
return nil
}
if let view = rootVC.view.hitTest(point, with: event) {
return view
}
return nil
}
}