ShareKit/ShareKit — pull request #485 by coryalder (2012-08-19 23:59:04+00:00)
Title: Allow tags to be used by multiple sharers, starting with one format.

Since many sharers use different formats for submitting tags to their various servers, for instance comma separated, space separated, comma+space separated, or hash-tagged (twitter), an SHKItem with a tag string like "dogs,cats,moose" will work with some services, but not others.

By changing SHKItem's tags property to an NSArray, we can format these tags at the time of submission in the way preferred by the sharer's API.

I've gone and made a set of changes that makes tagging work this way. This allows me to set tags on my SHKItem and have them be sent to Twitter, as well as to Tumblr. I have not tested it with any of the other sharers modified in this commit, as I do not have use for them nor do I have API keys for them. I did go as far as to look up the correct format for tags in each of their APIs, so theoretically they should work.

There are probably edge-cases I haven't caught here, so merge with caution! I do think ShareKit should move in this direction with tagging, as the current system is pretty broken for most use cases.

Components of this commit:

1. SHKItem's tags property is now an NSArray.
2. Each of the sharers that uses the tags property now joins the array with ", " before presenting it to the use to edit.
3. SHKSharer parses the edited tag string back into an NSArray by a) splitting on "," and b) trimming whitespace.
4. SHKiOS5Twitter merges tags into the body of the tweet in the format " #tag1 #tag2 #tag2", currently if the text/title of the SHKItem is longer than 140 characters, tags will get clipped (as will the text). This could be an optional feature set by the DefaultSHKConfigurator, if flexibility was needed in this behaviour.

Feedback welcome!