Skip to content

Commit

Permalink
Resolved issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMrugraj committed Sep 17, 2015
1 parent 45e88f3 commit 8e24ff7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>406AB89D-B1A2-4DE0-8E0B-45AFF1E617F5</string>
<key>IDESourceControlProjectName</key>
<string>MVAutocompletePlaceTextFieldDemo</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>9475F9EA9F1270B55850D6333B75C56D2D1DB859</key>
<string>https://github.com/mrugrajsinh/MVAutocompletePlaceSearchTextField</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>MVAutocompletePlaceTextFieldDemo/MVAutocompletePlaceTextFieldDemo.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>9475F9EA9F1270B55850D6333B75C56D2D1DB859</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/mrugrajsinh/MVAutocompletePlaceSearchTextField</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>9475F9EA9F1270B55850D6333B75C56D2D1DB859</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>9475F9EA9F1270B55850D6333B75C56D2D1DB859</string>
<key>IDESourceControlWCCName</key>
<string>MVAutocompletePlaceSearchTextField</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e24ff7

Please sign in to comment.