私はamazonS3バケットに画像をアップロードしました。指定したユーザーのプロフィール画像をダウンロードしようとしています。 Xcodeは、URLタイプhttpがサポートされていないため、ファイルを開くことができないと言います。何か見落としていますか?Xcode - URLタイプhttpがサポートされていないため、開けませんでした
func retrieveProPic(proPicString: String, userID: String){
let downloadRequest = AWSS3TransferManagerDownloadRequest()
downloadRequest.bucket = "profilepicturetest1"
downloadRequest.key = userID
let proPicURL = NSURL(string: proPicString)
if let picURL = proPicURL {
downloadRequest.downloadingFileURL = picURL
}
let transferManager = AWSS3TransferManager.defaultS3TransferManager()
transferManager.download(downloadRequest).continueWithBlock { (task) -> AnyObject? in
if let error = task.error {
print("Failed to download because of (\(error))")
}
if task.result != nil {
if let data = NSData(contentsOfURL: downloadRequest.downloadingFileURL)
{
self.proPicImage = UIImage(data: data)
dispatch_async(dispatch_get_main_queue()){
self.tableView.reloadData()
}
}
print("made it to have result")
} else {
print ("Unexpected empty result")
}
return nil
}
}
HTTPのiOS 9のトランスポート層セキュリティ –