Computer Science, asked by siddarth9276, 10 months ago

How to use Swift to run in background to provide current location?

Answers

Answered by shejal8
0

Hey mate heres ur answer

get background location in swift we need to go through a few steps

Get the permissions from the user, in your info.plist file add Privacy- Location always and

when in usage Description, Privacy – When in usage description and add their respective description.

After that, you need to import the CoreLocation framework which will enable you to use all the location related libraries and methods. Then you need to get permission from the user to use the location. For that, we need to create a CLLocationManager Object and get authorization.

var locationManager: CLLocationManager?

override func viewDidLoad() {

super.viewDidLoad()

Similar questions