Package for Swift Playgrounds that simulates preview like in Xcode
- Copy both Preview.swift and WidgetPreview.swift into your App.
- Use
.previewDevice()
to preview any apple device
There is no direct integration of UIKit in Swift Playgrounds 4 live preview, so we use UIViewControllerRepresentable
to show it.
There is an implementation using .modifier()
that works really nice and based of a device