Post

Replies

Boosts

Views

Activity

Comment on SwiftUI MapKit Map - Selecting Points of Interest
I have the selection parameter of the map set to the following and I'm able to select MapFeatures but not Markers representing search results that are an array of MKMapItem. When tapping the Markers, they are not selected and instead the Map simply zooms in closer to the Marker. @State private var selection: MapSelection? Is there something additional that needs to be specified for the Map to allow the MapFeatures and Markers to be selected?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
Comment on SwiftUI MapKit Map - Selecting Points of Interest
I was finally able to get it to work in the following case: @State private var selectedItem: MKMapItem? @State private var selected: Feature? Map(position: $position, selection: $selectedFeature) { } .mapFeatureSelectionDisabled { _ in false } .mapFeatureSelectionContent { item in Marker(item.title ?? "", coordinate: item.coordinate) } I had previously passed selectedItem to the selection parameter. Is it possible to allow selection of MKMapItems and MapFeatures?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
Comment on Question about .presentationDetents and interactiveDismissDisabled modifiers
The .presentationBackgroundInteraction modifier does provide the functionality I was looking for, although unlike the documentation example. .presentationDetents([.height(120), .medium, .large]) .presentationBackgroundInteraction(.enabled(upThrough: .height(120))) I found this worked for my scenario: presentationBackgroundInteraction(.enabled) Thanks for following up!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’24