Initialization:
Let’s say that I have 5 labels, tagged 1-5. These 5 labels are attached to an IBOutletCollection initialized with
@property (nonatomic, retain) IBOutletCollection(UILabel) NSMutableSet* myLineCollection;
What I want to do:
When my finger touches and moves across the screen, I want to receive which label my finger is over in myLineCollection.
I want to receive this because my end goal is to change the color of the label my finger is currently over from red to blue. But when my finger moves away it should go back to its original color, blue.
I was thinking I should use
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
and / or
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
and / or
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
I’ve been trying:
To use touches, and and if statement for if the touch was in the label.window, or maybe even c if the touch point is label.frame.length away from label.frame.center.
How can i receive the tag of the current one being touch, and then do something to that tag.
thats all i need
Hope this would helps you: