AsyncMessagesViewController icon indicating copy to clipboard operation
AsyncMessagesViewController copied to clipboard

Load images from framework bundle

Open qtdzz opened this issue 7 years ago • 3 comments

This PR fixes the issue when using this FW in another project, the images can't be loaded

qtdzz avatar Apr 02 '18 14:04 qtdzz

This won't work because xcassets bundles cannot be accessed from a resource bundle. They need to be included in the 'resources' tag (instead of 'resources_bundles') in the podspec.

After that, you can access them via the framework bundle.

ghost avatar Jul 19 '18 09:07 ghost

For anyone looking for a simple workaround, copying the pod's xcassets into your local project works for now.

ghost avatar Jul 19 '18 09:07 ghost

This won't work because xcassets bundles cannot be accessed from a resource bundle. They need to be included in the 'resources' tag (instead of 'resources_bundles') in the podspec. After that, you can access them via the framework bundle.

Hi, thanks for checking it. Could you please elaborate how it doesn't work for you?
I have just moved the example project out of the library and it still seems to work for me https://github.com/qtdzz/ExampleAMVC (I don't know why when they are in the same workspace, it always works regardless the different podspec configurations and image loading)

Apparently, I had tried using resource instead of resource_bundle but it didn't work back then. Now it just works (I have no idea). And when doing this, I also notice that they recommend to use resource_bundle instead of resource, that's why I ended up in this PR (http://guides.cocoapods.org/syntax/podspec.html#resource_bundles)

qtdzz avatar Jul 19 '18 16:07 qtdzz