tex

TextViewMaster

πŸ“±Easy custom placeholder and growing textView

Showing:

Popularity

Downloads/wk

0

GitHub Stars

61

Maintenance

Last Commit

3yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

TextViewMaster

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100