0

I want to find the position of a word in a textview, so that if I have a textview with 300 words, and the user taps on word number 100, a UILabel reads, "100" and so on.

This seems like a helpful place to start to select a word in a textview. And I can go here to get the word count of the textView. But beyond that I'm not sure.

Any ideas?

Community
  • 1
  • 1
MScottWaller
  • 3,321
  • 2
  • 24
  • 47
  • To be clear, are you looking for the position of the word as a rect in relation to the textview, or just want a callback with the string that is the word that was tapped? – Max Chuquimia Jun 27 '16 at 04:49
  • No, I want the word number. If "dog" is word number 27 in the textview, I want to the UILabel to read "27" if the user taps on "dog" – MScottWaller Jun 27 '16 at 16:24

0 Answers0