CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

Baggage 4.0

Baggage 4.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Igor Matyushkin.




Baggage

At a Glance

Baggage is a set of extensions for iOS SDK that simplify work with clipboard. Absolutely compatible with standard UIPasteboard class.

How To Get Started

  • Copy content of Baggage folder to your project.

or

  • Use Baggage cocoapod

Note: For Swift 2.x use Baggage v1.0. For Swift 3.0 use Baggage v3.0.

Requirements

  • iOS 9.0 and later
  • Xcode 8 and later

Usage

String

Copy string to clipboard:

let str = "Some text"
str.bg_copyToClipboard()

Get string from clipboard:

let str = String.bg_stringFromClipboard()
NSLog(str) // Some text

UITextField

Copy text to clipboard:

let textField = UITextField()
textField.text = "Some text"
textField.bg_copyTextToClipboard()

Paste text from clipboard:

textField.bg_pasteTextFromClipboard()
NSLog(textField.text!) // Some text

UITextView

Copy text to clipboard:

let textView = UITextView()
textView.text = "Some text"
textView.bg_copyTextToClipboard()

Paste text from clipboard:

textView.bg_pasteTextFromClipboard()
NSLog(textView.text) // Some text

License

Baggage is available under the MIT license. See the LICENSE file for more info.