import UIKit import MapKit import CoreLocation
class secondViewController: UIViewController, CLLocationManagerDelegate, MKMapViewDelegate {
@IBOutlet var mapview: MKMapView!
// var locationmanager = CLLocationManager ()
* 1007/ * 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()
/* mapview.mapType = MKMapType.standard
locationmanager.delegate = self
locationmanager.desiredAccuracy = kCLLocationAccuracyBest
locationmanager.requestWhenInUseAuthorization()
/* isAuthorizedtoGetUserLocation()
if CLLocationManager.locationServicesEnabled() {
locationmanager.delegate = self
locationmanager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
}*/
locationmanager.startUpdatingLocation()*/