0

I am changing that safe area height using key window, this VC presents modally over another VC and keyWindow was depreciated. How can I solve this?

 // 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 {

Sulthan
  • 128,090
  • 22
  • 218
  • 270
isaacthedev
  • 181
  • 10
  • Why do you need to do this with the key window? Why not base things on the safe area of the view controller's view? – rmaddy Oct 04 '19 at 18:04
  • Why are you accessing the key window? You are creating a window in your application delegate and you can use that. However, using safe area in the controller would be much better. – Sulthan Oct 04 '19 at 18:05
  • I am new to iOS Dev and thought this would be the proper way, How can I just use the safe area – isaacthedev Oct 04 '19 at 18:16

0 Answers0