Building different layouts for each device/screen size

Hey there,
I'm a SUPER beginner to swift and Xcode (experience with C and Python), but I've been doing pretty good up until now. I've been building the layout for my app in the iPhone 8 simulator, but when I try and run it on different devices (with different screen sizes) I run into some problems. I've tried to use auto layout, and reduce the compression resisting priority on some things that I think should allow the layout to compress up/down and side-to-side no problem (only the elements with a lower compression resisting priority will change, allowing everything else to stay the same, and follow the same constraints).

My question is: is there any way to build a layout for each device/screen size (without auto layout)? I don't mind if it takes a long time to build a layout for every single device/screen size, and I don't mind making new ones when new phones and screen sizes (maybe another iPad split screen size) come out. I'm just having a lot of trouble with auto layout, and I'd like to know if there is a work-around.


Before there was AutoLayout, we used programmatic frame computation.
This facility is still available, but I‘d strongly advise to reconsider getting familiar with AutoLayout (or SwiftUI, which offers another take on that).

Terms of Service

Privacy Policy

Cookie Policy