I gave up trying to intercept requests for individual image files in NSBundle
and switched over to the asset catalog system. The URLForResource
methods in NSBundle
are called and always look for Assets.car, simply returning Assets.car from my own bundle caused my custom images to be loaded. This works for [UIImage imagedNamed:]
as well as loading from nibs.
For completeness sake, to generate an asset catalog you need to use actool
located in XCode.app. I used actool
for the simulator and copied the command from the build log (this catalog also worked on my iPhone 5S...):
actool --platform iphonesimulator --minimum-deployment-target 7.0 --target-device iphone --compress-pngs --compile [path_to_output_bundle] [path_to_xcassets]
Both of the paths have to been absolute paths otherwise actool
fails.