Skip to content

Commit

Permalink
chore: Update Maps and Places samples from CocoaPods (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
googlemaps-bot authored Oct 5, 2023
1 parent ac61f0d commit 56b5831
Show file tree
Hide file tree
Showing 22 changed files with 497 additions and 421 deletions.
40 changes: 20 additions & 20 deletions GoogleMaps-Swift/GoogleMapsSwiftDemos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
87710C46AFF873B391259D34 /* argentina-large.png in Resources */ = {isa = PBXBuildFile; fileRef = 0EDDB89D7FC679C6141D5F7F /* argentina-large.png */; };
89361183BB2BF64F4847DA32 /* argentina.png in Resources */ = {isa = PBXBuildFile; fileRef = 822521FD132C2E44D03EE0E8 /* argentina.png */; };
8CAB00DE9E5AFE66057884A4 /* botswana-large.png in Resources */ = {isa = PBXBuildFile; fileRef = F531ABFE1A21DA26444A02BC /* botswana-large.png */; };
95CF5E70DD685CF5930FED3F /* libPods-GoogleMapsSwiftDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2711077F7697311AFA5589AB /* libPods-GoogleMapsSwiftDemos.a */; };
97DD9977EC5047161D0F7A40 /* GroundOverlayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 922B67562D8E4B0D00C7B4BB /* GroundOverlayViewController.swift */; };
9B820E7BA576743B85114CB7 /* GestureControlViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE84B21AF0FE670AF73B8015 /* GestureControlViewController.swift */; };
9DDFC10B53970CA1F0007AF5 /* MarkersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ED4F2473A7C9EB8BA05986B /* MarkersViewController.swift */; };
Expand Down Expand Up @@ -92,6 +91,7 @@
DC204BFAEB6DCDA7F7610536 /* GMSMapStyle+Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A9A391184A7EAD7C072E62 /* GMSMapStyle+Bundle.swift */; };
DFBE1D0F69ADD7B44416635D /* MapTypesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB2B29C49F7B36D477192D04 /* MapTypesViewController.swift */; };
E31E402B435CE656EAF45BD6 /* CustomIndoorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B08A9836FC58ADF5E6C36DC /* CustomIndoorViewController.swift */; };
E3B3A787ED3769885A4481CD /* libPods-GoogleMapsSwiftDemos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 36FB7115F969FAB84CDCB92A /* libPods-GoogleMapsSwiftDemos.a */; };
E3D9CA39859BD1CDB3863347 /* FitBoundsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBE707A4130CDA88BBCC2DD4 /* FitBoundsViewController.swift */; };
E899CA016F483DAF0998CF6B /* mapstyle-retro.json in Resources */ = {isa = PBXBuildFile; fileRef = 8E0F7227CD83A68A40D74050 /* mapstyle-retro.json */; };
E9EC783AAF928C3E9F018D40 /* step8.png in Resources */ = {isa = PBXBuildFile; fileRef = EFD1B4A1869A5ED24977724F /* step8.png */; };
Expand All @@ -116,18 +116,19 @@
0EDDB89D7FC679C6141D5F7F /* argentina-large.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "argentina-large.png"; sourceTree = "<group>"; };
1730B1B4AD1EF5754F84355B /* FixedPanoramaViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FixedPanoramaViewController.swift; sourceTree = "<group>"; };
17C7DF8FF79FD6CE7012853F /* step4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step4.png; sourceTree = "<group>"; };
19D8B93DA5BF2119B4344281 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsSwiftDemos.default.xcconfig"; path = "Target Support Files/Pods-GoogleMapsSwiftDemos/Pods-GoogleMapsSwiftDemos.default.xcconfig"; sourceTree = "<group>"; };
1DE0C90254383DA8C437CD0A /* MapsDemoAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = MapsDemoAssets.xcassets; sourceTree = "<group>"; };
1EAC16DE0E8CC752D17EB04A /* aeroplane@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "aeroplane@2x.png"; sourceTree = "<group>"; };
221F6743F6F3DB331816D7D3 /* arrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow@2x.png"; sourceTree = "<group>"; };
24E0C7EAB68D8720DCB2CAC0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
24E559AA1425536C6D0ACF0D /* step5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = step5.png; sourceTree = "<group>"; };
2566CE33406BE9F4AE26CFC0 /* AnimatedCurrentLocationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimatedCurrentLocationViewController.swift; sourceTree = "<group>"; };
2711077F7697311AFA5589AB /* libPods-GoogleMapsSwiftDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GoogleMapsSwiftDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
27D56F2A707892084368A7E2 /* bulgaria-large.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bulgaria-large.png"; sourceTree = "<group>"; };
2A5B8956E7E8B6AF430CC416 /* voyager.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = voyager.png; sourceTree = "<group>"; };
2C8E6590B2109C88BF5DF3BF /* australia-large@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "australia-large@2x.png"; sourceTree = "<group>"; };
2D48B3FFC6D573CF2673D451 /* popup_santa.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = popup_santa.png; sourceTree = "<group>"; };
30CF698467FA9E7F200017B3 /* mapstyle-silver.json */ = {isa = PBXFileReference; lastKnownFileType = text; path = "mapstyle-silver.json"; sourceTree = "<group>"; };
36FB7115F969FAB84CDCB92A /* libPods-GoogleMapsSwiftDemos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GoogleMapsSwiftDemos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B0F56EA0940A859776C9DD3 /* track.json */ = {isa = PBXFileReference; lastKnownFileType = text; path = track.json; sourceTree = "<group>"; };
3B919F5AC728E794E349D4A3 /* SampleLevel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleLevel.swift; sourceTree = "<group>"; };
3EA1DB5D699D162AC375E1C9 /* StyledMapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StyledMapViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -169,7 +170,6 @@
962C5BE26208B06737B4653C /* TileLayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TileLayerViewController.swift; sourceTree = "<group>"; };
996FCE46D4BD31A4E02C2473 /* h1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = h1.png; sourceTree = "<group>"; };
9DEB41AE386954E4085FAA85 /* MapLayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapLayerViewController.swift; sourceTree = "<group>"; };
A14E794B17D957FCB1A20246 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoogleMapsSwiftDemos.default.xcconfig"; path = "Target Support Files/Pods-GoogleMapsSwiftDemos/Pods-GoogleMapsSwiftDemos.default.xcconfig"; sourceTree = "<group>"; };
A29805B04CA5A5071F63E40F /* arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow.png; sourceTree = "<group>"; };
A6181B3AED573910BA0F2D6B /* PaddingBehaviorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaddingBehaviorViewController.swift; sourceTree = "<group>"; };
ABD5CD72476857CF2A348366 /* MarkerLayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkerLayerViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -216,22 +216,13 @@
buildActionMask = 2147483647;
files = (
4EA38ACBC98F34B1F0AF5BDD /* UIKit.framework in Frameworks */,
95CF5E70DD685CF5930FED3F /* libPods-GoogleMapsSwiftDemos.a in Frameworks */,
E3B3A787ED3769885A4481CD /* libPods-GoogleMapsSwiftDemos.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
26F592F5BB1E8A4BF41291D6 /* Pods */ = {
isa = PBXGroup;
children = (
A14E794B17D957FCB1A20246 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
77BA0496CE92FC06E4C6A5D5 /* GoogleMapsSwiftDemos */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -307,7 +298,7 @@
isa = PBXGroup;
children = (
922338CA529F228A03DE6422 /* UIKit.framework */,
2711077F7697311AFA5589AB /* libPods-GoogleMapsSwiftDemos.a */,
36FB7115F969FAB84CDCB92A /* libPods-GoogleMapsSwiftDemos.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -326,7 +317,7 @@
D0ED9A279E12177F7FDFA2FF /* Source */,
AC723F443153D968479E59F3 /* Frameworks */,
DD0B6FB690051F4443F4132B /* Products */,
26F592F5BB1E8A4BF41291D6 /* Pods */,
E8482B677CDFAD11AD0CF175 /* Pods */,
);
sourceTree = "<group>";
};
Expand All @@ -338,6 +329,15 @@
name = Products;
sourceTree = "<group>";
};
E8482B677CDFAD11AD0CF175 /* Pods */ = {
isa = PBXGroup;
children = (
19D8B93DA5BF2119B4344281 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
E8E5C8B67F417779B6FF93C4 /* Resources */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -409,11 +409,11 @@
isa = PBXNativeTarget;
buildConfigurationList = 65556A7591C40D0E8B77989F /* Build configuration list for PBXNativeTarget "GoogleMapsSwiftDemos" */;
buildPhases = (
18657CB41BE1D0277DAE69F0 /* [CP] Check Pods Manifest.lock */,
0A2324DBEFF8D1A688DB9330 /* [CP] Check Pods Manifest.lock */,
2ADDADBB329E244AF7ED1FB2 /* Resources */,
22EB17F407E92B9B4F3B601A /* Sources */,
B4530C282FE2BDE3D1071779 /* Frameworks */,
452C9DB61EF3CC1CE3565586 /* [CP] Copy Pods Resources */,
A6455A5AF886AD347389BC96 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -513,7 +513,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
18657CB41BE1D0277DAE69F0 /* [CP] Check Pods Manifest.lock */ = {
0A2324DBEFF8D1A688DB9330 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -535,7 +535,7 @@
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";
showEnvVarsInLog = 0;
};
452C9DB61EF3CC1CE3565586 /* [CP] Copy Pods Resources */ = {
A6455A5AF886AD347389BC96 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down Expand Up @@ -625,7 +625,7 @@
};
6798450D013ACAFF39CF0187 /* Default */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A14E794B17D957FCB1A20246 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */;
baseConfigurationReference = 19D8B93DA5BF2119B4344281 /* Pods-GoogleMapsSwiftDemos.default.xcconfig */;
buildSettings = {
"ARCHS[sdk=iphonesimulator*]" = x86_64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class SampleListViewController: UIViewController {

let sampleSections = Samples.allSamples()
lazy var tableView: UITableView = UITableView()
var shouldCollapseDetailViewController = true

override func viewDidLoad() {
super.viewDidLoad()
Expand Down Expand Up @@ -69,11 +70,38 @@ extension SampleListViewController: UITableViewDataSource {

extension SampleListViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
shouldCollapseDetailViewController = false
tableView.deselectRow(at: indexPath, animated: true)
if let sample = sample(at: indexPath) {
let viewController = sample.viewControllerClass.init()
viewController.title = sample.title
navigationController?.pushViewController(viewController, animated: true)
let navController = UINavigationController(rootViewController: viewController)
navController.navigationBar.isTranslucent = false
showDetailViewController(navController, sender: self)
}
}
}

extension SampleListViewController: UISplitViewControllerDelegate {
func primaryViewController(forExpanding splitViewController: UISplitViewController)
-> UIViewController?
{
tableView.reloadData()
return nil
}

func primaryViewController(forCollapsing splitViewController: UISplitViewController)
-> UIViewController?
{
tableView.reloadData()
return nil
}

func splitViewController(
_ splitViewController: UISplitViewController,
collapseSecondary secondaryViewController: UIViewController,
onto primaryViewController: UIViewController
) -> Bool {
return shouldCollapseDetailViewController
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extension StructuredGeocoderViewController: GMSMapViewDelegate {
snippet.append("subLocality: \(subLocality)\n")
}
if let locality = address.locality {
snippet.append("subLocality: \(locality)\n")
snippet.append("locality: \(locality)\n")
}
if let administrativeArea = address.administrativeArea {
snippet.append("administrativeArea: \(administrativeArea)\n")
Expand Down
16 changes: 7 additions & 9 deletions GoogleMaps-Swift/GoogleMapsSwiftDemos/Swift/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
guard let scene = scene as? UIWindowScene else { return }
window = .init(windowScene: scene)

// On iOS 15, continue to use opaque navigation bars like earlier iOS versions.
if #available(iOS 15.0, *) {
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.configureWithOpaqueBackground()
UINavigationBar.appearance().standardAppearance = navBarAppearance
UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance
}

let sampleListViewController = SampleListViewController()
let navigationController = UINavigationController(rootViewController: sampleListViewController)
window?.rootViewController = navigationController
let detailController = UIViewController()
let splitViewController = UISplitViewController()

splitViewController.delegate = sampleListViewController
splitViewController.preferredDisplayMode = .oneBesideSecondary
splitViewController.viewControllers = [navigationController, detailController]
window?.rootViewController = splitViewController
window?.makeKeyAndVisible()
}
}
2 changes: 1 addition & 1 deletion GoogleMaps-Swift/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ source 'https://github.com/CocoaPods/Specs.git'

target 'GoogleMapsSwiftDemos' do
platform :ios, '14.0'
pod 'GoogleMaps', '= 8.0.0'
pod 'GoogleMaps', '= 8.2.0'
end
Loading

0 comments on commit 56b5831

Please sign in to comment.