#import \"MyLocationViewController.h\"
#import
@interface MyLocationViewController ()
@end
@implementation MyLocationViewControll
Add Your UITextfield or UISearchbar in to subview of Mapview_
UISearchBar *search;
search = [[UISearchBar alloc] init];
[search setTintColor:[UIColor colorWithRed:233.0/255.0
green:233.0/255.0
blue:233.0/255.0
alpha:1.0]];
search.frame = CGRectMake(50,20,self.view.frame.size.width-70,32);
search.delegate = self;
search.placeholder = @"MapView";
[mapView_ addSubview:search];
Add Following method to your .m file
// Remove the GMSBlockingGestureRecognizer of the GMSMapView.
+ (void)removeGMSBlockingGestureRecognizerFromMapView:(GMSMapView *)mapView
{
for (id gestureRecognizer in mapView.gestureRecognizers)
{
NSLog(@"mapview recognizer %@",gestureRecognizer);
if (![gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]])
{
[mapView removeGestureRecognizer:gestureRecognizer];
}
}
}
Call This Method from your view will appear
- (void)viewWillAppear:(BOOL)animated {
[ViewController removeGMSBlockingGestureRecognizerFromMapView:mapView_];
}
Now it will work , i got tested with this code only.