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
But here is the tricky part, you can change the @State text in another view and pass it by @Binding
//first view
@Stateprivatevartext=""Button("rasterize"){Text(text).rasterize()}
// second view
@Bindingvartext:StringTextField("Change the text here", text: $text)
I don't know if there is better way to do this, and I made an app.
The text was updated successfully, but these errors were encountered:
It is really tricky in SwiftUI to make a view into image. This is the project shown on the gif, this is a self-use-only project, codes are very rough. https://github.com/L1cardo/AppShot
I found a way to rasterize views to images directly using a button.
For example:
If you just do this, it will not work. Because the text is
""
But here is the tricky part, you can change the
@State text
in another view and pass it by@Binding
I don't know if there is better way to do this, and I made an app.
The text was updated successfully, but these errors were encountered: