DSTexView
DSTextView is to get rid of placeholder and its color issue of UITextView of UIKit in swift 5. It privide most of the delegate methods to use TextView and also gives you character count. You can set placeholder from Interface Builder.
DSTexView
- [x] Awesome UITextView
- [x] Get Characters count
- [x] Set color of the placeholder
- [x] Set placeholder in interface builder
- [x] Easy usage
- [x] Supports iOS, written in Swift 5
Installation
DSTextView is available through CocoaPods. To install
it, simply add the following line to your Podfile and run pod install
:
Then you can import it when you need
Usage
In the example you will see a textview with placeholder that can be customized and used in your project. Once you've installed the pod, follow next steps. It's really simple:
UIView in your xib / storyboard
Add a UIView
in the xib where you want to place DSTextView. Then you have to input the class name in the view, you can change this in the identity inspector of the interface builder. Remember to input DSTextView
in both (Class & Module)
Then, connect the IBOutlet in your UIViewController
Properties
You can set properties of DSTextView
on your requirement.
Implement delegate
The first way to customize this DSTextView
is implementing delegate. These methods handle the most common use cases. Both of them are optional. You can set delegate through storyboard itself.
Delegates
In order to add more functionality in your app, you must implement DSTextViewDelegate
.
Author
Dharmendra Sinha, dsinha6193@gmail.com