- August 28, 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
This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide ...
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or ...
Create Toast Views with Minimal Effort in SwiftUI Using SSToastMessage. SSToastMessage enables you to effortlessly add toast notifications, alerts, and ...