Jakob Dam Jensen
Jakob Dam Jensen

Reputation: 434

NSTextView yellow highlight like in safari search

I've done this before but I simply can't remember how I did it =(

So what I'm trying to do is to select a range in a NSTextView and make it visible with the yellow box similar to Safari search. As far as I remember there is a build in API for this but after searching like crazy I haven't found it. And I've asked about it once before on this site but apparently I can't find the old post...

The selectRange method does only select the range, it doesn't emphasize the selection at all.

Am I wrong about this meaning that there isn't an API for this already? If so what is the best approach. To add a CALayer to the textview and do it all by myself?

Upvotes: 5

Views: 1066

Answers (1)

Alex
Alex

Reputation: 26859

Have you tried showFindIndicatorForRange:?

Upvotes: 6

Related Questions