Latest 0.0.1
Homepage https://github.com/JeaSungLEE/JSGrowingTextView
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

Version
License: MIT
Platform
Swift 4.0

Introduce

demo

Text view that grows with text input

Requirements

  • iOS9.0 or higher version
  • Swift4

Installation

Cocoapods

JSGrowingTextView is available through CocoaPods.

pod 'JSGrowingTextView'

Usage

Customization

growingTextView.isAnimate = true                                               //에니메이션 사용여부
growingTextView.maxLength = 200                                                //최대 글자수
growingTextView.maxHeight = 500                                                //최대 높이 제한
growingTextView.placeHolder = "메세지를 입력해주세요."                               //플레이스홀더
growingTextView.placeHolderColor = UIColor(white: 0.8, alpha: 1.0)             //플레이스홀더 색상

Programmatically

let growingTextView = JSGrowingTextView()
growingTextView.delegate = self
view.addSubview(inputView)

Reference example project

Storyboard

  1. TextView Set class to "JSGrowingTextView".
  2. Set delegate to it’s view controller

Delegate

JSGrowingTextView inherits from UITextViewDelegate.
You can also use UITextViewDelegate by default.
Added or modified functions

func growingTextView(growingTextView: JSGrowingTextView, shouldChangeTextInRange range:NSRange, replacementText text:String) -> Bool
func growingTextViewShouldReturn(growingTextView: JSGrowingTextView) 
func growingTextView(growingTextView: JSGrowingTextView, willChangeHeight height:CGFloat)
func growingTextView(growingTextView: JSGrowingTextView, didChangeHeight height:CGFloat)

Author

jeasungLEE

License

JSGrowingTextView is available under the MIT license.

Latest podspec

{
    "name": "JSGrowingTextView",
    "version": "0.0.1",
    "summary": "JSGrowingTextView.",
    "description": "Text view that grows with text input.",
    "homepage": "https://github.com/JeaSungLEE/JSGrowingTextView",
    "license": {
        "type": "MIT",
        "file": "FILE_LICENSE"
    },
    "authors": {
        "jeasung.lee": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/JeaSungLEE/JSGrowingTextView.git",
        "tag": "0.0.1"
    },
    "source_files": "JSGrowingTextView/**/*.swift",
    "frameworks": "UIKit",
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This