Latest 0.0.1
License BSD 3-Clause License
Platforms ios 8.0, requires ARC
Frameworks Foundation, UIKit

TJActivityViewController is a handy subclass of UIActivityViewController that allows you to override actions easily without implementing UIActivityItemSource.


You can override a particular activity or one matching a regex with a block using the following methods:

UIImage *imageToShare = /* ... */;
TJActivityViewController *viewController = [[TJActivityViewController alloc] initWithActivityItems:@[imageToShare] applicationActivities:nil];

// Override Facebook sharing with a block.
[viewController overrideActivityType:UIActivityTypePostToTwitter withBlock:^{
    // Launch a custom Twitter share action.

// Override actions matching a regex.
[viewController overrideActivityTypeMatchingRegex:@"com\.foo\.bar\..*" withBlock:^{
    // Custom sharing actions.

You can also override the item that’s passed to a particular activity with a block using the following method:

[viewController overrideItemForActivityType:@"com.toyopagroup.picaboo.share" // Snapchat's share extension  
                                  withBlock:^id {
    return /* a 9:16 image cropped just for Snapchat. */;


While UIActivityItemSource is a powerful API for sharing through UIActivityViewController, it’s a bit cumbersome to use and has limitations when it comes to overriding actions. Many products now have custom sharing SDKs that are more powerful than their built-in share extensions, but developers who use UIActivityViewController are forced into using the less powerful share extensions.

Some developers have taken to building their own bespoke sharing menus to work around this limitation of UIActivityViewController, but that leads to fragmented and incomplete sharing experiences across products. TJActivityViewController gives you the best of both worlds: you get to use the standard iOS share menu, and can still customize sharing options with your own special touches.

For a more detailed blog post on the subject, see here.


I originally wrote TJActivityViewController for Close-up and have since also used it in Burst. If you decide to use TJActivityViewController let me know!

Latest podspec

    "name": "TJActivityViewController",
    "version": "0.0.1",
    "summary": "TJActivityViewController is a handy subclass of UIActivityViewController for simple customization for the iOS share sheet.",
    "homepage": "",
    "license": {
        "type": "BSD 3-Clause License",
        "file": "LICENSE"
    "authors": {
        "Tim Johnsen": ""
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "0.0.1"
    "source_files": "*.{h,m}",
    "public_header_files": "*.h",
    "frameworks": [
    "requires_arc": true

Pin It on Pinterest

Share This