How to teach Xcode to include all header files in the output of a static library project?

I created a tutorial to create a static library project. Then I dragged my classes and added them to the target.

When I create and run, it creates the libUtils.a file. Once discovered in the Finder, the include folder contains only the header file for the first class, which Xcode automatically creates when the project is created. All other header files are missing.

I checked twice: all added class files are part of the project, and the inspector shows the target membership check mark for the target project.

Is this a bug in Xcode or should I register all the files that I create additionally in another place?

+10
ios xcode static-libraries
source share
2 answers

Xcode automatically adds the build phase to copy the headers to the product catalog. You can add new header files to this build phase:

enter image description here

Update

Instead, you can use the Copy Headers build phase:

Editor> Add Build Stage> Add Header Build Phase.

And the header files will be automatically added to one of the categories when they are added to the project:

enter image description here

Learn more about this build phase and the three categories from the iOS Developer Library .

+10
source share

Xcode 10.2.1

Project editor -> select a target -> Build Phases -> + Add a new Build Phase -> New Header Phase 

enter image description here

The second step is to add the .h files.

 through just added 'Headers' Section //or through 'Project Navigator' -> 'File Inspector' -> 'Target Membership' 
0
source share

All Articles