美文网首页
UITextView inputDelegate

UITextView inputDelegate

作者: 老猫_2017 | 来源:发表于2020-04-27 18:52 被阅读0次

    背景:在 textView 末尾插入字符串
    分析:不知前面是否已经有 字符,插入的位置,如何处理?

    解决:

    UIKeyInput 协议有3个方法
    
    @property(nonatomic, readonly) BOOL hasText;
    - (void)insertText:(NSString *)text; // 这个方法,刚好可以解决需求
    - (void)deleteBackward;
    
    

    相关文章

      网友评论

          本文标题:UITextView inputDelegate

          本文链接:https://www.haomeiwen.com/subject/xomuwhtx.html