我在使 UILabel 通过更改其文本颜色来对 UITextView 使用react时遇到问题。
所以当我的 UITextView 中有超过 250 个单词时,我的 UILabel 将变成红色。但由于某种原因它并没有这样做。
// class NewAppViewController: UIViewController, UITextViewDelegate...
func textViewDidChange(_ textView: UITextView) {
let characterCounts = commentTextField.text.characters.count
wordCountLabel.text = String(250 - characterCounts)
if (250 - characterCounts) < 0 {
self.wordCountLabel.textColor = UIColor.red
sendButton.isEnabled = false
} else {
sendButton.isEnabled = true
}
}
最佳答案
关于ios - PopoverPresentationController 内的 UITextView 不响应其委托(delegate)方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41712938/