SwiftHTTP request.GET中如何return true or false

来源: 浏览: 评论:0


var request = HTTPTask()request GET("http: vluxe io", parameters: nil, success: {(

var request = HTTPTask()request.GET("http://vluxe.io", parameters: nil, success: {(response: HTTPResponse) in if response.responseObject != nil { let data = response.responseObject as NSData let str = NSString(data: data, encoding: NSUTF8StringEncoding) println("response: (str)") //prints the HTML of the page // 比如这里我想写个if 然后返回true or false // 但会得到错误 Type ‘Void‘ does not conform to protocol ‘BooleanLiteralConvertible‘ }},failure: {(error: NSError, response: HTTPResponse?) in println("error: (error)")})

SwiftHTTP request.GET中如何return true or false


上一篇:利用js与java交互
下一篇:Java泛型

 站点咨询
 站点推荐