iphoneiosphotoassetslibrary

Using AssetsLibrary Framework loading images too slow


I am just using AssetsLibrary Framework to load images from Photos.

[UIImage imageWithCGImage:[asset defaultRepresentation].fullScreenImage scale:1.0 orientation:(UIImageOrientation)[asset defaultRepresentation].orientation];

It will take about 0.5~0.6 second to get one photo. And the photo is not that large (for about 700*900).

Am I using the method in a wrong way? And can it be optimized? (I want the photo of this size, do not want the thumbnail)

Many thanks!


Solution

  • you are using the method correctly. An idea to optimize the user-experience:

    => Load the thumbnail image first (best with dispatch_async) - that should be really quick. When this has completed, load the fullscreen image like you did above.

    This is what apple does in the Photo App to provide a smooth user experience.

    Cheers,

    Hendrik