You need to call
locationManager.requestAlwaysAuthorization()
and
locationManager.requestWhenInUseAuthorization()
use a smooth foreground layout as well.
and you do not need two instances to call startupdatinglocation. keep one. you must use an instance or global variable instead of a local one to get the location over the entire area.
Update:
info.plist like, NSLocationAlwaysUsageDescription NSLocationWhenInUseUsageDescription .