- Dev environment: Xcode 13+, macOS 12+
- iOS 13.0+, macOS 10.15+, Mac Catalyst 13.0+, tvOS 13.0+, watchOS 6.0+
Example:
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
What's new in PreviewDevice 0.8.0
PreviewDevice is released under the MIT license.