import UIKit import MapKit import CoreLocation
class secondViewController: UIViewController, CLLocationManagerDelegate, MKMapViewDelegate {
@IBOutlet var mapview: MKMapView!
// var locationmanager = CLLocationManager ()
let locationManager = CLLocationManager()
var currentLocation: CLLocation!
/ * public func locationManager (_ manager: CLLocationManager, didUpdateLocations location: [CLLocation]) {
let location = locations[0]
let span = MKCoordinateSpanMake(0.1, 0.1)
let my = CLLocationCoordinate2DMake(location.coordinate.latitude, location.coordinate.longitude)
print(my)
let region = MKCoordinateRegionMake(my, span)
mapview.setRegion(region, animated: true)
self.mapview.showsUserLocation = true
}*/
override func viewDidLoad() {
super.viewDidLoad()
locationmanager.startUpdatingLocation()*/
hiren source
share