There is a KeyboardKit (Swift 3) iOS Framework which I recently decided to separate into two targets KeyboardKit and KeyboardKitAppex. The former will be used within the Application target, the latter within Application Extension target respectively.
To do so, I just duplicated KeyboardKit target, renamed the duppy to KeyboardKitAppex and changed these build settings:
- Require Only App-Extension-Safe API set to Yes;
- Other Swift Flags is set to -D APP_EXTENSION.
Basically, I have copied this setup from mixpanel-swift. However, mixpanel managed to have the same Bundle ID in the build configuration for all targets. It is somehow replaced with unique Bundle ID during the build stage, and I'd like to know, "how?".
In my framework targets, I had to manually edit the Bundle ID to be unique per target. Otherwise, the app cannot be installed on device, complaining about Bundle ID not being unique among embedded bundles.
How to properly separate an iOS Framework into two targets with less hardcoded configuration (specifically, Bundle ID)?
My current Setup is the following:
KeyboardKit
KeyboardKitAppex
...comparing this with mixpanel-siwft setup:
Mixpanel
MixpanelAppex