I am able to successfully look up an image from the ALAssetsLibrary and use the UIImage in native views.
Is it possible to use that same asset's url (for example: assets-library://asset/asset.JPG?id=88AA03C4-E53F-4FE2-9752-9DA675D1FAF7&ext=JPG
) in a UIWevView as the source for an img tag?
<img src="<the asset>">
You can't use this URL from a UIWebView as the URL scheme assets-library:// is only understood by classes from AVFoundation(AVAsset) and AssetsLibrary. To display images from the AssetsLibrary in a UIWebView, the following 2 approaches should work:
1) Implement a small webserver in your application and let it serve the images from AssetsLibrary. So in your UIWebView, you would reference these images like that The webserver would then generate a dynamic response returning the image data from AssetsLibrary for the asset with the specified ID.
2) Another approach would be to generate the webPages completely in your cocoa code and then set the content of the UIWebView using the loadHTMLString:baseURL:
method. In the generated HTML code, you would then embed the images from assets-library as Base64-Images/Data-URIs (see here for further reference: Embedding Base64 Images)
Which method works best for you depends on the concrete scenario.