79110627

Date: 2024-10-21 15:04:55
Score: 0.5
Natty:
Report link

the new #Preview macro does not support it but you can go back to the PreviewProvider struct and achieve exactly what you want:

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
            .previewDevice(PreviewDevice(rawValue: "iPhone 16"))
            .previewDisplayName("iPhone")
        
        ContentView()
            .previewDevice(PreviewDevice(rawValue: "iPad Air 5"))
            .previewDisplayName("iPad")
    }
}

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
Posted by: Radu Ursache