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
If suddenly you have no view, for example, CollectionViewLayout, you can retrieve it from Window too:
private static var itemHeight: CGFloat {
guard #available(iOS 11.0, *),
let window = UIApplication.shared.keyWindow else {
return Constants.itemHeight
}
return Constants.itemHeight - window.safeAreaInsets.bottom
}