UIControlEventsas UIControlEventTouchUpInsideused with objects UIControl. In UIViewyou will need to conduct your own testing.
, , - . .
- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if ([touches count] == 1) {
UITouch * touch = [touches anyObject];
if ([touch tapCount] == 1) {
CGPoint point = [touch locationInView:self.view];
GridCell * cell = nil;
for (GridCell * aCell in cells) {
if (CGRectContainsPoint(aCell.frame, point)) {
cell = aCell;
break;
}
}
if (cell) {
}
}
}
}