Sha256: 37d3c2c5d7e83e5a3ace2d5094699a61b506d2ff7dff5b1b1686033faba39610

Contents?: true

Size: 1.68 KB

Versions: 7

Compression:

Stored size: 1.68 KB

Contents

# TUSafariActivity

[![Version](https://img.shields.io/cocoapods/v/TUSafariActivity.svg?style=flat)](http://cocoadocs.org/docsets/TUSafariActivity)
[![License](https://img.shields.io/cocoapods/l/TUSafariActivity.svg?style=flat)](http://cocoadocs.org/docsets/TUSafariActivity)
[![Platform](https://img.shields.io/cocoapods/p/TUSafariActivity.svg?style=flat)](http://cocoadocs.org/docsets/TUSafariActivity)

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

![TUSafariActivity screenshot](http://cl.ly/image/2i0n0H3f2g1X/TUSafariActivity.png "TUSafariActivity screenshot")

## Installation

### CocoaPods

TUSafariActivity is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

    pod 'TUSafariActivity', '~> 1.0'

## Usage

*(See example Xcode project)*

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

### Objective-C

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

### Swift

```swift
let URL = NSURL(string: "http://google.com")!
let activity = TUSafariActivity()
let activityViewController = UIActivityViewController(activityItems: [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.

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
xcmultilingual-0.1.6 DemoApp/Pods/TUSafariActivity/README.md
xcmultilingual-0.1.5 DemoApp/Pods/TUSafariActivity/README.md
xcmultilingual-0.1.4 DemoApp/Pods/TUSafariActivity/README.md
xcmultilingual-0.1.3 DemoApp/Pods/TUSafariActivity/README.md
xcmultilingual-0.1.2 DemoApp/Pods/TUSafariActivity/README.md
xcmultilingual-0.1.1 DemoApp/Pods/TUSafariActivity/README.md
xcmultilingual-0.1.0 DemoApp/Pods/TUSafariActivity/README.md