How to get current location from WIFI or Network provider in iOS using swift?

I need to get location from wifi and cellular network for Map. Is it possible ?


Thanks for any help.

Dinesh Kumar

Replies

For a MKMapView, you can turn on user location with the `showsUserLocation` property to display the current user location. The coordinates are delivered to your code via a delegate callback, from which you can either get the coordinates or turn the value into a user-friendly description. Using the location functionality built into MapKit is an easy way to access location data without needing to worry about the underlying details of the source of location data.

Edford!, Thank you so much for your kind response. I'm building a taxi book app (iOS with Swift). One of my requirements is to get a user current location using the wifi address or cellular tower address without using mobile GPS because consumed mobile battery power. Is it possible?

If using the data provided by MapKit doesn't suit your needs, please consult the Core Location article that describes the various levels of Core Location service you can request, and what their power consumption is, and then dive into the specific ones that meet your needs in the related topics section of that article.

Edford!, Thank you for the information.