On the iPhone X in portrait mode, if you set a bottom constraint to safe area to 0, you will end up with an extra space at the bottom of the screen. How do you get programma
var bottomPadding: CGFloat = 0.0 if #available(iOS 11.0, *) { let window = UIApplication.shared.keyWindow bottomPadding = window?.safeAreaInsets.bottom ?? 0.0 }
Now you can use bottomPadding as per your needs.
bottomPadding