As the warning hints, you can access the statusBarManager
which has a statusBarFrame
property. This is defined on your UIWindow
's windowScene
.
let height = view.window?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…