How do I deselect text in UITextView?

前端 未结 3 707
予麋鹿
予麋鹿 2021-01-04 05:47

After some moment I need deselect text in UITextView. How do I deselect text in UITextView?

\"enter

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-04 06:05

    The previous answer didn't work for me, the compiler complains:

    Sending 'void *' to parameter of incompatible type 'NSRange' (aka 'struct _NSRange')

    I had to use an empty NSRange struct instead:

    [self setSelectedRange:(NSRange){ .location = 0, .length = 0 }];
    

提交回复
热议问题