Screen gets black when app returns from background, only when keyboard is open

Viewed 36

My app gets black when it becomes active after being in the background, but only if the keyboard is opened. I have 5 schemes in the project, 4 of them have this problem, but one of them doesn't.

Debbuging view before background (keyboard is open)

Debbuging view after returning from background

App view before background

App view after returning from background

I tried to simply drag a textfield in the MainViewController, got the same problem. If I do window?.endEditing(true) in applicationDidEnterBackground solves the problem, but I think it's not a good practice.

It happens on iOS simulator and devices with iOS 15. I tested on an iPhone 5 with iOS 12.5.5 and the problem does not happen.

I am using Xcode 13.4.1. And using xcodegen.

0 Answers
Related