Я пытаюсь интегрироваться с AWS SDK, но изображение не появляется.Swift - Haneke не работает с AWS SDK
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("MyCollectionViewCell", forIndexPath: indexPath) as! MyCollectionViewCell
let downloadURL = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("myImage.jpg")
let downloadRequest = AWSS3TransferManagerDownloadRequest()
downloadRequest.bucket = "stg"
downloadRequest.key = "myImage.jpg"
downloadRequest.downloadingFileURL = downloadURL
let transferManager = AWSS3TransferManager.defaultS3TransferManager()
transferManager.download(downloadRequest).continueWithBlock { (task) -> AnyObject! in
if task.error != nil {
print("Failed to download S3 with error \(task.error)")
}
if task.result != nil {
//let output = task.result as! AWSS3TransferManagerDownloadOutput
cell.imageView.contentMode = UIViewContentMode.ScaleAspectFit
cell.imageView?.hnk_setImageFromURL(downloadURL)
}
return nil
}
return cell
}
Прошу совета. Спасибо.
Вы можете показать полный код здесь, исходя из моего вопроса. –