Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morishin/copylinkactivity
UIActivity subclass for copying link URL to pasteboard
https://github.com/morishin/copylinkactivity
ios swift
Last synced: 23 days ago
JSON representation
UIActivity subclass for copying link URL to pasteboard
- Host: GitHub
- URL: https://github.com/morishin/copylinkactivity
- Owner: morishin
- Created: 2017-12-01T04:11:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-11T14:50:00.000Z (over 5 years ago)
- Last Synced: 2024-10-06T00:02:17.169Z (about 1 month ago)
- Topics: ios, swift
- Language: Swift
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CopyLinkActivity
![Swift version](https://img.shields.io/badge/swift-4.0-orange.svg)
![CocoaPods compatible](https://cocoapod-badges.herokuapp.com/v/CopyLinkActivity/badge.png)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)UIActivity subclass for copying link URL to pasteboard
## Usage
[Example](https://github.com/morishin/CopyLinkActivity/tree/master/Example)
```swift
import UIKit
import CopyLinkActivityclass ViewController: UIViewController {
@IBAction func didTapShareButton(_ sender: UIButton) {
let linkURL = URL(string: "https://www.apple.com/")!
let activityViewController = UIActivityViewController(activityItems: [linkURL], applicationActivities: [CopyLinkActivity()])
activityViewController.completionWithItemsHandler = { [weak self] (activityType, completed, _, _) -> Void in
if completed && activityType == CopyLinkActivity.defaultActivityType {
let alert = UIAlertController(title: "Copied", message: linkURL.absoluteString, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
self?.present(alert, animated: true)
}
}
present(activityViewController, animated: true)
}
}
```## Installation
### Carthage
Cartfile```
github "morishin/CopyLinkActivity"
```### CocoaPods
Podfile```ruby
pod 'CopyLinkActivity'
```## LICENSE
MIT