https://github.com/simplisticated/baggage
Simplifying work with clipboard in iOS.
https://github.com/simplisticated/baggage
Last synced: 11 months ago
JSON representation
Simplifying work with clipboard in iOS.
- Host: GitHub
- URL: https://github.com/simplisticated/baggage
- Owner: simplisticated
- License: mit
- Created: 2016-01-24T21:04:38.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-10-29T20:57:48.000Z (over 8 years ago)
- Last Synced: 2025-05-08T17:03:32.079Z (11 months ago)
- Language: Ruby
- Size: 258 KB
- Stars: 14
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Baggage
The main purpose of `Baggage` is to simplify work with clipboard. The library is absolutely compatible with standard `UIPasteboard` class.
## How To Get Started
- Copy content of `Baggage` folder to your project.
or
- Use `Baggage` cocoapod
## Requirements
* iOS 9 and later
* Xcode 9 and later
## Usage
### String
Copy string to clipboard:
```swift
let str = "Some text"
str.bg.copy()
```
Get string from clipboard:
```swift
let str = String.bg.fromClipboard
NSLog(str) // Some text
```
### UITextField
Copy text to clipboard:
```swift
let textField = UITextField()
textField.text = "Some text"
textField.bg.copy()
```
Paste text from clipboard:
```swift
textField.bg.paste()
NSLog(textField.text!) // Some text
```
### UITextView
Copy text to clipboard:
```swift
let textView = UITextView()
textView.text = "Some text"
textView.bg.copy()
```
Paste text from clipboard:
```swift
textView.bg.paste()
NSLog(textView.text) // Some text
```
## License
`Baggage` is available under the MIT license. See the `LICENSE` file for more info.