背景:在 textView 末尾插入字符串
分析:不知前面是否已经有 字符,插入的位置,如何处理?
解决:
UIKeyInput 协议有3个方法
@property(nonatomic, readonly) BOOL hasText;
- (void)insertText:(NSString *)text; // 这个方法,刚好可以解决需求
- (void)deleteBackward;
背景:在 textView 末尾插入字符串
分析:不知前面是否已经有 字符,插入的位置,如何处理?
解决:
UIKeyInput 协议有3个方法
@property(nonatomic, readonly) BOOL hasText;
- (void)insertText:(NSString *)text; // 这个方法,刚好可以解决需求
- (void)deleteBackward;
本文标题:UITextView inputDelegate
本文链接:https://www.haomeiwen.com/subject/xomuwhtx.html
网友评论