We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66e1d06 commit 401de0cCopy full SHA for 401de0c
Sources/GateEngine/UI/View.swift
@@ -50,7 +50,10 @@ open class View {
50
}
51
52
public var interfaceScale: Float {
53
- return superView?.interfaceScale ?? 1.0
+ if let scale = window?.interfaceScale {
54
+ return scale
55
+ }
56
+ return 1.0
57
58
59
public var userInteractionEnabled: Bool = true
@@ -88,6 +91,15 @@ open class View {
88
91
if let window = view as? Window {
89
92
_window = window
90
93
94
+
95
+ if _window == nil {
96
+ // If the view is removed from the view heirarchy
97
+ // Check the ViewController chain
98
+ if let window = self.viewController?.parent?.view.window {
99
+ _window = window
100
101
102
103
return _window
104
105
0 commit comments