segmentio/analytics-ios — pull request #90 by tedjt (2014-02-14 11:25:21+00:00)
Title: bundle resources in framework

Hey peter, here is a cl of the changes to bundling resources into the framework. Also a summary of what it does.

1. Create a new resource bundle build target.
2. Update the framework build script to

2.1 copy the resources in step (1) to the resources folder of the framework
2.2 copy the original source resources (from mixpanel or elsewhere) to the resources folder

Note I had to change a few other cocoapod dependencies to get it running on my machine and in the process updated a few. Feel free to roll those back. The bulk of the change is in the project.pbxproj and the new resources bundle.

I also explored the option of having a category in the prefix-pch for Analytics, but that wouldn't work for resources referenced from the storyboard. Honestly you could remove the resource bundle target and linking since it will only be useful if you update a mixpanel fork to resolve files from the bundle. I think the best approach would be keeping things in line with how mixpanel intended resources to be included -> in the main bundle. In that case you'll just have the update to the framework build script that copies the raw files over to the resource folder in the framework.

For cocoapods you'll need to update it to look like the [Google maps one](https://github.com/CocoaPods/Specs/commit/26a38046f61e94f96a3904b5f07e47878747f1cd)
```ruby
s.source = { :http => 'https://s3path', :flatten => true }
framework_path = 'Analytics.framework'
s.source_files = "#{framework_path}/Versions/A/Headers/*.h"
s.resources = ["#{framework_path}/Versions/A/Resources/*"]
s.frameworks = 'Analytics', ....All other frameworks
# this last line may not be necessary - s.frameworks normally take care of it, but I've seen it be buggy.
s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Analytics"' }
```