Make your getHomeItems() with a closure when done, and
try something like this:
.onAppear {
self.showLoading = true
DispatchQueue.main.async {
store.getHomeItems() { _ in // <--- here
self.showloading = false // <--- here
}
}
...
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: