Home

Awesome

ARWebServerActivity

Twitter Version License Platform Analytics

Overview

ARWebServerActivity is a UIActivity subclass that provides an "Share via web server" action to a UIActivityViewController to share files via swisspol/GCDWebServer with Twitter Bootstrap UI.

You can share:

ARWebServerActivity screenshot

Clone the example proyect

To pull the swisspol/GCDWebServer submodule run:

git clone --recursive git@github.com:alexruperez/ARWebServerActivity.git

Requirements

Installation

Add the ARWebServerActivity subfolder to your project. There are no required libraries other than swisspol/GCDWebServer and its requirements.

Usage

(See example Xcode project)

Simply alloc/init an instance of ARWebServerActivity and pass that object into the applicationActivities array when creating a UIActivityViewController.

ARWebServerActivity *webServerActivity = [[ARWebServerActivity alloc] init];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[@"Hello World!", [UIImage imageNamed:@"Example"], [NSURL fileURLWithPath:@"file/path"], [NSURL URLWithString:@"file/url"], [@"data" dataUsingEncoding:NSUTF8StringEncoding], @{@"key": @[@"value1", @"value2"]}, @[@"value1", @"value2"]] applicationActivities:@[webServerActivity]];
[self presentViewController:activityViewController animated:YES completion:nil];

Note that you can include the activity in any UIActivityViewController and it will only be shown to the user if there is a valid object in the activity items.

Customization

To customize this control you can use:

- (instancetype)initWithPort:(NSNumber *)port bonjourName:(NSString *)bonjourName path:(NSString *)path activityViewController:(UIViewController *)activityViewController;

TO-DO (Help needed!)