Best Way to Support Different Devices in SwiftUI?

Hi, I have pretty much finished my app's layout but realized I needed to scale it for different devices. I have read online that hardcoding values (esp in frames) is a big no-no, and GeometryReader should be heavily utilized. Also was recommended ViewThatFits. The problem is, I want the app to look the exact same across all devices. What is the best way to get started?

Also, when testing, do I only have to test on an iPad and iPhone or are the dimensions significantly different amongst each class of devices?

Using ViewThatFits is definitely the recommended approach to getting a user interface that adapts to different devices and also different device orientations (e.g. landscape vs. portrait).

As with many other aspects of Swift and SwiftUI, ViewThatFits takes a little time to get used to. The first view within ViewThatFits should be the largest view with progressively smaller views coming next. Use the in: parameter to specify whether the view should assess the size horizontally or vertically, as this example shows:

ViewThatFits will choose the first child view that fits. While it can be used without the in: parameter, it usually doesn’t provide the required result unless it’s specified.

ViewThatFits(in: .horizontal) {
     HStack {
         // Large View
     }

     HStack {
        // Medium View
     }

     HStack {
        // Small View
     }
}
Best Way to Support Different Devices in SwiftUI?
 
 
Q