Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using xcassets images as src for img tag in a UIWebView web page

Xcode 5 introduced the possibility to manage all your images in a single assets file, instead of having a bunch of png variants hanging around.

It works great with IB and Cocoa code, but when I try to reference the pictures from an embedded html, they simply do not show.

So the question is simple: is it possible to reference xcasset images from an embedded html in a UIWebView?

like image 751
KPM Avatar asked Sep 28 '13 23:09

KPM


1 Answers

Apparently if you open the app package, the images get all mixed together in a mysterious binary .car format (with the sole exception of the icon and launch image that are still copied as individual files).

Therefore it doesn't seem possible to reference xcassets images from the html source. You'll have to continue to bundle them separately.

like image 179
KPM Avatar answered Nov 04 '22 00:11

KPM