I am sure there is a better, more proper way to do this. But right now I am using UIScreen.main.bounds to detect if I am dealing with an iPhone X (812 tall) or not. This specific app is landscape only, btw. So this is what I have in this function where I am crating slides for a slide view:
func setupSlideViews(slideView: [SlideView]) {
let screenSize = UIScreen.main.bounds
var frame: CGRect!
if screenSize.width == 812 {
frame = scrollView.frame
} else {
frame = view.frame
}
scrollView.frame = frame
scrollView.contentSize = CGSize(width: frame.width * CGFloat(slideViews.count), height: frame.height)
for (i, slideView) in slideViews.enumerated() {
slideView.frame = CGRect(x: frame.width * CGFloat(i), y: 0, width: frame.width, height: frame.height)
scrollView.addSubview(slideView)
}
}
But how do you check for the model?