I am doing the HTTP request and getting response in my func
. It return the value of response. I am doing it this way:
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue()) {(response, data, error) in
println(NSString(data: data, encoding: NSUTF8StringEncoding))
stringResponse = NSString(data: data, encoding: NSUTF8StringEncoding) as! String
if stringResponse == "0" {
return false
} else if stringResponse == "1" {
return true
} else {
return false
}
}
But on all return
s I have error Unexpected non-void return value in void function
How to fix this?