Skip to content
unformatt edited this page Feb 2, 2013 · 3 revisions

This is a solution for all of you, who:

  • import ShareKit to your project and start to experience conflicts with files already present in your project. This can happen with ShareKit's submodules or other 3rd party code used in ShareKit.
  • do not want to compile all the sharers, just those you plan to use

How does it work:

There is "Static Library" target in ShareKit's project file, which you can add to your project. This is thoroughly explained in installation guide. Static library target contains all the ShareKit's code together, so you have to build it all, even if you do not want to use all sharers.

The other way is to add granular targets. Just repeat instructions 1. and 2. from step 2 and add only parts of sharekit you wish to use. Instead of adding one huge "Static Library", you just pick which you want and you do not have to change original ShareKit's project file.

For general and straightforward use it is still recommended to use global "Static Library".

For granular use there are mandatory "Static Library Core" + "OAuth", "SSKeyChain", "JSONKit", "Reachability", "Resource Bundle" targets. Of course if you already implemented e.g. "JSONKit", you do not have to do it again, you just do not add "JSONKit" into target dependencies and you can use what you already have in project.

Now the framework is set, and you only need to add which sharers you need. For an example, if you want only Evernote and Delicious, you add optional targets: "Delicious", "Evernote" and "Evernote SDK". Sharers which have own SDK have it in separate target, so that you might use different version of their sdk. The only exception to this is Facebook, which has sdk included in "Facebook" target.

I believe this way we combine the flexibility of adding ShareKit files manually (the old approach) and still enjoy benefits of subproject (the biggest one is flawless update, even if many things change in ShareKit's codebase).

Clone this wiki locally