Skip to content

Commit ccca9d1

Browse files
committed
Update places sample.
1 parent 7f8c31d commit ccca9d1

File tree

65 files changed

+804
-850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+804
-850
lines changed

GooglePlaces/GooglePlacesDemos.xcodeproj/project.pbxproj

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
30DB731057D560A0F3017362 /* FindPlaceLikelihoodListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18AE29BAB2CC24B015F7754A /* FindPlaceLikelihoodListViewController.m */; };
1515
3440EB14B9D0E24AAF030012 /* PlacesDemoAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 85EDEFE42680FF093454D1AB /* PlacesDemoAssets.xcassets */; };
1616
44E1C3298B123A5107DBC3FA /* DemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B81B9326DD5B37C08B8CCAA /* DemoAppDelegate.m */; };
17-
4D992D64E65A08AEBF24CCEA /* libPods-GooglePlacesDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BDBC41688712ED8CBC05482 /* libPods-GooglePlacesDemos.a */; };
1817
52C261A89C8177D081F0D666 /* DemoListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 36C753B6637575A8CD81C699 /* DemoListViewController.m */; };
1918
52FA2C79BAE0253BF65AD4DA /* AutocompleteBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E6E2A1285D9A0BEBDCD503 /* AutocompleteBaseViewController.m */; };
2019
68FD32D0AB7DA54A0617E79C /* DemoData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F2203BCCE0CFC3DC4F38B30 /* DemoData.m */; };
@@ -25,6 +24,7 @@
2524
BDCD4957C53C15747F136768 /* AutocompleteWithCustomColors.m in Sources */ = {isa = PBXBuildFile; fileRef = FC03FEE150596E9432F612DF /* AutocompleteWithCustomColors.m */; };
2625
C31E5320A5DBA3B92410CC12 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1D344C64A66F10D55590797E /* Localizable.strings */; };
2726
CCE1EEA311AF30C9E7273CA6 /* PagingPhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21153EB819432638638C2C26 /* PagingPhotoView.m */; };
27+
CE2A076DABFAAF1EB4C68142 /* libPods-GooglePlacesDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 98012ED42ECFA84723BFC464 /* libPods-GooglePlacesDemos.a */; };
2828
/* End PBXBuildFile section */
2929

3030
/* Begin PBXFileReference section */
@@ -57,19 +57,19 @@
5757
651835542B635C74A3D0F711 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = "<group>"; };
5858
67BD5ABA8E74D336AE54C0B0 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = "<group>"; };
5959
69D781288A761B789E0F63B6 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = "<group>"; };
60-
6B56326D73793EAF385BB26C /* Pods-GooglePlacesDemos.default.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GooglePlacesDemos.default.xcconfig"; path = "Target Support Files/Pods-GooglePlacesDemos/Pods-GooglePlacesDemos.default.xcconfig"; sourceTree = "<group>"; };
6160
77688EB771E8262C6C224CE8 /* en_IN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en_IN; path = en_IN.lproj/Localizable.strings; sourceTree = "<group>"; };
62-
7BDBC41688712ED8CBC05482 /* libPods-GooglePlacesDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GooglePlacesDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6361
84E89BC0ADE5F983320B9730 /* AutocompletePushViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AutocompletePushViewController.h; sourceTree = "<group>"; };
6462
85EDEFE42680FF093454D1AB /* PlacesDemoAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = PlacesDemoAssets.xcassets; sourceTree = "<group>"; };
6563
88DC6C46CAE8787FB54161AF /* AutocompleteBaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AutocompleteBaseViewController.h; sourceTree = "<group>"; };
6664
8F7419DDC82CA074FF0A508C /* AutocompleteWithSearchViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AutocompleteWithSearchViewController.m; sourceTree = "<group>"; };
6765
91F10567E79D600B5D3A7385 /* DemoListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoListViewController.h; sourceTree = "<group>"; };
6866
97ADBE3D50D731A88C24F3F0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
67+
98012ED42ECFA84723BFC464 /* libPods-GooglePlacesDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GooglePlacesDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6968
9B81B9326DD5B37C08B8CCAA /* DemoAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoAppDelegate.m; sourceTree = "<group>"; };
7069
A00F12FEC785E9E287E42582 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
7170
A06B8C341933D23425E2C178 /* AutocompleteModalViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AutocompleteModalViewController.h; sourceTree = "<group>"; };
7271
A3D4BD9841268F97FD23E770 /* BaseDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseDemoViewController.m; sourceTree = "<group>"; };
72+
A625C4DF33E88FA1CA151664 /* Pods-GooglePlacesDemos.default.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GooglePlacesDemos.default.xcconfig"; path = "Target Support Files/Pods-GooglePlacesDemos/Pods-GooglePlacesDemos.default.xcconfig"; sourceTree = "<group>"; };
7373
A8162D0DA3B592BBB6E3FA35 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
7474
A8233D7A6FCDAD9F3E3FFEFC /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Localizable.strings; sourceTree = "<group>"; };
7575
A997870E831544227236DF00 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -110,13 +110,22 @@
110110
buildActionMask = 2147483647;
111111
files = (
112112
7DF1A5BA0B155A6414638BC6 /* UIKit.framework in Frameworks */,
113-
4D992D64E65A08AEBF24CCEA /* libPods-GooglePlacesDemos.a in Frameworks */,
113+
CE2A076DABFAAF1EB4C68142 /* libPods-GooglePlacesDemos.a in Frameworks */,
114114
);
115115
runOnlyForDeploymentPostprocessing = 0;
116116
};
117117
/* End PBXFrameworksBuildPhase section */
118118

119119
/* Begin PBXGroup section */
120+
3E40623B7D7909D7360914A3 /* Pods */ = {
121+
isa = PBXGroup;
122+
children = (
123+
A625C4DF33E88FA1CA151664 /* Pods-GooglePlacesDemos.default.xcconfig */,
124+
);
125+
name = Pods;
126+
path = Pods;
127+
sourceTree = "<group>";
128+
};
120129
5451EE1805656445BDA54845 /* Resources */ = {
121130
isa = PBXGroup;
122131
children = (
@@ -154,22 +163,13 @@
154163
name = Source;
155164
sourceTree = "<group>";
156165
};
157-
73C75DB8ECB5190143B3A3CD /* Pods */ = {
158-
isa = PBXGroup;
159-
children = (
160-
6B56326D73793EAF385BB26C /* Pods-GooglePlacesDemos.default.xcconfig */,
161-
);
162-
name = Pods;
163-
path = Pods;
164-
sourceTree = "<group>";
165-
};
166166
7C4A8D45D6D1B907A8C0521E = {
167167
isa = PBXGroup;
168168
children = (
169169
6474F6E51B1B62FD7E19E38F /* Source */,
170170
AB0178922FA6ECEABB9EFFE7 /* Frameworks */,
171171
87ED31F365F5BCA83FBDE8E8 /* Products */,
172-
73C75DB8ECB5190143B3A3CD /* Pods */,
172+
3E40623B7D7909D7360914A3 /* Pods */,
173173
);
174174
sourceTree = "<group>";
175175
};
@@ -194,7 +194,7 @@
194194
isa = PBXGroup;
195195
children = (
196196
97ADBE3D50D731A88C24F3F0 /* UIKit.framework */,
197-
7BDBC41688712ED8CBC05482 /* libPods-GooglePlacesDemos.a */,
197+
98012ED42ECFA84723BFC464 /* libPods-GooglePlacesDemos.a */,
198198
);
199199
name = Frameworks;
200200
sourceTree = "<group>";
@@ -236,11 +236,11 @@
236236
isa = PBXNativeTarget;
237237
buildConfigurationList = E489F9A9DC7E458708AB572E /* Build configuration list for PBXNativeTarget "GooglePlacesDemos" */;
238238
buildPhases = (
239-
33FAE63B078715B3B1954739 /* [CP] Check Pods Manifest.lock */,
239+
D6AE3C1D607491E2620B84C4 /* [CP] Check Pods Manifest.lock */,
240240
2A017491F6C5A9DBB4F6E6F6 /* Resources */,
241241
45EF04B6738E3486BE121AEC /* Sources */,
242242
A91F0EDBE05C0121150AEE46 /* Frameworks */,
243-
08F0EACA2B5936C9DE6995B8 /* [CP] Copy Pods Resources */,
243+
F6372D4056DA0547B296BAA5 /* [CP] Copy Pods Resources */,
244244
);
245245
buildRules = (
246246
);
@@ -332,46 +332,46 @@
332332
/* End PBXResourcesBuildPhase section */
333333

334334
/* Begin PBXShellScriptBuildPhase section */
335-
08F0EACA2B5936C9DE6995B8 /* [CP] Copy Pods Resources */ = {
335+
D6AE3C1D607491E2620B84C4 /* [CP] Check Pods Manifest.lock */ = {
336336
isa = PBXShellScriptBuildPhase;
337337
buildActionMask = 2147483647;
338338
files = (
339339
);
340+
inputFileListPaths = (
341+
);
340342
inputPaths = (
341-
"${PODS_ROOT}/Target Support Files/Pods-GooglePlacesDemos/Pods-GooglePlacesDemos-resources.sh",
342-
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Resources/GoogleMaps.bundle",
343-
"${PODS_ROOT}/GooglePlaces/Frameworks/GooglePlaces.framework/Resources/GooglePlaces.bundle",
343+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
344+
"${PODS_ROOT}/Manifest.lock",
345+
);
346+
name = "[CP] Check Pods Manifest.lock";
347+
outputFileListPaths = (
344348
);
345-
name = "[CP] Copy Pods Resources";
346349
outputPaths = (
347-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle",
348-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GooglePlaces.bundle",
350+
"$(DERIVED_FILE_DIR)/Pods-GooglePlacesDemos-checkManifestLockResult.txt",
349351
);
350352
runOnlyForDeploymentPostprocessing = 0;
351353
shellPath = /bin/sh;
352-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GooglePlacesDemos/Pods-GooglePlacesDemos-resources.sh\"\n";
354+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
353355
showEnvVarsInLog = 0;
354356
};
355-
33FAE63B078715B3B1954739 /* [CP] Check Pods Manifest.lock */ = {
357+
F6372D4056DA0547B296BAA5 /* [CP] Copy Pods Resources */ = {
356358
isa = PBXShellScriptBuildPhase;
357359
buildActionMask = 2147483647;
358360
files = (
359361
);
360-
inputFileListPaths = (
361-
);
362362
inputPaths = (
363-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
364-
"${PODS_ROOT}/Manifest.lock",
365-
);
366-
name = "[CP] Check Pods Manifest.lock";
367-
outputFileListPaths = (
363+
"${PODS_ROOT}/Target Support Files/Pods-GooglePlacesDemos/Pods-GooglePlacesDemos-resources.sh",
364+
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Resources/GoogleMaps.bundle",
365+
"${PODS_ROOT}/GooglePlaces/Frameworks/GooglePlaces.framework/Resources/GooglePlaces.bundle",
368366
);
367+
name = "[CP] Copy Pods Resources";
369368
outputPaths = (
370-
"$(DERIVED_FILE_DIR)/Pods-GooglePlacesDemos-checkManifestLockResult.txt",
369+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle",
370+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GooglePlaces.bundle",
371371
);
372372
runOnlyForDeploymentPostprocessing = 0;
373373
shellPath = /bin/sh;
374-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
374+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GooglePlacesDemos/Pods-GooglePlacesDemos-resources.sh\"\n";
375375
showEnvVarsInLog = 0;
376376
};
377377
/* End PBXShellScriptBuildPhase section */
@@ -471,7 +471,7 @@
471471
};
472472
C88A918BB441623AA489A34D /* Default */ = {
473473
isa = XCBuildConfiguration;
474-
baseConfigurationReference = 6B56326D73793EAF385BB26C /* Pods-GooglePlacesDemos.default.xcconfig */;
474+
baseConfigurationReference = A625C4DF33E88FA1CA151664 /* Pods-GooglePlacesDemos.default.xcconfig */;
475475
buildSettings = {
476476
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
477477
CLANG_ENABLE_OBJC_ARC = YES;

GooglePlaces/GooglePlacesDemos/DemoAppDelegate.m

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,16 @@
1515

1616
#import "GooglePlacesDemos/DemoAppDelegate.h"
1717

18-
#import <GoogleMaps/GoogleMaps.h>
1918
#import <GooglePlaces/GooglePlaces.h>
20-
2119
#import "GooglePlacesDemos/DemoData.h"
2220
#import "GooglePlacesDemos/DemoListViewController.h"
2321
#import "GooglePlacesDemos/SDKDemoAPIKey.h"
24-
#import "GooglePlacesDemos/Support/MainSplitViewControllerBehaviorManager.h"
2522

26-
@implementation DemoAppDelegate {
27-
MainSplitViewControllerBehaviorManager *_splitViewManager;
28-
}
23+
@implementation DemoAppDelegate
2924

3025
- (BOOL)application:(UIApplication *)application
3126
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
32-
NSLog(@"Build version: %d", __apple_build_version__);
27+
NSLog(@"Build version: %s", __VERSION__);
3328

3429
// Do a quick check to see if you've provided an API key, in a real app you wouldn't need this but
3530
// for the demo it means we can provide a better error message.
@@ -43,18 +38,13 @@ - (BOOL)application:(UIApplication *)application
4338
userInfo:nil];
4439
}
4540

46-
// Provide the Places API with your API key.
41+
// Provide the Places SDK with your API key.
4742
[GMSPlacesClient provideAPIKey:kAPIKey];
48-
// Provide the Maps API with your API key. You may not need this in your app, however we do need
49-
// this for the demo app as it uses Maps.
50-
[GMSServices provideAPIKey:kAPIKey];
5143

5244
// Log the required open source licenses! Yes, just NSLog-ing them is not enough but is good for
5345
// a demo.
54-
NSLog(@"Google Maps open source licenses:\n%@", [GMSServices openSourceLicenseInfo]);
5546
NSLog(@"Google Places open source licenses:\n%@", [GMSPlacesClient openSourceLicenseInfo]);
5647

57-
5848
// Manually create a window. If you are using a storyboard in your own app you can ignore the rest
5949
// of this method.
6050
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
@@ -65,16 +55,7 @@ - (BOOL)application:(UIApplication *)application
6555
[[DemoListViewController alloc] initWithDemoData:demoData];
6656
UINavigationController *masterNavigationController =
6757
[[UINavigationController alloc] initWithRootViewController:masterViewController];
68-
69-
_splitViewManager = [[MainSplitViewControllerBehaviorManager alloc] init];
70-
71-
// Setup the split view controller.
72-
UISplitViewController *splitViewController = [[UISplitViewController alloc] init];
73-
UIViewController *detailViewController =
74-
[demoData.firstDemo createViewControllerForSplitView:splitViewController];
75-
splitViewController.delegate = _splitViewManager;
76-
splitViewController.viewControllers = @[ masterNavigationController, detailViewController ];
77-
self.window.rootViewController = splitViewController;
58+
self.window.rootViewController = masterNavigationController;
7859

7960
[self.window makeKeyAndVisible];
8061

GooglePlaces/GooglePlacesDemos/DemoData.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#import <UIKit/UIKit.h>
1717

18+
#import <GooglePlaces/GooglePlaces.h>
19+
1820
/*
1921
* This file contains a set of data objects which represent the list of demos which are provided by
2022
* this sample app.
@@ -43,10 +45,12 @@
4345
* Construct and return a new UIViewController instance which contains the view to present when the
4446
* demo is selected from the list.
4547
*
46-
* @param splitViewController The |UISplitViewController| in which the demo will be presented. NOTE:
47-
* This may be nil.
48+
* @param autocompleteFilter The |GMSAutocompleteFilter| that filters on types and countries.
49+
* @param placeField The |GMSPlaceField| to request individual fields for the |GMSPlace| result.
4850
*/
49-
- (UIViewController *)createViewControllerForSplitView:(UISplitViewController *)splitViewController;
51+
- (UIViewController *)createViewControllerWithAutocompleteFilter:
52+
(GMSAutocompleteFilter *)autocompleteFilter
53+
placeFields:(GMSPlaceField)placeField;
5054

5155
@end
5256

0 commit comments

Comments
 (0)