Skip to content

Commit 166fce5

Browse files
committed
chapter 5 examples
1 parent 1adc246 commit 166fce5

File tree

42 files changed

+1379
-54
lines changed

Some content is hidden

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

42 files changed

+1379
-54
lines changed

bk2ch05p194pointerAndKeyboardTest/PointerTest.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@
289289
CODE_SIGN_STYLE = Automatic;
290290
DEVELOPMENT_TEAM = W3LHX5RGV2;
291291
INFOPLIST_FILE = PointerTest/Info.plist;
292+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
292293
LD_RUNPATH_SEARCH_PATHS = (
293294
"$(inherited)",
294295
"@executable_path/Frameworks",
@@ -308,6 +309,7 @@
308309
CODE_SIGN_STYLE = Automatic;
309310
DEVELOPMENT_TEAM = W3LHX5RGV2;
310311
INFOPLIST_FILE = PointerTest/Info.plist;
312+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
311313
LD_RUNPATH_SEARCH_PATHS = (
312314
"$(inherited)",
313315
"@executable_path/Frameworks",

bk2ch05p194touches/ch18p533touches.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
GCC_PRECOMPILE_PREFIX_HEADER = YES;
264264
GCC_PREFIX_HEADER = "ch18p533touches/ch18p533touches-Prefix.pch";
265265
INFOPLIST_FILE = "ch18p533touches/ch18p533touches-Info.plist";
266-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
266+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
267267
LD_RUNPATH_SEARCH_PATHS = (
268268
"$(inherited)",
269269
"@executable_path/Frameworks",
@@ -285,7 +285,7 @@
285285
GCC_PRECOMPILE_PREFIX_HEADER = YES;
286286
GCC_PREFIX_HEADER = "ch18p533touches/ch18p533touches-Prefix.pch";
287287
INFOPLIST_FILE = "ch18p533touches/ch18p533touches-Info.plist";
288-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
288+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
289289
LD_RUNPATH_SEARCH_PATHS = (
290290
"$(inherited)",
291291
"@executable_path/Frameworks",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1300"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "C9BE540317BD18D2000C941F"
18+
BuildableName = "ch18p533touches.app"
19+
BlueprintName = "ch18p533touches"
20+
ReferencedContainer = "container:ch18p533touches.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "C9BE540317BD18D2000C941F"
48+
BuildableName = "ch18p533touches.app"
49+
BlueprintName = "ch18p533touches"
50+
ReferencedContainer = "container:ch18p533touches.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "C9BE540317BD18D2000C941F"
65+
BuildableName = "ch18p533touches.app"
66+
BlueprintName = "ch18p533touches"
67+
ReferencedContainer = "container:ch18p533touches.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

bk2ch05p194touches/ch18p533touches/MyViews.swift

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ class MyView2Not : UIView {
8282
}
8383

8484
class MyView2 : UIView {
85-
var time : TimeInterval!
8685
var single = false
8786

8887

bk2ch05p203gestureRecognizers/ch18p541gestureRecognizers.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@
269269
GCC_PRECOMPILE_PREFIX_HEADER = YES;
270270
GCC_PREFIX_HEADER = "ch18p541gestureRecognizers/ch18p541gestureRecognizers-Prefix.pch";
271271
INFOPLIST_FILE = "ch18p541gestureRecognizers/ch18p541gestureRecognizers-Info.plist";
272-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
272+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
273273
LD_RUNPATH_SEARCH_PATHS = (
274274
"$(inherited)",
275275
"@executable_path/Frameworks",
@@ -293,7 +293,7 @@
293293
GCC_PRECOMPILE_PREFIX_HEADER = YES;
294294
GCC_PREFIX_HEADER = "ch18p541gestureRecognizers/ch18p541gestureRecognizers-Prefix.pch";
295295
INFOPLIST_FILE = "ch18p541gestureRecognizers/ch18p541gestureRecognizers-Info.plist";
296-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
296+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
297297
LD_RUNPATH_SEARCH_PATHS = (
298298
"$(inherited)",
299299
"@executable_path/Frameworks",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1300"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "C9BE545017BD4896000C941F"
18+
BuildableName = "ch18p541gestureRecognizers.app"
19+
BlueprintName = "ch18p541gestureRecognizers"
20+
ReferencedContainer = "container:ch18p541gestureRecognizers.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "C9BE545017BD4896000C941F"
48+
BuildableName = "ch18p541gestureRecognizers.app"
49+
BlueprintName = "ch18p541gestureRecognizers"
50+
ReferencedContainer = "container:ch18p541gestureRecognizers.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "C9BE545017BD4896000C941F"
65+
BuildableName = "ch18p541gestureRecognizers.app"
66+
BlueprintName = "ch18p541gestureRecognizers"
67+
ReferencedContainer = "container:ch18p541gestureRecognizers.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

bk2ch05p203gestureRecognizers/ch18p541gestureRecognizers/HorizVertPanGestureRecognizers.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import UIKit
55
import UIKit.UIGestureRecognizerSubclass
66

77
class HorizPanGestureRecognizer : UIPanGestureRecognizer {
8-
var origLoc : CGPoint!
8+
var origLoc = CGPoint.zero
99

1010
override func touchesBegan(_ touches: Set<UITouch>, with e: UIEvent) {
1111
self.origLoc = touches.first!.location(in:self.view!.superview)
@@ -33,8 +33,8 @@ class HorizPanGestureRecognizer : UIPanGestureRecognizer {
3333
}
3434

3535
class VertPanGestureRecognizer : UIPanGestureRecognizer {
36-
var origLoc : CGPoint!
37-
36+
var origLoc = CGPoint.zero
37+
3838
override func touchesBegan(_ touches: Set<UITouch>, with e: UIEvent) {
3939
self.origLoc = touches.first!.location(in:self.view!.superview)
4040
super.touchesBegan(touches, with:e)

bk2ch05p203gestureRecognizers/ch18p541gestureRecognizers/ViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ViewController : UIViewController {
2929
t1.require(toFail:t2) // *
3030
self.v.addGestureRecognizer(t1)
3131

32-
var which : Int { return 1 }
32+
var which : Int { return 2 }
3333

3434
switch which {
3535
case 1:

bk2ch05p203gestureRecognizers2/ch18p541gestureRecognizers.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
GCC_PRECOMPILE_PREFIX_HEADER = YES;
266266
GCC_PREFIX_HEADER = "ch18p541gestureRecognizers/ch18p541gestureRecognizers-Prefix.pch";
267267
INFOPLIST_FILE = "ch18p541gestureRecognizers/ch18p541gestureRecognizers-Info.plist";
268-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
268+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
269269
LD_RUNPATH_SEARCH_PATHS = (
270270
"$(inherited)",
271271
"@executable_path/Frameworks",
@@ -289,7 +289,7 @@
289289
GCC_PRECOMPILE_PREFIX_HEADER = YES;
290290
GCC_PREFIX_HEADER = "ch18p541gestureRecognizers/ch18p541gestureRecognizers-Prefix.pch";
291291
INFOPLIST_FILE = "ch18p541gestureRecognizers/ch18p541gestureRecognizers-Info.plist";
292-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
292+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
293293
LD_RUNPATH_SEARCH_PATHS = (
294294
"$(inherited)",
295295
"@executable_path/Frameworks",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1300"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "C9BE545017BD4896000C941F"
18+
BuildableName = "ch18p541gestureRecognizers.app"
19+
BlueprintName = "ch18p541gestureRecognizers"
20+
ReferencedContainer = "container:ch18p541gestureRecognizers.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "C9BE545017BD4896000C941F"
48+
BuildableName = "ch18p541gestureRecognizers.app"
49+
BlueprintName = "ch18p541gestureRecognizers"
50+
ReferencedContainer = "container:ch18p541gestureRecognizers.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "C9BE545017BD4896000C941F"
65+
BuildableName = "ch18p541gestureRecognizers.app"
66+
BlueprintName = "ch18p541gestureRecognizers"
67+
ReferencedContainer = "container:ch18p541gestureRecognizers.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

bk2ch05p204Fling/Fling.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
buildSettings = {
261261
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
262262
INFOPLIST_FILE = Fling/Info.plist;
263-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
263+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
264264
LD_RUNPATH_SEARCH_PATHS = (
265265
"$(inherited)",
266266
"@executable_path/Frameworks",
@@ -276,7 +276,7 @@
276276
buildSettings = {
277277
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
278278
INFOPLIST_FILE = Fling/Info.plist;
279-
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
279+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
280280
LD_RUNPATH_SEARCH_PATHS = (
281281
"$(inherited)",
282282
"@executable_path/Frameworks",

0 commit comments

Comments
 (0)