码迷,mamicode.com
首页 > 编程语言 > 详细

SwiftHTTP request.GET中如何return true or false

时间:2014-11-11 16:12:51      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:http   io   ar   sp   for   div   on   html   as   

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

标签:http   io   ar   sp   for   div   on   html   as   

原文地址:http://www.cnblogs.com/xiguain/p/4089587.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!