I'm stuck on something that should be very obvious but I've searched everywhere and haven't quite found what I was looking for. The task is simple; I have a NSTextField and I need to get the position of cursor whenever it changes (user starts writing, arrow keys, clicks etc).
On the internet everyone suggests:
override func controlTextDidChange(_ obj: Notification)
delegate method. which I used but it only responds when the text inside the textfield changes i.e user writes, deletes text etc not for anyother scenario.
I also tried adding a "NSClickGestureRecognizer" along with a controlTextDidChange to get the position of the cursor when it changes after a click but that didn't work either.
Does anyone know of any way to respond to and fetch the cursor position whenever it changes.
Any help would be greatly appreciated. thanks in advance.