UITextView get the current line

后端 未结 3 1141
暖寄归人
暖寄归人 2021-02-09 03:44

Is there a way (crazy hacks welcome) to get the current line as a string of a UITextView? This would include word wrapping, etc. For example, in this case:

3条回答
  •  渐次进展
    2021-02-09 04:17

    I ended up using the caretRect method of UITextInput to get the offset from the left. Worked flawlessly.

提交回复
热议问题