Post

Replies

Boosts

Views

Activity

Comment on How To Create Heatmap From Array CLCoordinate2D In A SwiftUI Map
@robnotyou quick question. Since MKMapView doesnt require a binding to region, my map shows empty blue (probably in the middle of the sea). @State private var region = MKCoordinateRegion() MapView(region: region) .edgesIgnoringSafeArea(.all) .onAppear() {     region = ... array of CLLocationCoordinate2D } This used to work when it was Map since i just had to go $region since the parameter required has to be binding but now it is not. How can it re-render once the region variable is set?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’22
Comment on How To Create Heatmap From Array CLCoordinate2D In A SwiftUI Map
@robnotyou quick question. Since MKMapView doesnt require a binding to region, my map shows empty blue (probably in the middle of the sea). @State private var region = MKCoordinateRegion() MapView(region: region) .edgesIgnoringSafeArea(.all) .onAppear() {     region = ... array of CLLocationCoordinate2D } This used to work when it was Map since i just had to go $region since the parameter required has to be binding but now it is not. How can it re-render once the region variable is set?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on Why Does Method Force Me To Add Mutating
Hi thanks. Seems mutating has to be used here. I was trying to avoid using it but it seems since it is a struct then this is a necessity. The code sample for that is to place that inside a struct View and have that variable and method. But your sample code already gave an explanation. Thank you.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’22