How do I use the AppIcon from Assets.xcassets of a resource bundle of a private cocodpod? I want to ignore whats in my apps project file for the AppIcon, and have this asset come from a private pod.
My setup is I have an app with a few different targets for different flavours of the app.
App
FlavourA
FlavourB
The App's pod file pulls in a private pod of mine which contains all of the fonts, assets, colours etc. This private pod is a shared repo which our iOS and Android app shares so that we have everything in one place and to avoid duplication of resources etc.
The podspec for this private pod declares these subspec resources like this:
flaA.resource_bundle = { "STYLES_APP_BUNDLE" => [
"Styles/FlavourA/*.{json}",
"Styles/FlavourA/*.{xcassets,png,jpeg,jpg}",
"Styles/FlavourA/Fonts/*.{ttf,otf,ttc}"
]
}
flaB.resource_bundle = { "STYLES_APP_BUNDLE" => [
"Styles/FlavourB/*.{json}",
"Styles/FlavourB/*.{xcassets,png,jpeg,jpg}",
"Styles/FlavourB/Fonts/*.{ttf,otf,ttc}"
]
}
I declare different subspecs for the different flavours of which my apps Podfile links against the correct subspec depending on the app target. e.g. Project Target FlaA pulls in subspec flaA. Project Target FlaB pulls in subspec flaB. (this works fine)
The private pod has a Assets.xcassets which is added into a resource_bundle (as shown above). In this Assets.xcassets I have AppIcon added with the png assets inside.
The issue I have is that my App project also has a Assets.xcassets which has an "AppIcon" entry but with no images in it. If I remove the entry, the app won't compile. So I think I need the entry at least?
What I want though is when I run pod update (or some sort of automation / build phase) I would like my app's Assets.xcassets AppIcon entry to be populated with the app icons from my private pods resource bundle. (or the generated Assets.car populated with the correct icons)
Is this possible? Has anyone achieved something similar?
Thank you for taking the time to read. Your help much appreciated as I've been stuck on this a while.