You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing code like swiftui or HTML, we always expect a preview view. So in this way, we can know what we are doing or changing. Also, data analyst needs this too.
About SwiftUI preview, I have two ways to manage it.
First, if we could find how Xcode previews the view, we would need to figure out how to get the subview of a view and modifies of a view.
Second way. We could create a FakeUI. This package has the same functions or methods as SwiftUI. And we change import SwiftUI to import FakeUI. And run it. Get a JSON result and recognize it, then display the preview.
About SwiftUI preview, I have two ways to manage it.
First, if we could find how Xcode previews the view, we would need to figure out how to get the subview of a view and modifies of a view.
Second way. We could create a FakeUI. This package has the same functions or methods as SwiftUI. And we change import SwiftUI to import FakeUI. And run it. Get a JSON result and recognize it, then display the preview.
You could take a look at the android version on github and get an exact idea of how they handle previews
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
underthestars-zhy commentedon Mar 22, 2022
About SwiftUI preview, I have two ways to manage it.
First, if we could find how Xcode previews the view, we would need to figure out how to get the subview of a view and modifies of a view.
Second way. We could create a FakeUI. This package has the same functions or methods as SwiftUI. And we change
import SwiftUItoimport FakeUI. And run it. Get a JSON result and recognize it, then display the preview.nanashili commentedon Mar 22, 2022
You could take a look at the android version on github and get an exact idea of how they handle previews
[-][FEAT] - Preview[/-][+]✨ Preview[/+]stale commentedon May 30, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
AryanRogye commentedon May 2, 2026
I'm not sure if this helps but I got somewhat of a scratch project with preview working:
https://github.com/AryanRogye/SwiftUIPreviewRunner