- August 2, 2025
- Mins Read
import PreviewDevice
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.previewDevice(device: .iphone13, colorSchemes: ColorScheme.allCases)
}
}
Result
.previewDevice(device: .iphone12)
.previewDevices(device: [.iphone8, .iphone11Pro .iphone12, .iphone12ProMax])
.previewDevice(device: .iphone12, colorScheme: .light)
.previewDevice(device: .iphone12, colorScheme: [.light, .dark])
.previewDevice(device: .iphone12, orientation: .portrait)
.previewDevice(device: .iphone12, orientations: [.portrait, .landscapeLeft, .landscapeRight])
.previewDevice(device: .iphone12, orientation: .portrait, colorSchemes: [.light, .dark])
Specify next line in Podfile:
pod PreviewDevice
Open Xcode, File -> Swift Packages -> Add Packages.. and paste library git url:
https://github.com/Toni77777/PreviewDevice.git
A Zeplin component preview for your SwiftUI views. You can use Zeplin components instead of real views within your app ...
A Figma component preview for your SwiftUI views. You can use Figma components instead of real views within your app ...