Swift 3.0 iOS 8.0+
HighlightTextView is available through Carthage. To install it, simply add the following line to your Cartfile:
github "yusayusa/HighlightTextView"
pod "HighlightTextView"
let textView: UITextView
// set maximum character limit and background color, minimum character limit and background color
textView.setHighlight(
range: Range(uncheckedBounds: (lower: 20, upper: 50)),
minHighlightColor: UIColor.gray,
maxHighlightColor: UIColor.red
)
HighlightTextView is released under the MIT license. Go read the LICENSE file for more information.