apptentive/apptentive-osx — pull request #3 by levigroker (2014-08-05 22:49:39+00:00)
Title: OSX Podspec Changes

Creation of an OSX pod spec allowing use of Cocoapods for Mac OS X integration with the Apptentive framework.

There are three main parts to this pull request:

1) Removal of the #include "ATLog.h" in the precompiled header.
2) Explicitly including "ATLog.h" in the .m files which use it.

These two changes allow us to avoid the (discouraged) use of the "prefix_header_contents" podspec configuration.

3) Changes to the ATConnect + (NSBundle *)resourceBundle method which allow the pod spec to create an "ApptentiveResources.bundle" which gets included in the user's app.

This change allows us to use the (recommended) "resource_bundle" podspec configuration to package up Apptentive resources into a bundle, and avoid namespace conflicts with the user's project. The iOS podspec already did this, so it seems appropriate here as well.

The code to find the bundle was re-written to be independent of platform (since bundle paths are handled slightly differently on iOS than OSX), and a new preprocessor directive "AT_RESOURCE_BUNDLE" was introduced.

"AT_RESOURCE_BUNDLE" is defined as an addition to the GCC_PREPROCESSOR_DEFINITIONS build setting in the Mac podspec. It is /not/ defined in the Xcode project. In this way, the user can still choose to not use Cocoapods and the correct code path will be taken to load the bundle.

Many thanks for being receptive to this pull request!

Cheers,

Levi