Skip to content

Commit 97ec847

Browse files
authored
Merge pull request #35 from jenperson/master
Updating demo current-place-on-map to latest version of Swift
2 parents 03ad68b + 86c38cb commit 97ec847

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

tutorials/current-place-on-map/current-place-on-map.xcodeproj/project.pbxproj

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
E50C79B31E4CFDE9008ECCEB /* Sources */,
111111
E50C79B41E4CFDE9008ECCEB /* Frameworks */,
112112
E50C79B51E4CFDE9008ECCEB /* Resources */,
113-
28A75331A0C85740FDE2CED3 /* [CP] Embed Pods Frameworks */,
114113
4F509B224617E63E3CDDFD01 /* [CP] Copy Pods Resources */,
115114
);
116115
buildRules = (
@@ -135,6 +134,7 @@
135134
E50C79B61E4CFDE9008ECCEB = {
136135
CreatedOnToolsVersion = 8.2.1;
137136
DevelopmentTeam = DWAWMA8UAE;
137+
LastSwiftMigration = 1020;
138138
ProvisioningStyle = Automatic;
139139
};
140140
};
@@ -144,6 +144,7 @@
144144
developmentRegion = English;
145145
hasScannedForEncodings = 0;
146146
knownRegions = (
147+
English,
147148
en,
148149
Base,
149150
);
@@ -171,34 +172,22 @@
171172
/* End PBXResourcesBuildPhase section */
172173

173174
/* Begin PBXShellScriptBuildPhase section */
174-
28A75331A0C85740FDE2CED3 /* [CP] Embed Pods Frameworks */ = {
175-
isa = PBXShellScriptBuildPhase;
176-
buildActionMask = 2147483647;
177-
files = (
178-
);
179-
inputPaths = (
180-
);
181-
name = "[CP] Embed Pods Frameworks";
182-
outputPaths = (
183-
);
184-
runOnlyForDeploymentPostprocessing = 0;
185-
shellPath = /bin/sh;
186-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-current-place-on-map/Pods-current-place-on-map-frameworks.sh\"\n";
187-
showEnvVarsInLog = 0;
188-
};
189175
3EB66CC43E56F620340CDDC2 /* [CP] Check Pods Manifest.lock */ = {
190176
isa = PBXShellScriptBuildPhase;
191177
buildActionMask = 2147483647;
192178
files = (
193179
);
194180
inputPaths = (
181+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
182+
"${PODS_ROOT}/Manifest.lock",
195183
);
196184
name = "[CP] Check Pods Manifest.lock";
197185
outputPaths = (
186+
"$(DERIVED_FILE_DIR)/Pods-current-place-on-map-checkManifestLockResult.txt",
198187
);
199188
runOnlyForDeploymentPostprocessing = 0;
200189
shellPath = /bin/sh;
201-
shellScript = "diff \"${PODS_ROOT}/../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";
190+
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";
202191
showEnvVarsInLog = 0;
203192
};
204193
4F509B224617E63E3CDDFD01 /* [CP] Copy Pods Resources */ = {
@@ -207,13 +196,18 @@
207196
files = (
208197
);
209198
inputPaths = (
199+
"${PODS_ROOT}/Target Support Files/Pods-current-place-on-map/Pods-current-place-on-map-resources.sh",
200+
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Resources/GoogleMaps.bundle",
201+
"${PODS_ROOT}/GooglePlaces/Frameworks/GooglePlaces.framework/Resources/GooglePlaces.bundle",
210202
);
211203
name = "[CP] Copy Pods Resources";
212204
outputPaths = (
205+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle",
206+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GooglePlaces.bundle",
213207
);
214208
runOnlyForDeploymentPostprocessing = 0;
215209
shellPath = /bin/sh;
216-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-current-place-on-map/Pods-current-place-on-map-resources.sh\"\n";
210+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-current-place-on-map/Pods-current-place-on-map-resources.sh\"\n";
217211
showEnvVarsInLog = 0;
218212
};
219213
/* End PBXShellScriptBuildPhase section */
@@ -354,7 +348,8 @@
354348
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
355349
PRODUCT_BUNDLE_IDENTIFIER = "com.google.examples.current-place-on-map";
356350
PRODUCT_NAME = "$(TARGET_NAME)";
357-
SWIFT_VERSION = 3.0;
351+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
352+
SWIFT_VERSION = 5.0;
358353
};
359354
name = Debug;
360355
};
@@ -368,7 +363,8 @@
368363
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
369364
PRODUCT_BUNDLE_IDENTIFIER = "com.google.examples.current-place-on-map";
370365
PRODUCT_NAME = "$(TARGET_NAME)";
371-
SWIFT_VERSION = 3.0;
366+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
367+
SWIFT_VERSION = 5.0;
372368
};
373369
name = Release;
374370
};

tutorials/current-place-on-map/current-place-on-map/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2323
var window: UIWindow?
2424

2525

26-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
26+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2727
GMSServices.provideAPIKey("YOUR_API_KEY")
2828
GMSPlacesClient.provideAPIKey("YOUR_API_KEY")
2929
return true

tutorials/current-place-on-map/current-place-on-map/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2424
</view>
2525
<navigationItem key="navigationItem" title="Current Place on a Map" id="GD1-2H-ihf">
26-
<barButtonItem key="rightBarButtonItem" title="Get Place" style="plain" id="PNt-wg-a1x">
26+
<barButtonItem key="rightBarButtonItem" title="Get Place" id="PNt-wg-a1x">
2727
<connections>
2828
<segue destination="YkZ-iV-uZb" kind="show" identifier="segueToSelect" id="Ztj-fh-FqG"/>
2929
</connections>
@@ -54,7 +54,7 @@
5454
</navigationItem>
5555
</items>
5656
</navigationBar>
57-
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="z6F-H5-Vhi">
57+
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="z6F-H5-Vhi">
5858
<rect key="frame" x="0.0" y="108" width="375" height="559"/>
5959
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
6060
</tableView>

tutorials/current-place-on-map/current-place-on-map/MapViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ extension MapViewController: CLLocationManagerDelegate {
147147
case .authorizedAlways: fallthrough
148148
case .authorizedWhenInUse:
149149
print("Location status is OK.")
150+
@unknown default:
151+
fatalError()
150152
}
151153
}
152154

0 commit comments

Comments
 (0)