-
对iOS入门非常有帮助,讲得非常仔细,非常感谢。查看全部
-
实现更新天气信息的函数查看全部
-
建立完桥接文件之后,要在Build Setting中设置桥接文件路径查看全部
-
Swift使用OC组件,建立桥接文件查看全部
-
https://github.com/JakeLin/SwiftWeather查看全部
-
输入 'AFNetworking' 后要按一下esc 在输入:x查看全部
-
Swift Weather APP开源下载地址: https://github.com/JakeLin/SwiftWeather查看全部
-
cocoaPods 官网: cocoapods.org查看全部
-
第一个参数不用参数名查看全部
-
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)})查看全部
-
根据swift 1.2的标准, jsonResult["main"]?["temp"]?当函数检索到["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 { } }查看全部
-
发现好多同学无法编译代码,原因是在新版的Swift 1.2以上版本明确要求了CLLocation 这个类型不可以是可选型,所以在这里需要对location这个变量使用!进行解包,大家注意一下,方法如下: var location:CLLocation = locations[locations.count - 1] as! CLLocation 这样就不会抱错了,大家加油!查看全部
-
Github 地址查看全部
-
建立搭桥查看全部
-
swift调用oc组件查看全部
举报
0/150
提交
取消