0

how to authenticate the json method in swift?

var error: NSError?
let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers , error: &error) as NSDictionary
Ian
  • 30,182
  • 19
  • 69
  • 107

1 Answers1

0

Try this code,

do {
       let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers , error: &error) as NSDictionary

   } 
catch 
{
     print("error")
}

hope its helpful

Iyyappan Ravi
  • 3,205
  • 2
  • 16
  • 30