-
對iOS入門非常有幫助,講得非常仔細(xì),非常感謝。查看全部
-
實現(xiàn)更新天氣信息的函數(shù)查看全部
-
建立完橋接文件之后,要在Build Setting中設(shè)置橋接文件路徑查看全部
-
Swift使用OC組件,建立橋接文件查看全部
-
https://github.com/JakeLin/SwiftWeather查看全部
-
輸入 'AFNetworking' 后要按一下esc 在輸入:x查看全部
-
Swift Weather APP開源下載地址: https://github.com/JakeLin/SwiftWeather查看全部
-
cocoaPods 官網(wǎng): cocoapods.org查看全部
-
第一個參數(shù)不用參數(shù)名查看全部
-
manager.GET(url, parameters: params, success: { (operation:AFHTTPRequestOperation!, responseObiect: AnyObject!) in println("JSON:" + responseObiect.description!)}, failure: { (operation:AFHTTPRequestOperation!,error:NSError!) in println("Error:"+error.localizedDescription)})查看全部
-
根據(jù)swift 1.2的標(biāo)準(zhǔn), jsonResult["main"]?["temp"]?當(dāng)函數(shù)檢索到["temp"],說明了jsonResult一定有值,所以第二個符號一定要是(!)號,修改如下 func updateUISuccess(jsonResult:NSDictionary!) { if let tempResult = (jsonResult["main"]?["temp"]! as? Double) { var temperature: Double if (jsonResult["sys"]?["country"]! as String == "US") { // Convert temperature to Fahrenheit if use if within the US temperature = round(((tempResult - 273.15) * 1.8) + 32 ) } else { // Otherwise, convert temperature to Celsius temperature = round(tempResult - 273.15) } } else { } }查看全部
-
發(fā)現(xiàn)好多同學(xué)無法編譯代碼,原因是在新版的Swift 1.2以上版本明確要求了CLLocation 這個類型不可以是可選型,所以在這里需要對location這個變量使用!進(jìn)行解包,大家注意一下,方法如下: var location:CLLocation = locations[locations.count - 1] as! CLLocation 這樣就不會抱錯了,大家加油!查看全部
-
Github 地址查看全部
-
建立搭橋查看全部
-
swift調(diào)用oc組件查看全部
舉報
0/150
提交
取消