0
나는 그것의 텍스트 색상을 변경하여 내 UITextView에 반응하는 내 UILabel의를 만드는 데 문제가 응답하지 않습니다.
그래서 내 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
}
}
uitextview에 위임자를 지정 했습니까? – Rafeek
답변을 찾은 것 같아요 ... – Giraffe
위임자를 추가하지 못했습니다. – Arti