Easily access SwiftUI's preview devices without having to remember or repeatedly type out the device names manually.
Follow Apple's guidelines here if you're unfamiliar with the package management system in Xcode 11+
You can use either syntax to create your devices:
static let devices = [Device.iPhoneXs, .iPhoneSE].previews
static let devices = PreviewDevice.previews(from: [.iPhoneXs, .iPhoneSE])
From there, you're good to go:
struct YourView_Previews: PreviewProvider {
static var previews: some View {
ForEach(devices) { device in
// Do your device setup here
}
}
}