Works in xib file and code.
Add PGCTextView folder into your project.
let customTextView = PGCTextView()
customTextView.counterColor = .blue
customTextView.counterFont = UIFont.italicSystemFont(ofSize: 11)
customTextView.font = UIFont.systemFont(ofSize: 25)
customTextView.frame = CGRect(x: 20.0, y: 100.0, width: 150.0, height: 200.0)
customTextView.isCounterAscending = true
customTextView.isCounterVisible = true
customTextView.maxCharacters = 50
customTextView.placeholderColor = .darkGray
customTextView.placeholderFont = UIFont.italicSystemFont(ofSize: 25)
customTextView.placeholderText = "Placeholder"
customTextView.text = ""
customTextView.textColor = .black
self.view.addSubview(customTextView)
Add PGCTextView
in Identity inspector > Custom Class > Class.
Modify custom properties for placeholder and counter.
PGCTextView is released under the MIT license.