You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to compute the cursor position with STTextView and TextKit. I can get it to work by obtaining the cursorTextLineFragment like so:
This works as intended for every case, except for the last empty line of a document. I assume this is because the last line is not converted to NSTextLayoutFragment until I move the cursor back.
I was wondering, whether you know a workaround for this use case or a better approach for this problem.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Marcin,
I am currently trying to compute the cursor position with
STTextView
and TextKit. I can get it to work by obtaining the cursorTextLineFragment like so:and then to get the column value:
This works as intended for every case, except for the last empty line of a document. I assume this is because the last line is not converted to
NSTextLayoutFragment
until I move the cursor back.I was wondering, whether you know a workaround for this use case or a better approach for this problem.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions