I have this code base that I decided to turn into a framework to reuse in my future apps.
So I went ahead and created an Xcode Project for Cocoa Touch Framework.
To keep things simple (and workspaces out of the picture, at least until I grasp the basics of frameworks), I created a "test-bed" iOS app that embeds/depends on/links to the framework as an additional target to the same project (not a separate project). The idea, of course, is to use this app to test my frameworks capabilities as I add or modify them.
So my project has two targets:
- MyFramework
- MyTestApp
...And of course, two schemes (one to build each):
I am also modifying the code so that it works both on iOS and macOS. Warning: no umbrella header found for target 'MyFramework (macOS)', module map will not be generated.
So far, so good.
Additionally, I am also modifying the code so that it works both on iOS and macOS.
So I added two more targets:
- MyFrameworkMac
- MyTestMacApp
...aslo setup so that the app target-depends, links to, and embeds the framework.
Still, good.
Next, I decided to do some cleanup and file rearranging, to keep things tidy and making sense before the number of files starts to grow further.
Then, the trouble started.
After some trial and error, I discovered a few things:
1) If I change the target name for the iOS Framework and try to build the iOS app, I get the following warning:
/Users/Me/Projects/MyFramework/Code/MyFramework/:1:1: Umbrella header for module 'MyFramework' does not include header 'PublicHeaderXX.h'
...for each of the public header that are included in my master header:
// In this header, you should import all the public headers of your framework
// using statements like #import <MyFramework/PublicHeader.h>
#import <MyFramework/PublicHeader01.h>
#import <MyFramework/PublicHeader02.h>
#import <MyFramework/PublicHeader03.h>
...
2) If I change the product name of the iOS framework in Build Settings, I get the error:
Lexical or Preprocessor Issue | 'MyFramework/MyFramework.h' file not found
...pointing at the location where I import it in the app source code:
#import <MyFramework/MyFramework.h>
for the Mac framework target, I can get away with changing the Target Name, but if I change the product name, I get the warning:
Warning: no umbrella header found for target 'MyFrameworkMacRenamed', module map will not be generated
So I ask...
Is there a way to set the target names and product names I want for each framework target?
I'm sure there must be something somewhere that I should "modify to match" and eliminate some discrepancy, but I'm new to frameworks and can't figure it out ... (What is an 'umbrella header' anyway?)