目前,我通过以下方式测试 UITextView 是否脏:
if ([self.textView.undoManager canUndo]) ...
这总是正确的吗?还是 UITextView
中有类似 isDirty
的方法?
最佳答案
您可以使用 UITextViewDelegate
收听很多内容
查看 UITextViewDelegate documentation全面的细节
- (void)textViewDidBeginEditing:(UITextView *)textView
- (void)textViewDidEndEditing:(UITextView *)textView
- (void)textViewDidChange:(UITextView *)textView
shouldBegin
和 shouldEnd
编辑以及选择更改还有更多工作要做。
希望对您有所帮助。
关于ios - 如何判断 UITextView 脏了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8603226/