mercredi 3 juin 2015

IOS Download Images From AWS S3

I am currently uploading images from an IOS app to AWS S3.

In order to display images uploaded to S3 i use the methods of the docs

// Construct the NSURL for the download location.
NSString *downloadingFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"downloaded-myImage.jpg"];
NSURL *downloadingFileURL = [NSURL fileURLWithPath:downloadingFilePath];

// Construct the download request.
AWSS3TransferManagerDownloadRequest *downloadRequest = [AWSS3TransferManagerDownloadRequest new];

downloadRequest.bucket = @"myBucket";
downloadRequest.key = @"myImage.jpg";
downloadRequest.downloadingFileURL = downloadingFileURL;

And then to download the image with the method

[[transferManager download:downloadRequest] continueWithExecutor:[BFExecutor mainThreadExecutor]
                                                   withBlock:^id(BFTask *task)

I am concerned about the download location : could there be memory issues if too many images are downloaded?

If someone has already been using this framework, are there any caching capabilities to set manually? Is there any advantage of using a framework like SDWebImage to display images?




Aucun commentaire:

Enregistrer un commentaire