I am at present engaged on my app with MVVM and a mix of views made with UIKit and SwiftUI and having some bother determining find out how to deal with community callbacks between the views. All community operations are completed with Async/Await.
How my app works goes, there’s a button inside a UIKit view and, if you contact it, it is going to ship you to a group view made with SwiftUI.
So, the specifics of my downside are stemming from, say, that I am making a group view with a LazyVGrid in SwiftUI and I would like it to point out solely when each merchandise, there are unknown variety of them, on it has completed receiving information from the server. Proper now, The objects are laid on the LazyVGrid through ForEach loop and, since there is not any community completion handler in place, the objects blink from the placeholder to the view supposed when their community name is completed. Thus, my first query is, Is there any approach to deal with a number of callbacks from each SwiftUI view inside a ForEach loop and course of the LazyVGrid after the objects have completed receiving information by way of community?
After that, how do I ship a callback that the LazyVGrid is able to present to the UIKit view? I need to do that as a result of I need to place a loading display till the LazyVGrid is accomplished.
I feel I am making this app method tougher than it needs to be, however I made a decision to get out of my consolation zone and attempt to experiment with one thing sophisticated view-wise.
To date, I’ve tried making a Revealed variable that goes up when the objects are completed, however, since I’ve to ship a callback to the UIKit view as properly, it is no use.
Thanks for studying this, and I respect your assist.
Have a pleasant day.