Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // install gesture recognizer
- UITapGestureRecognizer *recognizer;
- recognizer = [[UITapGestureRecognizer alloc] initWithTarget:result action:@selector(tapAction:)];
- [itemView addGestureRecognizer: recognizer];
- [recognizer release];
- [laView addSubview: itemView];
- -(BOOL)isInfoButtonTap:(UIGestureRecognizer*) recognizer shouldPerformInfoButtonAction:(BOOL)performAction
- {
- BOOL ret = NO;
- CGPoint location = [recognizer locationInView:self];
- UIView *hitView = [self hitTest:location withEvent:nil];
- if(([hitView isKindOfClass:[UIButton class]]))
- {
- ret = YES;
- if((performAction) && (!_infoBubble))
- {
- [self performInfoButtonTapAnchoredToThisButton:(UIButton *)hitView];
- }
- else if(_infoBubble)
- {
- [self closeInfoBubble];
- }
- }
- return ret;
- }
- - (void) tapAction: (UIGestureRecognizer*) recognizer
- {
- LYItemView *itemView = (LYItemView*) recognizer.view;
- if([self isInfoButtonTap:recognizer shouldPerformInfoButtonAction:YES])
- {
- return;
- }
- (....)
- }
- -(void)performInfoButtonTapAnchoredToThisButton:(UIButton *)button
- {
- (....)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement