我正在使用键窗口更改该安全区域的高度,此VC在另一个VC上模态显示,并且keyWindow已弃用。我该如何解决?
// set the new top constraint value for card view
// card view won't move down just yet, we need to call layoutIfNeeded()
// to tell the app to refresh the frame/position of card view
if let safeAreaHeight = UIApplication.shared.keyWindow?.safeAreaLayoutGuide.layoutFrame.size.height,
let bottomPadding = UIApplication.shared.keyWindow?.safeAreaInsets.bottom {