Reputation: 1684
I currently have this in my code
tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(updateLeftLabel:)];
which calls
- (void)updateLeftLabel:(UIGestureRecognizer*)recognizer
My code would be cleaner if the method was
- (void)updateLeftLabel:(UIGestureRecognizer*)recognizer fromData:(EquationData*)data
However, I need a way to send the 'data' parameter when I init UITapGestureRecognizer
Upvotes: 0
Views: 1072
Reputation: 2183
Why Complicate ??? Subclass UITapGestureOrganiser and use any number of custom objects in the new class.
Upvotes: 4
Reputation: 23722
You can use associated objects to attach data
to the gesture recognizer.
Upvotes: 0