Created a blank framework in Xcode 6.1 for the Swift language and got this build warning.
warning: PRODUCT_MODULE_NAME may not be overridden for framework target 'MyFramework'
Xcode utilizes a ‘framework’ concept to package up a well-defined collection of code and resources as a single library file for inclusion in a main project. Each framework should represent a separated feature that can individually be tested, built, shared, and reused.
In Xcode, select the first party framework target, then in its Build Phase settings, add the ‘No such module’ to the ‘Links Binary with Libraries’ settings. Note, unlike for a main app target, there is no ‘Embedded Binaries’ settings for a framework target.
A main IOS project can explicitly include, replace, or delete frameworks as required, however a framework you create can depend on other third party frameworks. The first party Authentication framework is dependent on third party frameworks, Auth0 and SimpleKeyChain.
In Xcode, select the framework target, then add the following to the setting path Build Settings -> Search Paths -> Framework Search Paths The $ (BUILD_PRODUCTS_DIR) is a property that resolve to the build output folder, i.e. the derived data folder.
It turns out I had added the build setting "Product Module Name" at the project level and this was overriding the product module name to my new framework. I have 4 targets: a production, a staging, and 2 test targets, and I didn't want to deal with 4 different bridging headers and generated headers for Swift code.
The answer was to explicitly enter a "Product Module Name" build setting for my new framework target using the correct framework name. The alternative would have been to not use a project level build setting and add it as a target level build setting for every target.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With