Skip to content

Latest commit

 

History

History
65 lines (40 loc) · 2.3 KB

README.md

File metadata and controls

65 lines (40 loc) · 2.3 KB

DLCustomActivity

CI Status Version License Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

DLCustomActivity is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DLCustomActivity"

Sample Code

Import DLCustomActivity

#import <DLCustomActivity/DLCustomActivity.h>

For Action Activity

DLActionActivity *actionActivity = [[DLActionActivity alloc] initWithActivityTitle:@"Action Title" activityImageName:@"Icon"];
actionActivity.canPerformActivityBlock = ^(DLCustomActivity *activity,NSArray *activityItems){
    return YES;
};
actionActivity.performActivityBlock = ^(DLCustomActivity *activity,NSArray *activityItems){
    return YES;
};

For Share Activity

DLShareActivity *shareActivity = [[DLShareActivity alloc] initWithActivityTitle:@"Share Title" activityImageName:@"Icon"];
shareActivity.canPerformActivityBlock = ^(DLCustomActivity *activity,NSArray *activityItems){
    return YES;
};
shareActivity.performActivityBlock = ^(DLCustomActivity *activity,NSArray *activityItems){
    return YES;
};

Present UIActivityViewController

NSString *text = @"Share Text";
NSURL *url = [NSURL URLWithString:@"http://www.example.com"];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[text,url] applicationActivities:@[actionActivity,shareActivity]];
[self presentViewController:activityViewController animated:YES completion:NULL];

Author

Darcy Liu, Email

License

DLCustomActivity is available under the MIT license. See the LICENSE file for more info.