Latest0.1.0
Homepagehttps://github.com/francis830227/KPInputTextView
LicenseMIT
Platformsios 9.0
Authors

CI Status
Version
License
Platform

Example

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

Alt Text

Requirements

  • iOS 9.0+

Installation

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

pod 'KPInputTextView'

How To Use

import KPInputTextView

Class YourViewController: UIViewController {

    let kpInputView = KPInputTextView()

    override var inputAccessoryView: UIView? {
        get {
            return kpInputView
        }
    }

    override var canBecomeFirstResponder: Bool {
        return true
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        kpInputView.delegate = self

        // Adjust kpInputView's properties here.
        kpInputView.backgroundColor = .blue

    }

}

extension ViewController: KPInputDelegate {

    func didSend(_ text: String) {
        // Do something after clicked send button.

        // When clicked send button, clear text in inputTextView.
        kpInputView.clearTextField()
    }
}

Supported Properties

PropertyDefault
backgroundColorUIColor.lightGray
textViewBackgroundColorUIColor.white
textViewCornerRadius10
textViewBorderWidth1
textViewBorderColorUIColor.black.cgColor
placeholderText"message…"
placeholderTextColorUIColor.lightGray
sendButtonTitle"Send"
sendButtonTitleColorUIColor.black
sendButtonBackgroundColorUIColor.red
sendButtonCornerRadius7.5
sendButtonFontUIFont.boldSystemFont(ofSize: 14)
maxLines6
FunctionDescription
clearTextField()Clear text.

Author

Francis Tseng

[email protected]

LinkedIn

License

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

Latest podspec

{
    "name": "KPInputTextView",
    "version": "0.1.0",
    "summary": "Easy use of chatroom input view.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/francis830227/KPInputTextView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "francis830227": "[email protected]"
    },
    "source": {
        "git": "https://github.com/francis830227/KPInputTextView.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "KPInputTextView/Classes/",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This