I am looking for a way to get safe area inset values for the top and bottom of the screen (to position content correctly in order to make it not covered by a notch or software home button).
I looked around stackoverflow and was able to find this approach, however I am getting deprecation warning in XCode saying that keyWindow should not be used.
let window = UIApplication.shared.keyWindow
let topPadding = window?.safeAreaInsets.top
let bottomPadding = window?.safeAreaInsets.bottom