{"id":18622756,"url":"https://github.com/timonus/tjactivityviewcontroller","last_synced_at":"2025-10-17T12:55:35.605Z","repository":{"id":56922860,"uuid":"143028989","full_name":"timonus/TJActivityViewController","owner":"timonus","description":"Simple customization for the iOS share sheet.","archived":false,"fork":false,"pushed_at":"2025-01-30T03:59:21.000Z","size":69,"stargazers_count":54,"open_issues_count":1,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-02T18:56:13.597Z","etag":null,"topics":["ios","ios-share","ios-sheet","uiactivity","uiactivityviewcontroller","uikit"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timonus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-31T14:54:33.000Z","updated_at":"2025-01-30T03:59:24.000Z","dependencies_parsed_at":"2024-09-06T09:22:29.637Z","dependency_job_id":"2a36f524-bf02-44db-944c-1d3ae90bf742","html_url":"https://github.com/timonus/TJActivityViewController","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJActivityViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJActivityViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJActivityViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJActivityViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timonus","download_url":"https://codeload.github.com/timonus/TJActivityViewController/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253181418,"owners_count":21866991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","ios-share","ios-sheet","uiactivity","uiactivityviewcontroller","uikit"],"created_at":"2024-11-07T04:18:31.848Z","updated_at":"2025-10-17T12:55:35.500Z","avatar_url":"https://github.com/timonus.png","language":"Objective-C","readme":"# TJActivityViewController\n\n`TJActivityViewController` is a handy subclass of [`UIActivityViewController`](https://developer.apple.com/documentation/uikit/uiactivityviewcontroller?language=objc) that allows you to override actions easily without implementing [`UIActivityItemSource`](https://developer.apple.com/documentation/uikit/uiactivityitemsource?language=objc).\n\n## Usage\n\nYou can override a particular activity or one matching a regex with a block using the following methods:\n\n```objc\nUIImage *imageToShare = /* ... */;\nTJActivityViewController *viewController = [[TJActivityViewController alloc] initWithActivityItems:@[imageToShare] applicationActivities:nil];\n\n// Override Twitter sharing with a block.\n[viewController overrideActivityType:UIActivityTypePostToTwitter withBlock:^{\n    // Launch a custom Twitter share action.\n}];\n\n// Override actions matching a regex.\n[viewController overrideActivityTypeMatchingRegex:@\"com\\\\.foo\\\\.bar\\\\..*\" withBlock:^{\n    // Custom sharing actions.\n}];\n```\n\nYou can also override the item that's passed to a particular activity with a block using the following method:\n\n```objc\n// TJActivityViewControllerSnapchatActivityType and a few others are provided for convenience\n[viewController overrideItemForActivityType:TJActivityViewControllerSnapchatActivityType // Snapchat's share extension\t\n                                  withBlock:^id {\n\treturn /* a 9:16 image cropped just for Snapchat. */;\n}];\n```\n\nIn iOS 13 and above, you can set the [link preview](https://developer.apple.com/videos/play/wwdc2019/262/?t=301) on an instance of `TJActivityViewController` using the `linkMetadata` property.\n\n```objc\nLPLinkMetadata *linkMetadata = [LPLinkMetadata new];\nlinkMetadata.title = @\"My Cool Link\";\nlinkMetadata.imageProvider = /* an image provider for your link preview */;\nactivityViewController.linkMetadata = linkMetadata;\n```\n\n## Why\n\nWhile `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.\n\nSome 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.\n\nFor a more detailed blog post on the subject, see [here](https://medium.com/p/f24410308699).\n\n## About\n\nI originally wrote `TJActivityViewController` for [Close-up](https://closeup.wtf) and have since also used it in [Burst](http://theburstapp.com). If you decide to use `TJActivityViewController` [let me know](https://twitter.com/timonus)!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonus%2Ftjactivityviewcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimonus%2Ftjactivityviewcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonus%2Ftjactivityviewcontroller/lists"}