是否有苹果框架束来检测是否存在互联网连接?当前,我的应用程序在没有互联网连接的情况下尝试定位用户位置时会崩溃。
/*inside locationManager didUpdateLocations method*/
var currentLocation:CLLocation? = locations[0] as? CLLocation
geocoder = CLGeocoder()
//Crashes on line below when there isn't an internet connection
//Need to add function to check if internet connection is live
//Before running reverseGeocodeLocation
geocoder.reverseGeocodeLocation (currentLocation,handleGeocode)
我对Swift和iOS编程还有点陌生,抱歉。