UIViewController In-Call Status Bar Issue

I’ve been looking for a solution for 3 days. I don’t like this solution but didn’t found better way how to fix it.

I’he got situation when rootViewController view has bigger height for 20 points than window, when I’ve got notification about status bar height updates I manually setup correct value.

Add method to the AppDelegate.swift

func application(_ application: UIApplication, didChangeStatusBarFrame oldStatusBarFrame: CGRect) {
        if let window = application.keyWindow {
            window.rootViewController?.view.frame = window.frame
        }
    }

After that it works as expected (even after orientation changes).
Hope it will help someone, because I spent too much time on this.

P.S. It blinks a little bit, but works.

Leave a Comment