Building for Multiple Screen Sizes

I'm sort of new to xcode and swift programming and I was building a quiz application but I believe I made the mistake of lay-outing everything on an iphone 11 screen. I'm almost finished, however when I tried to build my app on a different device, I notice that the elements go all over the place. Can anyone tell me what I can do to adapt my application to the different screen sizes without needing to start all over again? Thank you.
Answered by Developer Tools Engineer in 616425022
How are you laying out your app's view hierarchy?

If you're using UIKit, then you can use Auto Layout constraints to configure your views such that they resize and position themselves in a way that works well across all target screen sizes. This session from WWDC 2018 covers a range of topics that are important in building your first app, including how to set up Auto Layout constraints from Interface Builder so that your app is laid out properly across different devices and orientations: https://developer.apple.com/videos/play/wwdc2018/203

It contains some references to some other sessions that discuss some more advanced Auto Layout techniques, too.

You can also check out SwiftUI which makes it easy to build UI that adapts well to various screen sizes. There are a bunch of SwiftUI sessions available this year.
Accepted Answer
How are you laying out your app's view hierarchy?

If you're using UIKit, then you can use Auto Layout constraints to configure your views such that they resize and position themselves in a way that works well across all target screen sizes. This session from WWDC 2018 covers a range of topics that are important in building your first app, including how to set up Auto Layout constraints from Interface Builder so that your app is laid out properly across different devices and orientations: https://developer.apple.com/videos/play/wwdc2018/203

It contains some references to some other sessions that discuss some more advanced Auto Layout techniques, too.

You can also check out SwiftUI which makes it easy to build UI that adapts well to various screen sizes. There are a bunch of SwiftUI sessions available this year.
Keep the layout as defined.

Then, for each object in the view, create the appropriate constraints.
Building for Multiple Screen Sizes
 
 
Q