Skip to content

Displaying sheet on tap / like .sheet #76

Answered by lucaszischka
haIIux asked this question in Q&A
Discussion options

You must be logged in to vote

Nevertheless, because today I had the time here is some sample code. For anyone reading this: This is the only time im going to provide basic SwiftUI support, because I think this is an often asked question and the solution isn't that easy.

You will need the following code for your map:

internal struct MapView: UIViewRepresentable {
    
    @Binding internal var mapView: MKMapView
    @Binding internal var annotations: [MKPointAnnotation]
    
    internal let didSelectAction: (MKAnnotationView) -> Void
    internal let didDeselectAction: (MKAnnotationView) -> Void
    
    
    internal func makeCoordinator() -> MapCoordinator {
        MapCoordinator(self)
    }
    
    internal func

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by lucaszischka
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #36 on June 26, 2022 20:32.