Open underthestars-zhy opened 2 years ago
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
toimport 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.
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.