ios - 如何判断 UITextView 脏了?

标签 ios objective-c uitextview

目前,我通过以下方式测试 UITextView 是否脏:

if ([self.textView.undoManager canUndo]) ...

这总是正确的吗?还是 UITextView 中有类似 isDirty 的方法?

最佳答案

您可以使用 UITextViewDelegate 收听很多内容

查看 UITextViewDelegate documentation全面的细节

- (void)textViewDidBeginEditing:(UITextView *)textView

- (void)textViewDidEndEditing:(UITextView *)textView

- (void)textViewDidChange:(UITextView *)textView

shouldBeginshouldEnd 编辑以及选择更改还有更多工作要做。

希望对您有所帮助。

关于ios - 如何判断 UITextView 脏了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8603226/

相关文章:

iphone - 我们如何隐藏 tableHeaderView 和 tableFooterView?

ios - Google 登录与 Realm Swift 连接

iphone - UITextView行高问题

objective-c - NSImage 前向声明错误

ios - 如何将 IBOutlet 连接到 iOS 中的 textview 控件?

swift - 我将如何(以编程方式)将 UITextView 的高度设置为其在 Swift 中的内容大小?

ios - 尽管相机和节点共享原点,但 SceneKit 相机旋转错误

ios - libBlocksKit.a 中无法识别的选择器

objective-c - 调整大小后的 UIImage 质量较差

iPhone MapKit 是否可以从一系列触摸中映射坐标?