Skip to content

Commit a1501cd

Browse files
committed
finished adapting examples for Swift 2.2 / Swift 3 upcoming changes
1 parent 7ad1ce3 commit a1501cd

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

bk2ch16p687AVQueuePlayer/ch29p952AVQueuePlayer/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class ViewController: UIViewController {
170170

171171
func changed() {
172172
guard let item = self.qp.currentItem else {return}
173-
self.curnum++
173+
self.curnum += 1
174174
var arr = item.asset.commonMetadata
175175
arr = AVMetadataItem.metadataItemsFromArray(arr,
176176
withKey:AVMetadataCommonKeyTitle,

bk2ch18p713addressBook/ch31p973addressBook.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
/* Begin PBXBuildFile section */
1010
324DD41E19A4F82500E85278 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324DD41D19A4F82500E85278 /* ViewController.swift */; };
11-
32B1342E1BB9823500B0BD94 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32B1342D1BB9823500B0BD94 /* LaunchScreen.storyboard */; settings = {ASSET_TAGS = (); }; };
12-
32B134301BB9824500B0BD94 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B1342F1BB9824500B0BD94 /* AppDelegate.swift */; settings = {ASSET_TAGS = (); }; };
11+
32B1342E1BB9823500B0BD94 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32B1342D1BB9823500B0BD94 /* LaunchScreen.storyboard */; };
12+
32B134301BB9824500B0BD94 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B1342F1BB9824500B0BD94 /* AppDelegate.swift */; };
1313
C9D7D14518293B1800476387 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9D7D14318293B1800476387 /* Main.storyboard */; };
1414
C9D7D14A18293B1800476387 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9D7D14918293B1800476387 /* Assets.xcassets */; };
1515
/* End PBXBuildFile section */
@@ -230,6 +230,7 @@
230230
GCC_PRECOMPILE_PREFIX_HEADER = YES;
231231
GCC_PREFIX_HEADER = "ch31p973addressBook/ch31p973addressBook-Prefix.pch";
232232
INFOPLIST_FILE = "ch31p973addressBook/ch31p973addressBook-Info.plist";
233+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
233234
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
234235
ONLY_ACTIVE_ARCH = NO;
235236
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -248,6 +249,7 @@
248249
GCC_PRECOMPILE_PREFIX_HEADER = YES;
249250
GCC_PREFIX_HEADER = "ch31p973addressBook/ch31p973addressBook-Prefix.pch";
250251
INFOPLIST_FILE = "ch31p973addressBook/ch31p973addressBook-Info.plist";
252+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
251253
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
252254
ONLY_ACTIVE_ARCH = NO;
253255
PRODUCT_NAME = "$(TARGET_NAME)";

bk2ch18p713addressBookNew/ch31p973addressBook/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ViewController : UIViewController, CNContactPickerDelegate, CNContactViewC
7070
CNContactFamilyNameKey, CNContactGivenNameKey
7171
])
7272
matts = matts.filter{$0.familyName == "Neuburg"}
73-
guard var moi = matts.first else {
73+
guard let moi = matts.first else {
7474
print("couldn't find myself")
7575
return
7676
}
@@ -89,7 +89,7 @@ class ViewController : UIViewController, CNContactPickerDelegate, CNContactViewC
8989
stop.memory = true
9090
}
9191
}
92-
guard var moi = matt else {
92+
guard let moi = matt else {
9393
print("couldn't find myself")
9494
return
9595
}

bk2ch24p842downloader/ch37p1099downloader/MyTableViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class MyTableViewController: UITableViewController {
6161
cell.imageView!.image = nil
6262
m.task = self.downloader.download(m.picurl) { // *
6363
[weak self] url in // *
64-
m.task == nil // *
64+
m.task = nil // *
6565
if url == nil {
6666
return
6767
}

bk2ch26p878undoableDrag2/ch39p1123undoableDrag/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10109" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10083"/>
55
</dependencies>
66
<scenes>
77
<!--View Controller-->

bk2ch26p878undoableDrag4/ch39p1123undoableDrag/Base.lproj/Main.storyboard

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10109" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10083"/>
55
</dependencies>
66
<scenes>
77
<!--View Controller-->
88
<scene sceneID="ufC-wZ-h7g">
99
<objects>
10-
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="ch39p1123undoableDrag3" customModuleProvider="target" sceneMemberID="viewController">
10+
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="ch39p1123undoableDrag4" customModuleProvider="target" sceneMemberID="viewController">
1111
<layoutGuides>
1212
<viewControllerLayoutGuide type="top" id="LKo-1q-b1Y"/>
1313
<viewControllerLayoutGuide type="bottom" id="LJB-QY-TIF"/>
@@ -20,7 +20,7 @@
2020
<rect key="frame" x="98" y="72" width="125" height="110"/>
2121
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
2222
</view>
23-
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4uj-yp-XE1" customClass="MyView" customModule="ch39p1123undoableDrag3" customModuleProvider="target">
23+
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4uj-yp-XE1" customClass="MyView" customModule="ch39p1123undoableDrag4" customModuleProvider="target">
2424
<rect key="frame" x="98" y="72" width="125" height="110"/>
2525
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
2626
</view>

0 commit comments

Comments
 (0)