如何判断 UITextView 脏了?
目前,我通过以下方式测试 UITextView 是否脏:
if ([self.textView.undoManager canUndo]) ...
这总是正确的吗?或者UITextView
中有类似isDirty
的方法吗?
Currently, I test whether a UITextView is dirty or not by:
if ([self.textView.undoManager canUndo]) ...
Is this always correct? Or is there any isDirty
-like method in UITextView
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
UITextViewDelegate
收听很多内容,请查看 UITextViewDelegate 文档 了解全面的详细信息
- (void)textViewDidBeginEditing:(UITextView *)textView
- (void)textViewDidEndEditing:(UITextView *)textView
- (void)textViewDidChange:(UITextView *)textView
还有更多关于
shouldBegin
和shouldEnd
编辑,以及选择更改。希望能有所帮助。
You can listen to lots of things with the
UITextViewDelegate
Check out the UITextViewDelegate documentation for comprehensive details
- (void)textViewDidBeginEditing:(UITextView *)textView
- (void)textViewDidEndEditing:(UITextView *)textView
- (void)textViewDidChange:(UITextView *)textView
There's more to do with
shouldBegin
andshouldEnd
editing, and also selection changes.Hope that helps out.