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:
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
Post a Comment