- Notifications
You must be signed in to change notification settings - Fork3
📱Easy custom placeholder and growing (iMessage-like) UITextView with customisation
License
RanduSoft/RSTextViewMaster
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
📱Easy custom placeholder and growing (iMessage-like) UITextView with customisation
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.You can specify a maxHeight property so the textview can start to scroll.
- iOS 9.0 or newer
- Swift 4.2
RSTextViewMaster is available throughCocoaPods.
pod'RSTextViewMaster'
importRSTextViewMaster
For the moment, please usetextView.setText(text: String) to update textview's text. By using.text settler, the placeholder won't be removed. This will get fixed in future updates.
isAnimate:Bool=truemaxLength:Int=0minHeight:CGFloat=0maxHeight:CGFloat=0placeHolder:String=""placeHolderFont:UIFont=UIFont.systemFont(ofSize:17)placeHolderColor:UIColor=UIColor(white:0.8,alpha:1.0)placeHolderTopPadding:CGFloat=0placeHolderBottomPadding:CGFloat=0placeHolderRightPadding:CGFloat=5placeHolderLeftPadding:CGFloat=5
lettextViewMaster=RSTextViewMaster()textViewMaster.delegate=selfinputView.addSubview(textViewMaster)
You will have to set constrains by code if you take this approach.
- TextView Set class to "RSTextViewMaster".
- Set delegate to it's view controller
- Set a height constraint but check "remove at runtime". This way Xcode won't bother you and the textview will work like magic
Check the demo for an example.
RSTextViewMaster inherits from UITextViewDelegate.You can also use UITextViewDelegate by default.Added or modified functions
funcgrowingTextView(growingTextView:RSTextViewMaster,shouldChangeTextInRangerange:NSRange,replacementTexttext:String) ->BoolfuncgrowingTextViewShouldReturn(growingTextView:RSTextViewMaster)funcgrowingTextView(growingTextView:RSTextViewMaster,willChangeHeightheight:CGFloat)funcgrowingTextView(growingTextView:RSTextViewMaster,didChangeHeightheight:CGFloat)
RSTextViewMaster is based onJeaSungLEE'swork
RSTextViewMaster is available under the GNU license.
About
📱Easy custom placeholder and growing (iMessage-like) UITextView with customisation
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- Swift90.3%
- Ruby9.7%
