In mapKit frame work, how to get current user location
Answer / Dharmendra Kumar Singh
To get the current user's location in MapKit, you can use CLLocationManager. Here is a simple example:nn```swiftnimport MapKitnnclass ViewController: UIViewController {n let locationManager = CLLocationManager()nn override func viewDidLoad() {n super.viewDidLoad()nn locationManager.requestWhenInUseAuthorization()nn locationManager.delegate = selfnn if CLLocationManager.locationServicesEnabled() {n locationManager.startUpdatingLocation()n }n}n}n```nnYou should also adhere to the CLLocationManagerDelegate protocol and implement required methods such as locationManager(_:didUpdateLocations:) and locationManager(_:didFailWithError:).
| Is This Answer Correct ? | 0 Yes | 0 No |
Enlist frameworks for cocoa?
Can viewdidload be called multiple times?
What are the ios devices?
Which language is used in ios?
Explain difference between coredata & sqlite?
What is the biggest change with ios 7?
What is urlsession?
What are all the difference between iOS3, iOS4 and iOS5?
Whats the difference between frame and bounds?
what are fetched properties?
What is a serial queue?
Explain the difference between copy and retain?