Xcode — Sharing files between targets
<p>I'm building an iOS 10 project with 2 targets: Main app and a Keyboard Extension.</p>

<p>I have around 700 images, and each target must access them.</p>

<p>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.</p>

<p>But 50% of them are duplicates. There must be a way of avoiding this by making the keyboard extension target either:</p>

<ol>
<li>Reuse the 700 files of the main app, or;</li>
<li>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.</li>
</ol>

<p>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.</p>

<p>Any ideas?</p>