- August 1, 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 Figma component preview for your SwiftUI views. You can use Figma components instead of real views within your app ...
Motivation At WWDC 2019, Apple announced SwiftUI a new library for building UI in a simple and fast way. Xcode’s ...
Make use of SwiftUI previews for rapidly prototyping your UIViewControllers and UIViews! The SwiftUI preview canvas is tied to a specific version of ...
Horizontal wheel picker for SwiftUI Requirements iOS 13.0+ Installation CocoaPods
PermissionsSwiftUI displays and handles permissions in SwiftUI. It is largely inspired by SPPermissions. The UI is highly customizable and resembles an Apple style. ...