An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          


Baggage






# 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.