So I think I have this kinda clear, based on this blog post and my experiments:
- what's included by
@import MyPod;
is the auto-generatedMyPod-umbrella.h
header, which imports all the public headers according to the Podspec - the auto-generated module map also permits explicit import of those and only those same public headers
- what's included by
#import <MyPod/MyPod.h>
header is aMyPod.h
header that I still need to make, but it can import anything I choose that's in the module map
What I was hoping to achieve, however, was that the header for either @import
or #import
to include most but not all of my pod's public headers. I'd like one of my public headers contain optional declarations that are normally omitted, to only be included manually from the few .m
files that need it. But it seems to not be possible when code uses @import
since the includes in that umbrella header always matches all the public headers.
Specifying a custom module map is possible and would work, but doing that seems to precludes the benefits of auto-generated map & umbrella header.
Would it be kosher to do some macro & #ifdef
tricks to skip the contents of my "optional" header when included by the @import
but then use the contents if that header is pulled in again with an #include
? This sounds ugly, but is it my only option?