How to invoke a method in a view (SwiftUI)

Just getting started with SwiftUI and still getting to grips with the MVI model.


I have a GoogleMapsView in a ContentView. Using the CLLocationManager I capture events in the AppDelegate (or SceneDelegate) class by means of extending them with CLLocationManagerDelegate.


How can I invoke a method in the GoogleMapsView from the AppDelegate (or SceneDelegate)? In this instance I want to call the .animate method when the location change event is sent to the AppDelegate instance via the (CLLocationManagerDelegate), but the question is really more generic.

Accepted Reply

As suspected, I had to use Combine.


See here:

https://stackoverflow.com/questions/60356182/how-to-invoke-a-method-in-a-view-in-swiftui

Replies

As suspected, I had to use Combine.


See here:

https://stackoverflow.com/questions/60356182/how-to-invoke-a-method-in-a-view-in-swiftui