How to drag and move a map on Swift's MapKit

Asked 5 months ago, Updated 5 months ago, 10 views

As the title says, I would like to implement the process of moving the display range by dragging a map that can be done on standard map apps such as iPhone.

I would appreciate it if you could let me know if there are any code links or official API documents for reference.

swift mapkit

2022-09-30 14:09

1 Answers

I don't know how it is made, but
For storyboard,
1) Create projects normally and place MKMapView in view.
2) Add constraints and connect mapView to viewcontroller with @IBOutlet.
3) Describe import MapKit

With these three things alone, you can do all the basic movements such as dragging, zooming in and out with two fingers, and rotating, right?

2022-09-30 14:09

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.