I'm building an iOS 10 project with 2 targets: Main app and a Keyboard Extension.
I have around 700 images, and each target must access them.
If I simply add 700 images to Xcode and make them available to the 2 targets, the "Copy Bundle Resources" phase simply copies 700 images to 2 targets, making the compiled app contains 1,400 images.
But 50% of them are duplicates. There must be a way of avoiding this by making the keyboard extension target either:
- Reuse the 700 files of the main app, or;
- Copy them into the target, but only when the target is launched for the first time on the user's device (e.g., the user added the keyboard extension, opened it and is now waiting a few seconds for the images to copy. On the next launch, the keyboard will use its already-copied images, without the user having to wait again). This way the app will still contain 1,400 images (eventually) but at least the download size from the App Store will be for 700 images.
I am planning to update these images from time to time, so the targets' images should be updated too when a new version is present.
Any ideas?