I'm trying to create two applications from same codebase. These application will have same functionality but different logos, app name etc. I have created two targets with different bundle Ids so now I get unique apps when running each target.In my app, I have a viewcontroller with an UIImageView. Now I want to assign an image to UIImageView based on the running target. So I created two assets folders.
- Target1 -> Assest1 -> logo.png
- Target2 -> Assest2 -> logo.png
logo.png is different file with same name.
How can I assign the correct logo.png to uiimageview based on the running target? Your help is appreciated.
Ensure that your asset is in the correct target an then use the following method:
To obtain your bundle you could use your class to refer to your bundle: