Skip to content

nxtbgthng/TUSafariActivity

 
 

Repository files navigation

TUSafariActivity

TUSafariActivity is a UIActivity subclass that provides an "Open In Safari" action to a UIActivityViewController.

TUSafariActivity screenshot

Requirements

  • iOS 8.

Installation

CocoaPods

pod 'TUSafariActivity', '~> 1.0.1'

Usage

(See example Xcode project)

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

NSURL *URL = [NSURL URLWithString:@"http://google.com"];
TUSafariActivity *activity = [[TUSafariActivity alloc] init];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[URL] applicationActivities:@[activity]];

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

About

A UIActivity subclass that opens URLs in Safari

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 45.6%
  • Shell 36.9%
  • Ruby 12.4%
  • C 4.6%
  • C++ 0.5%