Loading images from assets folder from a bundle

Two things to check.

1) make sure your assets bundle has an Info.plist with a bundle identifier set in it. From your screenshot it doesn't look like this is the case.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleIdentifier</key>
    <string>MyBundle</string>
</dict>
</plist>

2) Make sure your bundle has a compiled assets catalog in it. Should be named Assets.car. I don't think Xcode will just compile an Assets.xcassets folder inside a resource bundle (the bundle is effectively opaque to Xcode; likewise it wouldn't compile any .m source files you put in there). You may need a custom build step to copy the compiled Assets.car file into your assets bundle before the assets bundle is copied into the app bundle.

You can check these by finding your app bundle and right clicking on it then "Show Package Contents", then again on the contained bundle.

Manual assets compilation command:

xcrun actool Images.xcassets --compile . --platform iphoneos --minimum-deployment-target 9.0

Tags:

Ios

Swift

Swift3