Reputation: 41
I tried iOS 15 RC version in my device iPhone 12, and found when I call window.makeKeyAndVisible, sometimes the window will change to black and back immediately.
It happened only on real device not simulator, so I tried to create a sample code to reproduce this issue, here is sample code from github https://github.com/suindong/MakeKeyIssue
In this sample code it will change keyWindow randomly, and in the video(Github readme) you can see window sometimes change to hidden, not sure how to fix it.
Does anyone face same issue in iOS 15?
Upvotes: 4
Views: 1139
Reputation: 110
This has continued to be an issue in iOS 15.
I've found that calling makeKeyAndVisible
on a window that is already the key window causes the flicker.
To work around this, make sure the window is not visible or not the key window before calling makeKeyAndVisible
:
if self.myWindow?.isKeyWindow == false || self.myWindow?.isHidden == true {
self.myWindow?.makeKeyAndVisible()
}
Upvotes: 3