Tom

iOS Developer

20th March 2012

Mac framework headers and Xcode

Guides | Tutorial By 3 years ago

When developing on the Mac and using custom frameworks in your application, when you compile the frameworks are copied into your application’s bundle then linked at runtime. These frameworks will most likely be bundled up with their headers. Some of the frameworks you include may not be things you want to make public to the world, which you are essentially doing by including the headers with the framework.

I have written a small script you can add as a build phase that will remove all .h files from your frameworks after compilation.

#! /bin/bash

# Put this in a 'run script' run phase in xcode
# Delete all framework headers
cd "${BUILD_DIR}/${CONFIGURATION}/${PRODUCT_NAME}.app/Contents/Frameworks"

if [ $? = 0 ]; then
find . -name "*.h" -print0 | xargs -0 rm
fi
Recommended Posts

Developing a public iOS framework, do's and don'ts

Post by 3 years ago

When you build a framework for people to use, you want to make sure it’s as easy to implement as possible. Even if your framework does amazing things, developers will be turned off if it’s

Got an idea?

We help entrepreneurs, organizations and established brands from around
the country bring ideas to life. We would love to hear from you!