File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,9 @@ public class TouchTrackingUIView: UIView {
5151 var touches : Set < UITouch > = [ ]
5252 var locations : [ CGPoint ] = [ ] {
5353 didSet {
54- updatePoints ( )
54+ DispatchQueue . main. async {
55+ self . updatePoints ( )
56+ }
5557 }
5658 }
5759
@@ -164,7 +166,9 @@ public class TouchTrackingUIView: UIView {
164166 pointWindows [ touches. count..< pointWindows. count] . forEach {
165167 $0. isHidden = true
166168 $0. windowScene = nil
167- $0. uiviewRemoveFormSuperView ( )
169+ if $0. superview != nil {
170+ $0. uiviewRemoveFromSuperView ( )
171+ }
168172 }
169173 pointWindows = Array ( pointWindows [ 0 ..< touches. count] )
170174 }
@@ -201,10 +205,13 @@ public class TouchTrackingUIView: UIView {
201205 let screen = self . window? . screen,
202206 let keyboardScene = UIWindowScene . keyboardScene ( for: screen) ,
203207 let keyboardRemoteWindow = keyboardScene. allWindows. first {
208+ window. rootViewController = nil
204209 keyboardRemoteWindow. addSubview ( window)
205210 } else {
206211 // WORKAROUND: Apply changes of orientation
207- window. rootViewController = . init( )
212+ if window. rootViewController == nil {
213+ window. rootViewController = . init( )
214+ }
208215 window. windowScene = self . window? . windowScene
209216 }
210217
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ extension UIWindow {
7777}
7878
7979extension UIWindow {
80- func uiviewRemoveFormSuperView ( ) {
80+ func uiviewRemoveFromSuperView ( ) {
8181 super. removeFromSuperview ( )
8282 }
8383}
You can’t perform that action at this time.
0 commit comments