是否有Apple框架捆绑包来检测是否存在互联网连接?目前我的应用程序在尝试在没有互联网连接的情况下对用户的位置进行地理定位时崩溃.
/*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)
Run Code Online (Sandbox Code Playgroud)
我对swift和ios编程有点新鲜 - 我的道歉.