Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view{
- NSLog(@" pin selected ");
- [self openInMap:invitationArray];
- calloutView = [[MAKRCalloutView alloc] initWithFrame:CGRectMake(0.0, 0.0, 292.0, 90.0)];
- calloutView.titleLabel.text = view.annotation.title;
- calloutView.informationLabel.text =seats;
- calloutView.distanceLabel.text=confirmStatusStr;
- calloutView.distanceLabel.textColor=[UIColor redColor];
- //calloutView.distanceLabel.hidden=YES;
- UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(confirmPress)];
- tapGestureRecognizer.numberOfTapsRequired = 1;
- [calloutView.distanceLabel addGestureRecognizer:tapGestureRecognizer];
- calloutView.distanceLabel.userInteractionEnabled = YES;
- [calloutView.imageView setImageWithURL :[NSURL URLWithString:imageStr]];
- calloutView.ratingView.value=ratingStr;
- calloutView.offerLabel.text=offerStr;
- calloutView.reviewLabel.text=@"0 Reviews";
- calloutView.subtitleLabel.text = view.annotation.subtitle;
- UITapGestureRecognizer *tapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(navigateToTrip)];
- [calloutView addGestureRecognizer:tapGesture];
- calloutView.center = CGPointMake(CGRectGetWidth(view.bounds) / 2.0, 0.0);
- [view addSubview:calloutView];
- }
- - (void)mapView:(MKMapView *)mapView didDeselectAnnotationView:(MKAnnotationView *)view {
- for (UIView *subview in view.subviews) {
- if (![subview isKindOfClass:[MAKRCalloutView class]]) {
- continue;
- [subview removeFromSuperview];
- }
- // [subview removeFromSuperview];
- [self navigateToTrip];
- }
- }
Add Comment
Please, Sign In to add comment