Skip to content

Commit

Permalink
chore: Update Maps, Places and Navigation samples from CocoaPods (#196)
Browse files Browse the repository at this point in the history
* chore: Update Maps, Places and Navigation samples from CocoaPods

* Properly specify 'project' for each podfile and move platform back.

---------

Co-authored-by: Chris Woodward <chriswoodward@google.com>
  • Loading branch information
googlemaps-bot and cwoodwar6 committed Jun 14, 2024
1 parent 23cc246 commit f777e9e
Show file tree
Hide file tree
Showing 332 changed files with 11,158 additions and 502 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,56 @@ jobs:
-scheme GooglePlacesSwiftXCFrameworkDemos \
-destination platform\=iOS\ Simulator,OS\=13.3,name\=iPhone\ 8 build | xcpretty
build-GoogleNavigation:
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install CocoaPods
run: |
sudo gem install cocoapods
- name: Run pod install
run: |
pod install --project-directory=GoogleNavigation/
- name: Build project
run: |
echo "Replacing #error for API key"
sed -i .prev '/#error/'d GoogleNavigation/GoogleNavXCFrameworkDemos/SDKDemoAPIKey.h
echo "Building"
xcodebuild -workspace GoogleNavigation/GoogleNavXCFrameworkDemos.xcworkspace \
-scheme GoogleNavigationXCFrameworkDemos \
-destination platform\=iOS\ Simulator,OS\=13.3,name\=iPhone\ 8 build | xcpretty
build-GoogleNavigation-Swift:
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install CocoaPods
run: |
sudo gem install cocoapods
- name: Run pod install
run: |
pod install --project-directory=GoogleNavigation-Swift/
- name: Build project
run: |
echo "Replacing #error for API key"
sed -i .prev '/#error/'d GoogleNavigation-Swift/GoogleNavSwiftXCFrameworkDemos/Swift/SDKDemoAPIKey.swift
echo "Building"
xcodebuild -workspace GoogleNavigation-Swift/GoogleNavSwiftXCFrameworkDemos.xcworkspace \
-scheme GoogleNavigationSwiftXCFrameworkDemos \
-destination platform\=iOS\ Simulator,OS\=13.3,name\=iPhone\ 8 build | xcpretty
build-current-place-on-map:
runs-on: macos-latest

Expand Down Expand Up @@ -293,6 +343,8 @@ jobs:
- build-GoogleMaps-Swift
- build-GooglePlaces
- build-GooglePlaces-Swift
- build-GoogleNavigation
- build-GoogleNavigation-Swift
- build-current-place-on-map
- build-map-with-marker
- build-places-address-form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
82043308F53102E889C6B28F /* DataDrivenStylingEventsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EF2332C983F2B61EE8D591A /* DataDrivenStylingEventsViewController.swift */; };
8672736AB1BB98F58F6C5ED9 /* botswana.png in Resources */ = {isa = PBXBuildFile; fileRef = 8CB004432BC22DC920797C87 /* botswana.png */; };
8CB666464C345428DFBC567C /* GMSMapStyle+Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E945C0EF87794CB7BBACB41 /* GMSMapStyle+Bundle.swift */; };
9231B336F9410D85C0AC5AF6 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E435025CEF4F4BC87E93D58 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */; };
968451616004D31510CD1EAF /* PanoramaServiceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E42C1CA863AAC166B9252B90 /* PanoramaServiceController.swift */; };
96AC98FFADF710277E6F4309 /* boat@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C6FC465538CF0231E3E32EF /* boat@2x.png */; };
9A11BCC3B4489D9E4B60BEA7 /* AnimatedUIViewMarkerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FD42CF0008B034BF8B30F5 /* AnimatedUIViewMarkerViewController.swift */; };
Expand All @@ -88,6 +87,7 @@
C189B19038105F2E34A0B701 /* step3.png in Resources */ = {isa = PBXBuildFile; fileRef = 77319CF4420C0C7B4DCEA208 /* step3.png */; };
C337D3FCA313702C7A1A3061 /* mapstyle-retro.json in Resources */ = {isa = PBXBuildFile; fileRef = 31797C544AD8076A06525A65 /* mapstyle-retro.json */; };
CC804BE5293BD23A46282C81 /* step7.png in Resources */ = {isa = PBXBuildFile; fileRef = C0845933990F09131C279FE0 /* step7.png */; };
D226ADE046E5D93438137B47 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BEFC24A7401462DDF8DF585 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */; };
D37965152381BD5C16808612 /* newark_nj_1922.jpg in Resources */ = {isa = PBXBuildFile; fileRef = AF18950C279249F96136B2E5 /* newark_nj_1922.jpg */; };
D61609F7C244850E55D61869 /* step2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BF473EA6BF27AF34977D2549 /* step2@2x.png */; };
D6AD55C362293458431A7986 /* step5@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B00812547FB5EE2A04EDE46C /* step5@2x.png */; };
Expand Down Expand Up @@ -134,7 +134,6 @@
392A7D132855C21094CFB021 /* australia-large.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "australia-large.png"; sourceTree = "<group>"; };
3A66A9AD0A36086F2FAFAE15 /* MarkerEventsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkerEventsViewController.swift; sourceTree = "<group>"; };
3A7D2BC402119B009115B458 /* walking_dot@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "walking_dot@3x.png"; sourceTree = "<group>"; };
3E435025CEF4F4BC87E93D58 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GoogleMapsSwiftXCFrameworkDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3EB880171F8782BB95056A63 /* step5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step5.png; sourceTree = "<group>"; };
401F0FC38C20C76F7D1C0A47 /* step8.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step8.png; sourceTree = "<group>"; };
4162E354E88F4EFE2CF145C0 /* GoogleMapsSwiftXCFrameworkDemos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GoogleMapsSwiftXCFrameworkDemos.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -160,6 +159,8 @@
78DE8670A1B9D301D6182F16 /* CustomMarkersViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMarkersViewController.swift; sourceTree = "<group>"; };
79085A55DE09F8A62A9B5847 /* mapstyle-silver.json */ = {isa = PBXFileReference; lastKnownFileType = text; path = "mapstyle-silver.json"; sourceTree = "<group>"; };
7AEA0F0B8CA82A47CA6E47CB /* step6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step6.png; sourceTree = "<group>"; };
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>"; };
7BEFC24A7401462DDF8DF585 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GoogleMapsSwiftXCFrameworkDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
80E098AF4C56B795EBA7E881 /* PolygonsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolygonsViewController.swift; sourceTree = "<group>"; };
813AA650D6B913CB76AAAB53 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
825447853189D2D4563BB028 /* step3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "step3@2x.png"; sourceTree = "<group>"; };
Expand All @@ -174,7 +175,6 @@
977C1755E05CB7EA2762CA06 /* DataDrivenStylingSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataDrivenStylingSearchViewController.swift; sourceTree = "<group>"; };
9862C46F7F70E4C7EF238EA6 /* CustomIndoorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomIndoorViewController.swift; sourceTree = "<group>"; };
98E9B6EA859BE405346819D9 /* MapTypesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTypesViewController.swift; sourceTree = "<group>"; };
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>"; };
9D352205B6B3A8624B7640B1 /* VisibleRegionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisibleRegionViewController.swift; sourceTree = "<group>"; };
9F85E37BBCF08547A4D6D1EB /* aeroplane@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "aeroplane@2x.png"; sourceTree = "<group>"; };
A489BF0E3CECC559937A38D1 /* arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow.png; sourceTree = "<group>"; };
Expand Down Expand Up @@ -224,7 +224,7 @@
buildActionMask = 2147483647;
files = (
78D1E74704B5966731F0EAFD /* UIKit.framework in Frameworks */,
9231B336F9410D85C0AC5AF6 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a in Frameworks */,
D226ADE046E5D93438137B47 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -235,20 +235,11 @@
isa = PBXGroup;
children = (
813AA650D6B913CB76AAAB53 /* UIKit.framework */,
3E435025CEF4F4BC87E93D58 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */,
7BEFC24A7401462DDF8DF585 /* libPods-GoogleMapsSwiftXCFrameworkDemos.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
3C21D7D528A2D38D67C35B40 /* Pods */ = {
isa = PBXGroup;
children = (
9A14E4160277506E25D036FD /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
66BBCDCC5A47AE0211100656 /* Source */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -391,7 +382,7 @@
66BBCDCC5A47AE0211100656 /* Source */,
1770C8310E66B2F5721EFB53 /* Frameworks */,
C28851C9B618723E4F44AB23 /* Products */,
3C21D7D528A2D38D67C35B40 /* Pods */,
DFF487FAB21A4514DB087C93 /* Pods */,
);
sourceTree = "<group>";
};
Expand All @@ -407,18 +398,27 @@
path = Swift;
sourceTree = "<group>";
};
DFF487FAB21A4514DB087C93 /* Pods */ = {
isa = PBXGroup;
children = (
7BA54D48A3F05B172EB7523A /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
B9438E618FB390D6355C2B57 /* GoogleMapsSwiftXCFrameworkDemos */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5AC1A4250158D74DFA863CCE /* Build configuration list for PBXNativeTarget "GoogleMapsSwiftXCFrameworkDemos" */;
buildPhases = (
C35727428108954F084870AD /* [CP] Check Pods Manifest.lock */,
EE36563A6BDD42FA7CD3420C /* [CP] Check Pods Manifest.lock */,
3F21832F0D03F8AC6CEF22A0 /* Resources */,
BA0F106D7033E3A8544A3F80 /* Sources */,
D163048ECCA404350BF50B51 /* Frameworks */,
06B5175459B7D2FC50E31289 /* [CP] Copy Pods Resources */,
CB2FB8198369EDECA4475710 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -518,7 +518,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
06B5175459B7D2FC50E31289 /* [CP] Copy Pods Resources */ = {
CB2FB8198369EDECA4475710 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -540,7 +540,7 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GoogleMapsSwiftXCFrameworkDemos/Pods-GoogleMapsSwiftXCFrameworkDemos-resources.sh\"\n";
showEnvVarsInLog = 0;
};
C35727428108954F084870AD /* [CP] Check Pods Manifest.lock */ = {
EE36563A6BDD42FA7CD3420C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down Expand Up @@ -624,14 +624,14 @@
/* Begin XCBuildConfiguration section */
060E158855CB2E3846F43DB2 /* Default */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9A14E4160277506E25D036FD /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */;
baseConfigurationReference = 7BA54D48A3F05B172EB7523A /* Pods-GoogleMapsSwiftXCFrameworkDemos.default.xcconfig */;
buildSettings = {
"ARCHS[sdk=iphonesimulator*]" = x86_64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = ./GoogleMapsSwiftXCFrameworkDemos/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extension SampleListViewController: UITableViewDelegate {
shouldCollapseDetailViewController = false
tableView.deselectRow(at: indexPath, animated: true)
if let sample = sample(at: indexPath) {
let viewController = sample.viewControllerClass.init()
let viewController = sample.viewController
viewController.title = sample.title
let navController = UINavigationController(rootViewController: viewController)
navController.navigationBar.isTranslucent = false
Expand Down Expand Up @@ -135,7 +135,6 @@ extension SampleListViewController: UISearchResultsUpdating {

extension Sample {
func matches(_ filter: String) -> Bool {
return title.lowercased().contains(filter)
|| String(describing: viewControllerClass).lowercased().contains(filter)
return searchString.lowercased().contains(filter)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ final class AnimatedCurrentLocationViewController: UIViewController {
override func loadView() {
mapView.settings.myLocationButton = false
mapView.settings.indoorPicker = false

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

view = mapView
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class AnimatedUIViewMarkerViewController: UIViewController {
private var infoView: UIImageView?

override func loadView() {
// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

view = mapView
mapView.delegate = self
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class BasicMapViewController: UIViewController {
// Seattle coordinates
let camera = GMSCameraPosition(latitude: 47.6089945, longitude: -122.3410462, zoom: 14)
let mapView = GMSMapView(frame: view.bounds, camera: camera)

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

mapView.delegate = self
view = mapView
navigationController?.navigationBar.isTranslucent = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class CameraViewController: UIViewController {
private var timer: Timer?

override func loadView() {
// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

mapView.settings.zoomGestures = false
mapView.settings.scrollGestures = false
mapView.settings.rotateGestures = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extension CustomIndoorViewController: GMSIndoorDisplayDelegate {
self.sampleLevels = sampleLevels

levelPickerView.reloadAllComponents()
levelPickerView.selectRow(-1, inComponent: 0, animated: false)
levelPickerView.selectRow(0, inComponent: 0, animated: false)
}

func didChangeActiveLevel(_ level: GMSIndoorLevel?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class CustomMarkersViewController: UIViewController {
}()

override func loadView() {
// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

view = mapView
addDefaultMarkers()
navigationController?.navigationBar.isTranslucent = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@ class DoubleMapViewController: UIViewController {
latitude: 37.7847, longitude: -122.41, zoom: 5)
private lazy var mapView: GMSMapView = {
let mapView = GMSMapView(frame: .zero, camera: sanFranciscoCamera)

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

return mapView
}()
private lazy var boundMapView: GMSMapView = {
let mapView = GMSMapView(frame: .zero, camera: sanFranciscoCamera)

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

return mapView
}()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class FitBoundsViewController: UIViewController {
mapView.delegate = self
view = mapView

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

// Creates a button that, when pressed, updates the camera to fit the bounds.
navigationItem.rightBarButtonItem = UIBarButtonItem(
title: "Fit Bounds", style: .plain, target: self, action: #selector(fitBounds))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class FrameRateViewController: UIViewController {
override func loadView() {
view = mapView

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

statusTextView.text = ""
statusTextView.textAlignment = .center
statusTextView.backgroundColor = UIColor(white: 1, alpha: 0.8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class GeocoderViewController: UIViewController {
override func loadView() {
view = mapView
mapView.delegate = self

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class GestureControlViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

view.addSubview(mapView)

let holder = UIView(frame: .zero)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ final class GradientPolylinesViewController: UIViewController {
}()

override func loadView() {
// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

view = mapView
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ final class GroundOverlayViewController: UIViewController {
let newark = GMSGeometryInterpolate(southWest, northEast, 0.5)
let cameraPosition = GMSCameraPosition(target: newark, zoom: 12, bearing: 0, viewingAngle: 45)
let mapView = GMSMapView(frame: .zero, camera: cameraPosition)

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

mapView.delegate = self
view = mapView

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class IndoorMuseumNavigationViewController: UIViewController {
private var sampleLevels: [SampleLevel] = []

override func loadView() {
// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

view = mapView
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class MapLayerViewController: UIViewController {

override func loadView() {
mapView.isMyLocationEnabled = true

// Opt the MapView into automatic dark mode switching.
mapView.overrideUserInterfaceStyle = .unspecified

view = mapView

navigationItem.rightBarButtonItem = UIBarButtonItem(
Expand Down
Loading

0 comments on commit f777e9e

Please sign in to comment.