ios - Location service randomly not working -


i have strange issue apple location service. first of code i'm using user location:

import corelocation  @uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate,uisplitviewcontrollerdelegate,cllocationmanagerdelegate {     //core location     let locationmanager = cllocationmanager()      func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool {         // override point customization after application launch.          //core location         // ask authorisation user.         self.locationmanager.requestalwaysauthorization()          //clore location         // use in foreground         self.locationmanager.requestwheninuseauthorization()         if cllocationmanager.locationservicesenabled() {             locationmanager.delegate = self             locationmanager.desiredaccuracy = kcllocationaccuracynearesttenmeters             locationmanager.startupdatinglocation()         }          return true     } 

and info.plist file:

enter image description here

randomly, when launch simulator, app don't location. change simulator device, iphone 6s iphone 6 , fix issue. today i've changed city , i'm having issue in device time. cannot location. have idea can be? bug apple? there solution?

thanks!

edit: added didupdatelocations whole problem method never being called

//core location delegate methods func locationmanager(manager: cllocationmanager, didupdatelocations locations: [cllocation]){      //set coordinates global var     let coordinates : cllocationcoordinate2d = manager.location!.coordinate     locvalue = coordinates      setcoordinatesdetails(coordinates)     if(self.hasbeenlaunched == false){         self.hasbeenlaunched = true         loadcityslugarray()     } } 


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -