I am getting a result from my API in the form of a NSArray:
func JSONAPIResults(results: NSArray) {
dispatch_async(dispatch_get_main_queue(), {
self.loginResult = results
})
}
My question is, how do i use a IF Statement in order to check it against a String?
For example, checking if self.loginResult[0]["result"] is equal to "Success"
Cheers
self.loginResult[0]["result"] == "Success"?Cannot invoke '==' with an argument list of type '($T8, StringLiteralConvertible)'if (self.loginResult[0]["result"] as String) == "Success"?Tell me if it works and I'll post an answer.