UITextView insert text in the textview text

后端 未结 6 1007
谎友^
谎友^ 2020-12-10 03:16

I want to have to occasionally insert text into the UITextView text object. For example, if the user presses the \"New Paragraph\" button I would like to insert a double ne

6条回答
  •  無奈伤痛
    2020-12-10 03:39

    UITextview has an insertText method and it respects cursor position.

    - (void)insertText:(NSString *)text
    

    for example:

    [myTextView insertText:@"\n\n"];
    

提交回复
热议问题