diff --git a/FTGooglePlacesAPI/FTGooglePlacesAPIDetailResponse.h b/FTGooglePlacesAPI/FTGooglePlacesAPIDetailResponse.h index cf2059d..c3ec904 100644 --- a/FTGooglePlacesAPI/FTGooglePlacesAPIDetailResponse.h +++ b/FTGooglePlacesAPI/FTGooglePlacesAPIDetailResponse.h @@ -99,5 +99,6 @@ @property (nonatomic, strong, readonly) NSURL *websiteUrl; @property (nonatomic, assign, readonly) NSTimeInterval utcOffset; +@property (nonatomic, copy, readonly) NSArray *addressComponents; @end diff --git a/FTGooglePlacesAPI/FTGooglePlacesAPIDetailResponse.m b/FTGooglePlacesAPI/FTGooglePlacesAPIDetailResponse.m index c6f09ea..0e90a16 100644 --- a/FTGooglePlacesAPI/FTGooglePlacesAPIDetailResponse.m +++ b/FTGooglePlacesAPI/FTGooglePlacesAPIDetailResponse.m @@ -103,6 +103,7 @@ - (void)ftgp_importDictionary:(NSDictionary *)dictionary _websiteUrl = [NSURL URLWithString:[dictionary ftgp_nilledObjectForKey:@"website"]]; _utcOffset = [[dictionary ftgp_nilledObjectForKey:@"utc_offset"] doubleValue]; + _addressComponents = [dictionary ftgp_nilledObjectForKey:@"address_components"]; } @end \ No newline at end of file diff --git a/FTGooglePlacesAPI/FTGooglePlacesAPISearchResultItem.m b/FTGooglePlacesAPI/FTGooglePlacesAPISearchResultItem.m index 7808593..4e6b382 100644 --- a/FTGooglePlacesAPI/FTGooglePlacesAPISearchResultItem.m +++ b/FTGooglePlacesAPI/FTGooglePlacesAPISearchResultItem.m @@ -134,7 +134,11 @@ - (void)ftgpi_importDictionary:(NSDictionary *)dictionary } - _addressString = [dictionary ftgp_nilledObjectForKey:@"vicinity"]; + if (dictionary[@"vicinity"]) { + _addressString = [dictionary ftgp_nilledObjectForKey:@"vicinity"]; + } else if (dictionary[@"formatted_address"]) { + _addressString = [dictionary ftgp_nilledObjectForKey:@"formatted_address"]; + } // Openeed state may or may not be present NSNumber *openedState = [dictionary ftgp_nilledValueForKeyPath:@"opening_hours.open_now"]; diff --git a/FTGooglePlacesAPI/FTGooglePlacesAPIService.h b/FTGooglePlacesAPI/FTGooglePlacesAPIService.h index efa1cb8..56f067c 100644 --- a/FTGooglePlacesAPI/FTGooglePlacesAPIService.h +++ b/FTGooglePlacesAPI/FTGooglePlacesAPIService.h @@ -96,4 +96,9 @@ typedef void (^FTGooglePlacesAPIDetailRequestCompletionhandler)(FTGooglePlacesAP */ + (void)setDebugLoggingEnabled:(BOOL)enabled; +/** + * Cancel all the running Places requests. + */ ++ (void)cancelAllRequests; + @end diff --git a/FTGooglePlacesAPI/FTGooglePlacesAPIService.m b/FTGooglePlacesAPI/FTGooglePlacesAPIService.m index e131bca..d2e9fe9 100644 --- a/FTGooglePlacesAPI/FTGooglePlacesAPIService.m +++ b/FTGooglePlacesAPI/FTGooglePlacesAPIService.m @@ -214,6 +214,11 @@ + (void)setDebugLoggingEnabled:(BOOL)enabled FTGooglePlacesAPIDebugLoggingEnabled = enabled; } ++ (void)cancelAllRequests +{ + [[FTGooglePlacesAPIService sharedService].httpRequestOperationManager.operationQueue cancelAllOperations]; +} + #pragma mark - Private class methods + (void)executeRequest:(id)request diff --git a/XcodeProject/FTGooglePlacesAPI.xcodeproj/project.xcworkspace/xcshareddata/FTGooglePlacesAPI.xccheckout b/XcodeProject/FTGooglePlacesAPI.xcodeproj/project.xcworkspace/xcshareddata/FTGooglePlacesAPI.xccheckout new file mode 100644 index 0000000..e5ee92a --- /dev/null +++ b/XcodeProject/FTGooglePlacesAPI.xcodeproj/project.xcworkspace/xcshareddata/FTGooglePlacesAPI.xccheckout @@ -0,0 +1,53 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + FD422588-35B3-46C2-8EF7-3936E6B10189 + IDESourceControlProjectName + FTGooglePlacesAPI + IDESourceControlProjectOriginsDictionary + + DD20A1A48C66B5213E0FEBB87A95EF51D6C6F3E8 + github.com:AFNetworking/AFNetworking.git + F8DE5E0E3C11A175741C8D49C74487562DC374DB + https://github.com/satgi/FTGooglePlacesAPI.git + + IDESourceControlProjectPath + XcodeProject/FTGooglePlacesAPI.xcodeproj + IDESourceControlProjectRelativeInstallPathDictionary + + DD20A1A48C66B5213E0FEBB87A95EF51D6C6F3E8 + ../../..XcodeProject/FTGooglePlacesAPI/Thirdparty/AFNetworking/ + F8DE5E0E3C11A175741C8D49C74487562DC374DB + ../../.. + + IDESourceControlProjectURL + https://github.com/satgi/FTGooglePlacesAPI.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + F8DE5E0E3C11A175741C8D49C74487562DC374DB + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + DD20A1A48C66B5213E0FEBB87A95EF51D6C6F3E8 + IDESourceControlWCCName + AFNetworking + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + F8DE5E0E3C11A175741C8D49C74487562DC374DB + IDESourceControlWCCName + FTGooglePlacesAPI + + + +