My Code is as below.This code does not work. But the services with https protocol works..Pls help
override func viewDidLoad() {
super.viewDidLoad()
let urlPath = "http://xx.com"
let reposURL: NSURL = NSURL(string: urlPath)!
let URLrequest: NSURLRequest = NSURLRequest(URL: reposURL)
let response: AutoreleasingUnsafeMutablePointer<NSURLResponse?>=nil
// 2
do{
if let JSONData: NSData = try NSURLConnection.sendSynchronousRequest(URLrequest, returningResponse: response){
//if let JSONData = NSData(contentsOfURL: reposURL!) {
// 3
if let json = try NSJSONSerialization.JSONObjectWithData(JSONData, options: NSJSONReadingOptions.MutableContainers) as? NSDictionary {
// 4
if let reposArray = json["items"] as? [NSDictionary] {
// 5
for item in reposArray {
}
}
}
}
}catch{}
}