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 Callouts in Map Marker
Hi. Yes, i saw some tutorial creating a callout manually. it was intuitive making use of existing system image symbols. I thought at first that it's built in.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How to Shorten if let variable = optionalVariable { }
My nested ifs are actually from using json objects. it has no method to check like even if a key exists. so i have a lot of nested let ifs. thanks
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on Most Optimal Way To Fetch Data In A SwiftUI View Once?
ahh. i didnt expect a @State would be enough. will try this out thank you.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How to Shorten if let variable = optionalVariable { }
nice i didnt know that. it is so much better than having to redeclare a var. 👌
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How To Create Heatmap From Array CLCoordinate2D In A SwiftUI Map
I just posted the question. But. i realized that the code to render should not be in makeUIView. it should be in updateUIView. doh
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How To Create Heatmap From Array CLCoordinate2D In A SwiftUI Map
ok ill post a new question for this.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How To Create Heatmap From Array CLCoordinate2D In A SwiftUI Map
Reason why i am doing this is that i may have a feature where i zoom to countries based on e.g. button actions. Right now if i supply region in the constructor of MapView it all works out. But even in onAppear it does not refresh
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
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 How To Create Heatmap From Array CLCoordinate2D In A SwiftUI Map
Thanks. Sucks that there's no choice haha
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How To Create Heatmap From Array CLCoordinate2D In A SwiftUI Map
Tsk. It is? Grrr.. already invested some time using SwiftUI Map. Might as well use Google Maps. I have a question. Ive seen sample tutorials on how they do it but basically its just one ViewController with map in it all the features in it based on the example But the way they do it cannot be reused. I want to be able to reuse the map.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How To Declare A Variable of Type Function and Pass Function To it?
Thank you! I still have a lot to learn :D
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How To Zoom In Using northeast, southwest and center coordinate In Swiftui Map
Its alright, i got the array part
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How To Zoom In Using northeast, southwest and center coordinate In Swiftui Map
Hi @robnotyou this works! Thank you. I wish to ask regarding a different topic, on what to use (if you have an idea). I am also trying to create an MKCoordinateRegion from an array of coordinates. Which classes are involved?
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
Comment on What Happened to NSAttributedString in Swift 5? Bold Doesnt work?
Hi. I found the culprit. I keep calling .htmlString which returns a plain string. I also opted to use markdown instead since in html it uses a diff font helvetica and reduces font size to 12
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22