Closed lvscar closed 4 years ago
Sort of a workaround, but to make something redraw in SwiftUI you need to update the State
. You could add a query param and update it when you want to refresh it. Something like:
struct ContentView : View {
@State private var refresh: Int = 0
var body: some View {
VStack {
Button(action: { self.refresh += 1 }) { ... }
RequestView(Request {
...
Query(["refresh": refresh])
}) { ... }
}
}
}
swift-request is brilliant , especially when using it with SwiftUI.
But I can't find a way to refresh a RequestView , cloud you give me some clue?
Thank.