Latest 0.5
Homepage https://github.com/lm2343635/MGKeyboardAccessory
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform
swift

MGKeyboardAccessory is a keyboard accessory to input special characters in UITextField or UI directly. It allows developers to add the custom button with characters in keyboard accessory, characters in the button will be
inserted to text field if the button is clicked.

MGKeyboardAccessory

Features

  • Support custom characters.
  • Support two styles: defualt and dark.
  • Support UITextField, UITextView and their subclasses.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

MGKeyboardAccessory is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'MGKeyboardAccessory', '~> 0.4'

How to use

Build and import the module:

import MGKeyboardAccessory

It is very simple to add a keyboard accessoray for text field. In our demo, we added a black style accessoray:

blackTextField.setupKeyboardAccessory([":", "/", """], barStyle: .black)

The first parameter is a string array to create custom button, the second parameter is the bar style. Use UIBarStyle provided by UIKit directly.

Reactive extension for RxSwift

MGKeyboardAccessory also supports reactive extension for RxSwift.

Observable.just([":", "/", "?", "&", ".", "="])
    .bind(to: textView.rx.keyboardAccessoryStrings(style: .black)).disposed(by: disposeBag)

Change log

  • v0.1.1

    • Fix the issue about the width of keyboard accessory.
  • v0.2

    • Support to scroll character buttons horizontally.
  • v0.3

    • Support UITextView.
  • v0.3.1

    • Fix the init issue of AccessoryToolbar.
  • 0.3.2

    • Allow UITextView / UITextField subclasses. Thanks for the contribution from Dan2552.
  • 0.4

    • Support Swift 4.
  • 0.5
    • Support Swift 5.0.
    • Support reactive extension for RxSwift.

Author

Meng Li, http://www.fczm.pw, [email protected]

License

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

Latest podspec

{
    "name": "MGKeyboardAccessory",
    "version": "0.5",
    "summary": "A keyboard accessory to input special characters.",
    "description": "MGKeyboardAccessory is a keyboard accessory to input special characters in UITextField or UI directly. It allows developers to add the custom button with characters in keyboard accessory, characters in the button will be inserted to text field if the button is clicked.n# Featuresn- Support custom characters.n- Support two styles: defualt and dark.n- Support both UITextField and UITextView.",
    "homepage": "https://github.com/lm2343635/MGKeyboardAccessory",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Meng Li": "[email protected]"
    },
    "social_media_url": "http://www.fczm.pw",
    "source": {
        "git": "https://github.com/lm2343635/MGKeyboardAccessory.git",
        "tag": "0.5"
    },
    "platforms": {
        "ios": "8.0"
    },
    "default_subspecs": "Core",
    "subspecs": [
        {
            "name": "Core",
            "source_files": "MGKeyboardAccessory/Classes/Core/**/*"
        },
        {
            "name": "Rx",
            "dependencies": {
                "MGKeyboardAccessory/Core": [
                    "~> 0"
                ],
                "RxCocoa": [
                    "~> 4.5"
                ]
            },
            "source_files": "MGKeyboardAccessory/Classes/Rx/**/*"
        }
    ]
}

Pin It on Pinterest

Share This