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

Version
License: MIT
Platform
Swift 4.2

Introduce

image

Easy custom placeholder and growing textView

You can easily adjust the color, font, and position of the placeholder.
The height of the textview automatically changes every time you increase or decrease the line in the textview.

Requirements

  • iOS9.0 or higher version
  • Swift4.2

Installation

Cocoapods

TextViewMaster is available through CocoaPods.

pod 'TextViewMaster'

Usage

import TextViewMaster

Customization

    isAnimate: Bool = true                                          //에니메이션 사용여부
    maxLength: Int = 0                                              //최대 글자수
    minHeight: CGFloat = 0                                          //최소 높이 제한
    maxHeight: CGFloat = 0                                          //최대 높이 제한

    placeHolder: String = ""                                        //플레이스홀더
    placeHolderFont: UIFont = UIFont.systemFont(ofSize: 17)         //플레이스홀더 폰트
    placeHolderColor: UIColor = UIColor(white: 0.8, alpha: 1.0)     //플레이스홀더 컬러
    placeHolderTopPadding: CGFloat = 0                              //플레이스홀더 위 여백
    placeHolderBottomPadding: CGFloat = 0                           //플레이스홀더 아래 여백
    placeHolderRightPadding: CGFloat = 5                            //플레이스홀더 오른쪽 여백
    placeHolderLeftPadding: CGFloat = 5                             //플레이스홀더 왼쪽 여백

Programmatically

let textViewMaster = TextViewMaster()
textViewMaster.delegate = self       
inputView.addSubview(textViewMaster)

If you have difficulty applying, please refer to the example folder.

Storyboard

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

Delegate

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

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

Author

jeasungLEE

License

TextViewMaster is available under the MIT license.

Latest podspec

{
    "name": "TextViewMaster",
    "version": "1.1.0",
    "summary": "TextViewMaster.",
    "description": "Easy custom placeholder and growing textView.",
    "homepage": "https://github.com/JeaSungLEE/TextViewMaster",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": {
        "jeasung.lee": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/JeaSungLEE/TextViewMaster.git",
        "tag": "1.1.0"
    },
    "source_files": "TextViewMaster/**/*.swift",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This