I am not too sure why I am getting this error. Is there something I am not checking for in terms of an optional value or some sort of option that I am missing
func getJSON(){
let url = NSURL(string: myURL)
let request = NSURLRequest(url: url! as URL)
let session = URLSession(configuration: URLSessionConfiguration.default)
let task = session.dataTask(with: request as URLRequest) { (data,response,error) -> Void in
if error == nil {
let swiftyJSON = JSON(data:data!)
let theTitle = swiftyJSON["results"].arrayValue
for title in theTitle{
let titles = title["title"].stringValue
print(titles)
}
} else{
print("Error")
}
}
task.resume()
}