Right Now I am making an iOS app and I would like to implement the ability to remove letters in a UILabel by simply “Dropping the letter”. The part That I am having an issue with is adding a gesture recognizer to individual letters of a UILabel. I have already searched the web for this and have nothing.Just to be clear, I am NOT adding a gesture recognizer to the whole label, I am only wanting to add it to individual letters. Any help is greatly appreciated.
Thanks
It seems that the easiest way to do it is by dynamically calculating the position of a letter. Use this:
so you can get the the size for a letter in the font and size you are using for each label and using the
[stringInstance length]property and the[UILabel numberOfLines]property to get the approximate center for each letter in a label, then use a simple tapGestureRecognizer for each label and in there calling your method forthere you use everything to calculate the approximate center for each letter and adding a selectableRange for error and correct user responding as x +- 20 pixels and y +- 20 pixels.
Apple says that anything with a selectable bound lesser than 40 pixels for 40 pixels will be completely annoying for the user, so your font size should actually be quite big for user interaction.