All Projects → timonus → TJActivityViewController

timonus / TJActivityViewController

Licence: BSD-3-Clause license
Simple customization for the iOS share sheet.

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to TJActivityViewController

curry
curry is a framework built to enhance and compliment Foundation and UIKit.
Stars: ✭ 47 (-7.84%)
Mutual labels:  uikit
STTextView
📝 STTextView is a light-weight library that adds a placeholder to the UITextView.
Stars: ✭ 36 (-29.41%)
Mutual labels:  uikit
ProxySwitcher
Easily enable / disable WiFi proxy on a jailbroken iOS device
Stars: ✭ 55 (+7.84%)
Mutual labels:  uikit
NotificationToast
Google toast the Apple way !
Stars: ✭ 132 (+158.82%)
Mutual labels:  uikit
Zaina-iOS
A UIKit Game.
Stars: ✭ 43 (-15.69%)
Mutual labels:  uikit
iOS14-Resources
A curated collection of iOS 14 projects ranging from SwiftUI to ML, AR etc.
Stars: ✭ 85 (+66.67%)
Mutual labels:  uikit
UIKit-CXX
Simple UIKit application written in C++ using the OBJCXX library.
Stars: ✭ 15 (-70.59%)
Mutual labels:  uikit
LPThumbnailView
A thumbnail view for iOS to give context to multiple images/videos using thumbnails and counter.
Stars: ✭ 54 (+5.88%)
Mutual labels:  uikit
skill6-website-frontend
技术流网站前端工程。网站名称:技术流,英文名:skill6。使用前后端分离架构,前端使用vue、nodejs、bootstrap、emement ui、iview等开源框架实现,主要功能有:登录注册、单点登录、restful设计、文章及评论、资源下载、提问答疑、视频教程等。持续更新中... 地址:
Stars: ✭ 21 (-58.82%)
Mutual labels:  uikit
uikit-sys
Rust Bindings for the iOS UIKit Objective-C framework
Stars: ✭ 35 (-31.37%)
Mutual labels:  uikit
ALButtonMenu
A simple, fully customizable menu solution for iOS.
Stars: ✭ 45 (-11.76%)
Mutual labels:  uikit
awesome-neumorphism
A curated list of awesome Neumorphism resources.
Stars: ✭ 15 (-70.59%)
Mutual labels:  uikit
awesome-flutter-ui
10+ flutter(android, ios) UI design examples ⚡ - login, books, profile, food order, movie streaming, walkthrough, widgets
Stars: ✭ 848 (+1562.75%)
Mutual labels:  uikit
BottomSheet
Access UISheetPresentationController in SwiftUI on iOS 15 using a simple .bottomSheet modifier.
Stars: ✭ 332 (+550.98%)
Mutual labels:  uikit
SwiftUIKit
📱 UIKit code that is fun to write
Stars: ✭ 71 (+39.22%)
Mutual labels:  uikit
KeyboardLayoutGuide
Enables you to set up Auto Layout constraints directly between your views and the iOS keyboard.
Stars: ✭ 55 (+7.84%)
Mutual labels:  uikit
bruno
An enterprise-class package of Flutter components for mobile applications. ( Bruno 是基于一整套设计体系的 Flutter 组件库。)
Stars: ✭ 1,802 (+3433.33%)
Mutual labels:  uikit
DossyTextLabel
A subclass of UILabel reminiscent of Strong Bad's faithful Tandy 400.
Stars: ✭ 75 (+47.06%)
Mutual labels:  uikit
Redux
Manage iOS App state with Redux and Async/Await :)
Stars: ✭ 18 (-64.71%)
Mutual labels:  uikit
LocalConsole
In-app console and debug tools for iOS developers
Stars: ✭ 595 (+1066.67%)
Mutual labels:  uikit

TJActivityViewController

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

Usage

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 Twitter 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:

// TJActivityViewControllerSnapchatActivityType and a few others are provided for convenience
[viewController overrideItemForActivityType:TJActivityViewControllerSnapchatActivityType // Snapchat's share extension	
                                  withBlock:^id {
	return /* a 9:16 image cropped just for Snapchat. */;
}];

In iOS 13 and above, you can set the link preview on an instance of TJActivityViewController using the linkMetadata property.

LPLinkMetadata *linkMetadata = [LPLinkMetadata new];
linkMetadata.title = @"My Cool Link";
linkMetadata.imageProvider = /* an image provider for your link preview */;
activityViewController.linkMetadata = linkMetadata;

Why

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.

About

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].