Skip to content

Commit f777e9e

Browse files
chore: Update Maps, Places and Navigation samples from CocoaPods (#196)
* chore: Update Maps, Places and Navigation samples from CocoaPods * Properly specify 'project' for each podfile and move platform back. --------- Co-authored-by: Chris Woodward <[email protected]>
1 parent 23cc246 commit f777e9e

File tree

332 files changed

+11158
-502
lines changed

Some content is hidden

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

332 files changed

+11158
-502
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,56 @@ jobs:
192192
-scheme GooglePlacesSwiftXCFrameworkDemos \
193193
-destination platform\=iOS\ Simulator,OS\=13.3,name\=iPhone\ 8 build | xcpretty
194194
195+
build-GoogleNavigation:
196+
runs-on: macos-latest
197+
198+
steps:
199+
- name: Checkout repository
200+
uses: actions/checkout@v2
201+
202+
- name: Install CocoaPods
203+
run: |
204+
sudo gem install cocoapods
205+
206+
- name: Run pod install
207+
run: |
208+
pod install --project-directory=GoogleNavigation/
209+
210+
- name: Build project
211+
run: |
212+
echo "Replacing #error for API key"
213+
sed -i .prev '/#error/'d GoogleNavigation/GoogleNavXCFrameworkDemos/SDKDemoAPIKey.h
214+
215+
echo "Building"
216+
xcodebuild -workspace GoogleNavigation/GoogleNavXCFrameworkDemos.xcworkspace \
217+
-scheme GoogleNavigationXCFrameworkDemos \
218+
-destination platform\=iOS\ Simulator,OS\=13.3,name\=iPhone\ 8 build | xcpretty
219+
220+
build-GoogleNavigation-Swift:
221+
runs-on: macos-latest
222+
223+
steps:
224+
- name: Checkout repository
225+
uses: actions/checkout@v2
226+
227+
- name: Install CocoaPods
228+
run: |
229+
sudo gem install cocoapods
230+
231+
- name: Run pod install
232+
run: |
233+
pod install --project-directory=GoogleNavigation-Swift/
234+
235+
- name: Build project
236+
run: |
237+
echo "Replacing #error for API key"
238+
sed -i .prev '/#error/'d GoogleNavigation-Swift/GoogleNavSwiftXCFrameworkDemos/Swift/SDKDemoAPIKey.swift
239+
240+
echo "Building"
241+
xcodebuild -workspace GoogleNavigation-Swift/GoogleNavSwiftXCFrameworkDemos.xcworkspace \
242+
-scheme GoogleNavigationSwiftXCFrameworkDemos \
243+
-destination platform\=iOS\ Simulator,OS\=13.3,name\=iPhone\ 8 build | xcpretty
244+
195245
build-current-place-on-map:
196246
runs-on: macos-latest
197247

@@ -293,6 +343,8 @@ jobs:
293343
- build-GoogleMaps-Swift
294344
- build-GooglePlaces
295345
- build-GooglePlaces-Swift
346+
- build-GoogleNavigation
347+
- build-GoogleNavigation-Swift
296348
- build-current-place-on-map
297349
- build-map-with-marker
298350
- build-places-address-form

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos.xcodeproj/project.pbxproj

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
82043308F53102E889C6B28F /* DataDrivenStylingEventsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EF2332C983F2B61EE8D591A /* DataDrivenStylingEventsViewController.swift */; };
6464
8672736AB1BB98F58F6C5ED9 /* botswana.png in Resources */ = {isa = PBXBuildFile; fileRef = 8CB004432BC22DC920797C87 /* botswana.png */; };
6565
8CB666464C345428DFBC567C /* GMSMapStyle+Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E945C0EF87794CB7BBACB41 /* GMSMapStyle+Bundle.swift */; };
66-
9231B336F9410D85C0AC5AF6 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E435025CEF4F4BC87E93D58 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */; };
6766
968451616004D31510CD1EAF /* PanoramaServiceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E42C1CA863AAC166B9252B90 /* PanoramaServiceController.swift */; };
6867
96AC98FFADF710277E6F4309 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 6C6FC465538CF0231E3E32EF /* [email protected] */; };
6968
9A11BCC3B4489D9E4B60BEA7 /* AnimatedUIViewMarkerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FD42CF0008B034BF8B30F5 /* AnimatedUIViewMarkerViewController.swift */; };
@@ -88,6 +87,7 @@
8887
C189B19038105F2E34A0B701 /* step3.png in Resources */ = {isa = PBXBuildFile; fileRef = 77319CF4420C0C7B4DCEA208 /* step3.png */; };
8988
C337D3FCA313702C7A1A3061 /* mapstyle-retro.json in Resources */ = {isa = PBXBuildFile; fileRef = 31797C544AD8076A06525A65 /* mapstyle-retro.json */; };
9089
CC804BE5293BD23A46282C81 /* step7.png in Resources */ = {isa = PBXBuildFile; fileRef = C0845933990F09131C279FE0 /* step7.png */; };
90+
D226ADE046E5D93438137B47 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BEFC24A7401462DDF8DF585 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */; };
9191
D37965152381BD5C16808612 /* newark_nj_1922.jpg in Resources */ = {isa = PBXBuildFile; fileRef = AF18950C279249F96136B2E5 /* newark_nj_1922.jpg */; };
9292
D61609F7C244850E55D61869 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = BF473EA6BF27AF34977D2549 /* [email protected] */; };
9393
D6AD55C362293458431A7986 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = B00812547FB5EE2A04EDE46C /* [email protected] */; };
@@ -134,7 +134,6 @@
134134
392A7D132855C21094CFB021 /* australia-large.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "australia-large.png"; sourceTree = "<group>"; };
135135
3A66A9AD0A36086F2FAFAE15 /* MarkerEventsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkerEventsViewController.swift; sourceTree = "<group>"; };
136136
3A7D2BC402119B009115B458 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
137-
3E435025CEF4F4BC87E93D58 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GoogleMapsSwiftXCFrameworkDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
138137
3EB880171F8782BB95056A63 /* step5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step5.png; sourceTree = "<group>"; };
139138
401F0FC38C20C76F7D1C0A47 /* step8.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step8.png; sourceTree = "<group>"; };
140139
4162E354E88F4EFE2CF145C0 /* GoogleMapsSwiftXCFrameworkDemos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GoogleMapsSwiftXCFrameworkDemos.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -160,6 +159,8 @@
160159
78DE8670A1B9D301D6182F16 /* CustomMarkersViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMarkersViewController.swift; sourceTree = "<group>"; };
161160
79085A55DE09F8A62A9B5847 /* mapstyle-silver.json */ = {isa = PBXFileReference; lastKnownFileType = text; path = "mapstyle-silver.json"; sourceTree = "<group>"; };
162161
7AEA0F0B8CA82A47CA6E47CB /* step6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step6.png; sourceTree = "<group>"; };
162+
7BA54D48A3F05B172EB7523A /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig"; path = "Target Support Files/Pods-GoogleMapsSwiftXCFrameworkDemos/Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig"; sourceTree = "<group>"; };
163+
7BEFC24A7401462DDF8DF585 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GoogleMapsSwiftXCFrameworkDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
163164
80E098AF4C56B795EBA7E881 /* PolygonsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolygonsViewController.swift; sourceTree = "<group>"; };
164165
813AA650D6B913CB76AAAB53 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
165166
825447853189D2D4563BB028 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
@@ -174,7 +175,6 @@
174175
977C1755E05CB7EA2762CA06 /* DataDrivenStylingSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataDrivenStylingSearchViewController.swift; sourceTree = "<group>"; };
175176
9862C46F7F70E4C7EF238EA6 /* CustomIndoorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomIndoorViewController.swift; sourceTree = "<group>"; };
176177
98E9B6EA859BE405346819D9 /* MapTypesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTypesViewController.swift; sourceTree = "<group>"; };
177-
9A14E4160277506E25D036FD /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig"; path = "Target Support Files/Pods-GoogleMapsSwiftXCFrameworkDemos/Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig"; sourceTree = "<group>"; };
178178
9D352205B6B3A8624B7640B1 /* VisibleRegionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisibleRegionViewController.swift; sourceTree = "<group>"; };
179179
9F85E37BBCF08547A4D6D1EB /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
180180
A489BF0E3CECC559937A38D1 /* arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow.png; sourceTree = "<group>"; };
@@ -224,7 +224,7 @@
224224
buildActionMask = 2147483647;
225225
files = (
226226
78D1E74704B5966731F0EAFD /* UIKit.framework in Frameworks */,
227-
9231B336F9410D85C0AC5AF6 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a in Frameworks */,
227+
D226ADE046E5D93438137B47 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a in Frameworks */,
228228
);
229229
runOnlyForDeploymentPostprocessing = 0;
230230
};
@@ -235,20 +235,11 @@
235235
isa = PBXGroup;
236236
children = (
237237
813AA650D6B913CB76AAAB53 /* UIKit.framework */,
238-
3E435025CEF4F4BC87E93D58 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */,
238+
7BEFC24A7401462DDF8DF585 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */,
239239
);
240240
name = Frameworks;
241241
sourceTree = "<group>";
242242
};
243-
3C21D7D528A2D38D67C35B40 /* Pods */ = {
244-
isa = PBXGroup;
245-
children = (
246-
9A14E4160277506E25D036FD /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */,
247-
);
248-
name = Pods;
249-
path = Pods;
250-
sourceTree = "<group>";
251-
};
252243
66BBCDCC5A47AE0211100656 /* Source */ = {
253244
isa = PBXGroup;
254245
children = (
@@ -391,7 +382,7 @@
391382
66BBCDCC5A47AE0211100656 /* Source */,
392383
1770C8310E66B2F5721EFB53 /* Frameworks */,
393384
C28851C9B618723E4F44AB23 /* Products */,
394-
3C21D7D528A2D38D67C35B40 /* Pods */,
385+
DFF487FAB21A4514DB087C93 /* Pods */,
395386
);
396387
sourceTree = "<group>";
397388
};
@@ -407,18 +398,27 @@
407398
path = Swift;
408399
sourceTree = "<group>";
409400
};
401+
DFF487FAB21A4514DB087C93 /* Pods */ = {
402+
isa = PBXGroup;
403+
children = (
404+
7BA54D48A3F05B172EB7523A /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */,
405+
);
406+
name = Pods;
407+
path = Pods;
408+
sourceTree = "<group>";
409+
};
410410
/* End PBXGroup section */
411411

412412
/* Begin PBXNativeTarget section */
413413
B9438E618FB390D6355C2B57 /* GoogleMapsSwiftXCFrameworkDemos */ = {
414414
isa = PBXNativeTarget;
415415
buildConfigurationList = 5AC1A4250158D74DFA863CCE /* Build configuration list for PBXNativeTarget "GoogleMapsSwiftXCFrameworkDemos" */;
416416
buildPhases = (
417-
C35727428108954F084870AD /* [CP] Check Pods Manifest.lock */,
417+
EE36563A6BDD42FA7CD3420C /* [CP] Check Pods Manifest.lock */,
418418
3F21832F0D03F8AC6CEF22A0 /* Resources */,
419419
BA0F106D7033E3A8544A3F80 /* Sources */,
420420
D163048ECCA404350BF50B51 /* Frameworks */,
421-
06B5175459B7D2FC50E31289 /* [CP] Copy Pods Resources */,
421+
CB2FB8198369EDECA4475710 /* [CP] Copy Pods Resources */,
422422
);
423423
buildRules = (
424424
);
@@ -518,7 +518,7 @@
518518
/* End PBXResourcesBuildPhase section */
519519

520520
/* Begin PBXShellScriptBuildPhase section */
521-
06B5175459B7D2FC50E31289 /* [CP] Copy Pods Resources */ = {
521+
CB2FB8198369EDECA4475710 /* [CP] Copy Pods Resources */ = {
522522
isa = PBXShellScriptBuildPhase;
523523
buildActionMask = 2147483647;
524524
files = (
@@ -540,7 +540,7 @@
540540
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GoogleMapsSwiftXCFrameworkDemos/Pods-GoogleMapsSwiftXCFrameworkDemos-resources.sh\"\n";
541541
showEnvVarsInLog = 0;
542542
};
543-
C35727428108954F084870AD /* [CP] Check Pods Manifest.lock */ = {
543+
EE36563A6BDD42FA7CD3420C /* [CP] Check Pods Manifest.lock */ = {
544544
isa = PBXShellScriptBuildPhase;
545545
buildActionMask = 2147483647;
546546
files = (
@@ -624,14 +624,14 @@
624624
/* Begin XCBuildConfiguration section */
625625
060E158855CB2E3846F43DB2 /* Default */ = {
626626
isa = XCBuildConfiguration;
627-
baseConfigurationReference = 9A14E4160277506E25D036FD /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */;
627+
baseConfigurationReference = 7BA54D48A3F05B172EB7523A /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */;
628628
buildSettings = {
629629
"ARCHS[sdk=iphonesimulator*]" = x86_64;
630630
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
631631
CLANG_ENABLE_OBJC_ARC = YES;
632632
CODE_SIGN_IDENTITY = "iPhone Developer";
633633
INFOPLIST_FILE = ./GoogleMapsSwiftXCFrameworkDemos/Info.plist;
634-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
634+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
635635
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
636636
LIBRARY_SEARCH_PATHS = (
637637
.,

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/SampleListViewController.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extension SampleListViewController: UITableViewDelegate {
8080
shouldCollapseDetailViewController = false
8181
tableView.deselectRow(at: indexPath, animated: true)
8282
if let sample = sample(at: indexPath) {
83-
let viewController = sample.viewControllerClass.init()
83+
let viewController = sample.viewController
8484
viewController.title = sample.title
8585
let navController = UINavigationController(rootViewController: viewController)
8686
navController.navigationBar.isTranslucent = false
@@ -135,7 +135,6 @@ extension SampleListViewController: UISearchResultsUpdating {
135135

136136
extension Sample {
137137
func matches(_ filter: String) -> Bool {
138-
return title.lowercased().contains(filter)
139-
|| String(describing: viewControllerClass).lowercased().contains(filter)
138+
return searchString.lowercased().contains(filter)
140139
}
141140
}

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/AnimatedCurrentLocationViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ final class AnimatedCurrentLocationViewController: UIViewController {
2828
override func loadView() {
2929
mapView.settings.myLocationButton = false
3030
mapView.settings.indoorPicker = false
31+
32+
// Opt the MapView into automatic dark mode switching.
33+
mapView.overrideUserInterfaceStyle = .unspecified
34+
3135
view = mapView
3236
}
3337

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/AnimatedUIViewMarkerViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class AnimatedUIViewMarkerViewController: UIViewController {
2525
private var infoView: UIImageView?
2626

2727
override func loadView() {
28+
// Opt the MapView into automatic dark mode switching.
29+
mapView.overrideUserInterfaceStyle = .unspecified
30+
2831
view = mapView
2932
mapView.delegate = self
3033
}

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/BasicMapViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class BasicMapViewController: UIViewController {
2323
// Seattle coordinates
2424
let camera = GMSCameraPosition(latitude: 47.6089945, longitude: -122.3410462, zoom: 14)
2525
let mapView = GMSMapView(frame: view.bounds, camera: camera)
26+
27+
// Opt the MapView into automatic dark mode switching.
28+
mapView.overrideUserInterfaceStyle = .unspecified
29+
2630
mapView.delegate = self
2731
view = mapView
2832
navigationController?.navigationBar.isTranslucent = false

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/CameraViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class CameraViewController: UIViewController {
3030
private var timer: Timer?
3131

3232
override func loadView() {
33+
// Opt the MapView into automatic dark mode switching.
34+
mapView.overrideUserInterfaceStyle = .unspecified
35+
3336
mapView.settings.zoomGestures = false
3437
mapView.settings.scrollGestures = false
3538
mapView.settings.rotateGestures = false

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/CustomIndoorViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extension CustomIndoorViewController: GMSIndoorDisplayDelegate {
7373
self.sampleLevels = sampleLevels
7474

7575
levelPickerView.reloadAllComponents()
76-
levelPickerView.selectRow(-1, inComponent: 0, animated: false)
76+
levelPickerView.selectRow(0, inComponent: 0, animated: false)
7777
}
7878

7979
func didChangeActiveLevel(_ level: GMSIndoorLevel?) {

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/CustomMarkersViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class CustomMarkersViewController: UIViewController {
2424
}()
2525

2626
override func loadView() {
27+
// Opt the MapView into automatic dark mode switching.
28+
mapView.overrideUserInterfaceStyle = .unspecified
29+
2730
view = mapView
2831
addDefaultMarkers()
2932
navigationController?.navigationBar.isTranslucent = false

GoogleMaps-Swift/GoogleMapsSwiftXCFrameworkDemos/Swift/Samples/DoubleMapViewController.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@ class DoubleMapViewController: UIViewController {
2020
latitude: 37.7847, longitude: -122.41, zoom: 5)
2121
private lazy var mapView: GMSMapView = {
2222
let mapView = GMSMapView(frame: .zero, camera: sanFranciscoCamera)
23+
24+
// Opt the MapView into automatic dark mode switching.
25+
mapView.overrideUserInterfaceStyle = .unspecified
26+
2327
return mapView
2428
}()
2529
private lazy var boundMapView: GMSMapView = {
2630
let mapView = GMSMapView(frame: .zero, camera: sanFranciscoCamera)
31+
32+
// Opt the MapView into automatic dark mode switching.
33+
mapView.overrideUserInterfaceStyle = .unspecified
34+
2735
return mapView
2836
}()
2937

0 commit comments

Comments
 (0)