A subclass of UIActivityViewController which makes sharing content using the native iOS share sheet a breeze.
As of iOS 8.3, you can no longer supply 'body' text to the Facebook activity. See more here. You can still supply a link and an image though.
After adding URBNShareKit to your projects Podfile, import URBNShareKit using the following import line:
#import <URBNShareKit/URBNShareKit.h>
To use URBNShareKit, create an instance of URBNActivityViewController
, and init using the designated initializer initWithDefaultBody:
See the exmaple project for more setup code.
URBNShareKit supports the following activity types:
NSString *const UIActivityTypePostToFacebook;
NSString *const UIActivityTypePostToTwitter;
NSString *const UIActivityTypePostToWeibo;
NSString *const UIActivityTypeMessage;
NSString *const UIActivityTypeMail;
NSString *const UIActivityTypePrint;
NSString *const UIActivityTypeCopyToPasteboard;
NSString *const UIActivityTypeAssignToContact;
NSString *const UIActivityTypeSaveToCameraRoll;
NSString *const UIActivityTypeAddToReadingList;
NSString *const UIActivityTypePostToFlickr;
NSString *const UIActivityTypePostToVimeo;
NSString *const UIActivityTypePostToTencentWeibo;
NSString *const UIActivityTypeAirDrop;
NSString *const kURBNActivityTypePinterest;
Supported UIActivityItemProvider types:
Pass this provider body text to share. You can set different body text for different activity types. See URBNBodyProvider.h for more info on supported body types.
Pass this provider an image that will be shared with supported activity types.
Pass this provider a Url that will be shared with supported activity types.
- iOS 7+
- Note: 3rd party activity types (ie Pinterest) will only work on devices with iOS 8+.
URBNShareKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "URBNShareKit"
URBN Mobile Team, [email protected]
URBNShareKit is available under the MIT license. See the LICENSE file for more info.