Skip to main content

Posts

Showing posts with the label iOS MapKit Tutorial

app-ads.txt

 google.com, pub-2203413632152319, DIRECT, f08c47fec0942fa0

iOS MapKit Tutorial: Getting Started Search Location and Directions on Mapkit

MapKit  is a really useful API available on iOS devices that makes it easy to display maps, user locations with locality, and even draw routes your location to your destination. Getting Started User Location Create a new project single view appplication in Swift. - MKLocationMap Open Info.plist from the Project navigator and configure the location permission prompt message  NSLocationWhenInUseUsageDescription Add "NSLocationAlwaysAndWhenInUseUsageDescription" instead of "Privacy - Location Always and When in use usage description". ViewController.swift: import UIKit import MapKit protocol HandleMapSearch {     func dropPinZoomIn(placemark: MKPlacemark ) } class ViewController: UIViewController {     let locationManager = CLLocationManager ()     var resultSearchController: UISearchController !     var selectedPin: MKPlacemark ?    ...