diff --git a/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace/xcshareddata/MVAutocompletePlaceTextFieldDemo.xccheckout b/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace/xcshareddata/MVAutocompletePlaceTextFieldDemo.xccheckout new file mode 100644 index 0000000..c558178 --- /dev/null +++ b/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace/xcshareddata/MVAutocompletePlaceTextFieldDemo.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 406AB89D-B1A2-4DE0-8E0B-45AFF1E617F5 + IDESourceControlProjectName + MVAutocompletePlaceTextFieldDemo + IDESourceControlProjectOriginsDictionary + + 9475F9EA9F1270B55850D6333B75C56D2D1DB859 + https://github.com/mrugrajsinh/MVAutocompletePlaceSearchTextField + + IDESourceControlProjectPath + MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 9475F9EA9F1270B55850D6333B75C56D2D1DB859 + ../.. + + IDESourceControlProjectURL + https://github.com/mrugrajsinh/MVAutocompletePlaceSearchTextField + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + 9475F9EA9F1270B55850D6333B75C56D2D1DB859 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 9475F9EA9F1270B55850D6333B75C56D2D1DB859 + IDESourceControlWCCName + MVAutocompletePlaceSearchTextField + + + + diff --git a/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace/xcuserdata/indianic.xcuserdatad/UserInterfaceState.xcuserstate b/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace/xcuserdata/indianic.xcuserdatad/UserInterfaceState.xcuserstate index c36df1d..3c7b5e2 100644 Binary files a/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace/xcuserdata/indianic.xcuserdatad/UserInterfaceState.xcuserstate and b/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace/xcuserdata/indianic.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo/MVPlaceSearchTextField/MVPlaceSearchTextField.m b/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo/MVPlaceSearchTextField/MVPlaceSearchTextField.m index a63eacc..04ae1a9 100644 --- a/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo/MVPlaceSearchTextField/MVPlaceSearchTextField.m +++ b/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo/MVPlaceSearchTextField/MVPlaceSearchTextField.m @@ -59,7 +59,7 @@ - (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField { - NSString *aQuery=[textField.text stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; + NSString *aQuery=textField.text; [NSObject cancelPreviousPerformRequestsWithTarget:_placesClient selector:@selector(autocompleteQuery:bounds:filter:callback:) object:self]; if(aQuery.length>0){ diff --git a/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo/MVPlaceSearchTextField/PlaceDetail.m b/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo/MVPlaceSearchTextField/PlaceDetail.m index f1c8d18..326fe38 100644 --- a/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo/MVPlaceSearchTextField/PlaceDetail.m +++ b/MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo/MVPlaceSearchTextField/PlaceDetail.m @@ -22,19 +22,15 @@ -(id)initWithApiKey:(NSString *)ApiKey{ } -(void)getPlaceDetailForReferance:(NSString*)strReferance{ - NSString *aStrUrl=aStrApiKey?[NSString stringWithFormat:apiURL,strReferance,aStrApiKey]:[NSString stringWithFormat:apiURLWithoutKey,strReferance]; - NSURL *aUrl=[NSURL URLWithString:aStrUrl]; - - [[GMSPlacesClient sharedClient]lookUpPlaceID:strReferance callback:^(GMSPlace * _Nullable result, NSError * _Nullable error) { - if(result){ - [_delegate placeDetailForReferance:strReferance didFinishWithResult:result]; + [NSString stringWithFormat:apiURLWithoutKey,strReferance]; + [[GMSPlacesClient sharedClient]lookUpPlaceID:strReferance callback:^(GMSPlace *place, NSError *error) { + if(place){ + [_delegate placeDetailForReferance:strReferance didFinishWithResult:place]; } else{ NSLog(@"%@",error); } }]; - - } - (NSDictionary *)stringWithUrl:(NSURL *)url