ShareKit/ShareKit — pull request #362 by VilemKurz (2012-05-10 10:14:38+00:00)
Title: ShareKit refactored as xcode subproject

fix for #264

Greatest **benefits** are:

1. If there is added new sharer, or added/removed/renamed files, updating is super easy - no need to drag new files to project, or remove them. Only pull changes from github and you go. Compiles with no problems right after pull.
2. Regardless of your project is using ARC or not, you can use (non ARC) ShareKit subproject right from the box.
3. We can now migrate ShareKit to ARC, as ARC enabled subprojects are possible to use from non ARC projects. However, I would wait with this after we drop iOS 4 support, so that we can use weak references.
4. This enables us to get rid of sharekit.bundle - the reasons are summarised [here](http://www.cocoanetics.com/2012/05/resource-bundles/). This will be the next step.

**caveats**:

1. If someone does not want to compile all of the sharers (previously remove them from his project) now needs to change subproject - this means to change ShareKit - problems while updating. Would not recommend after merging. Just compile all, always.
2. As bundle was changed in SHK.m there is no backwards compatibility. Everyone will have to use subproject approach (which I consider to be a much better solution than current).
3. If someone already uses some classes (reachability, objectiveflickr, OAuthConsumer, etc) should remove them from his project rather than from shareKit, reason is the same than in 1. @Coocoanetics suggests to add new target to the subproject without 3rd party code. One would need to add manually all 3rd party files to project ... I am not sure if to do this, as this might open up a flood of issues in tracker, on the other side it might help some. Is the benefit worth added complexity? Opinions?

**install guide** (hope it is clear enough, without pictures):

Download the files using git as now. Then

1. Add ShareKit as subproject to your project: move ShareKit.xcodeproj file from Finder to your project navigator in Xcode
2. Add ShareKit's targets as depenedencies to your project's build phase: your project's app target - build phases - target dependencies add 2 new targets from ShareKit subproject: "Static Library" and "Resource Bundle"
3. Add ShareKit's "libShareKit.a" to your project's Link Binary With Libraries build phase
4. Add ShareKit's "Resource Bundle" to your project's Copy Bundle Resources build phase: expand shareKit subproject - expand products - move "ShareKit.bundle" to Copy Bundle Resources build phase in your project's target
5. change your project's app target build settings:
- User header search paths: set it RECURSIVELY to the directory where you put submodules in. If you followed our install wiki, it should be Submodules/
- Other Linker Flags: -ObjC -all_load

some **more info about Xcode subprojects**:

[Cocanetics blog] (http://www.cocoanetics.com/2011/12/sub-projects-in-xcode/)
[Jayway blog] (http://blog.jayway.com/2011/05/16/the-state-of-ios-open-source-and-what-to-do-about-it/)