Detect Tap on Word in UILabel?

2010-01-30 Thread Samuel Ford
Is it possible to detect which word was tapped in a UILabel in Cocoa Touch? It seems like it should be a pretty easy thing to do, but I'm stuck. Anybody ever try to do this? I know you can measure a string and get the bounding box that contains it; likewise, looking at the UITextInput protocol

Re: Detect Tap on Word in UILabel?

2010-01-30 Thread Roland King
no I don't think there is a way to do it directly. your best solution if you want to do this is subclass UILabel, draw the actual label yourself and then use the knowledge of how you drew it to figure out the closest character to the touch, if you just make a simple subclass like that, you can

Re: Detect Tap on Word in UILabel?

2010-01-31 Thread Scott Anguish
Why would you want to do this, vs using a button? How would the user know they should tap on that word? On Jan 30, 2010, at 6:54 PM, Samuel Ford wrote: Is it possible to detect which word was tapped in a UILabel in Cocoa Touch? It seems like it should be a pretty easy thing to do, but I'm s

Re: Detect Tap on Word in UILabel?

2010-01-31 Thread Samuel Ford
I want to be able to display arbitrary text on a view and respond to taps on the words independently. I guess it probably would be easier to parse the text out into words and just drop down custom buttons into some kind of flow layout. On Jan 31, 2010, at 2:57 PM, Scott Anguish wrote: > Why wo