Skip to content

Commit 9d004c1

Browse files
committed
continuing to end of chapter 4
1 parent fcf7f5e commit 9d004c1

File tree

137 files changed

+6340
-94
lines changed

Some content is hidden

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

137 files changed

+6340
-94
lines changed

Diff for: bk1ch02p044functionAsValue/bk1ch02p044functionAsValue/ViewController.swift

+2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class Dog3 {
119119
func test() {
120120
self.bark() // fine
121121
// let barkFunction = bark // compile error
122+
let barkFunction = bark(loudly:)
123+
_ = barkFunction
122124
}
123125
}
124126

Diff for: bk1ch04p115initializers/bk1ch04p115initializers.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
buildSettings = {
275275
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
276276
INFOPLIST_FILE = bk1ch04p115initializers/Info.plist;
277+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
277278
LD_RUNPATH_SEARCH_PATHS = (
278279
"$(inherited)",
279280
"@executable_path/Frameworks",
@@ -289,6 +290,7 @@
289290
buildSettings = {
290291
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
291292
INFOPLIST_FILE = bk1ch04p115initializers/Info.plist;
293+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
292294
LD_RUNPATH_SEARCH_PATHS = (
293295
"$(inherited)",
294296
"@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 = "3276B6EC1AF3000F00557EDD"
18+
BuildableName = "bk1ch04p115initializers.app"
19+
BlueprintName = "bk1ch04p115initializers"
20+
ReferencedContainer = "container:bk1ch04p115initializers.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 = "3276B6EC1AF3000F00557EDD"
48+
BuildableName = "bk1ch04p115initializers.app"
49+
BlueprintName = "bk1ch04p115initializers"
50+
ReferencedContainer = "container:bk1ch04p115initializers.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 = "3276B6EC1AF3000F00557EDD"
65+
BuildableName = "bk1ch04p115initializers.app"
66+
BlueprintName = "bk1ch04p115initializers"
67+
ReferencedContainer = "container:bk1ch04p115initializers.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>

Diff for: bk1ch04p121properties/bk1ch04p121properties.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
buildSettings = {
275275
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
276276
INFOPLIST_FILE = bk1ch04p121properties/Info.plist;
277+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
277278
LD_RUNPATH_SEARCH_PATHS = (
278279
"$(inherited)",
279280
"@executable_path/Frameworks",
@@ -289,6 +290,7 @@
289290
buildSettings = {
290291
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
291292
INFOPLIST_FILE = bk1ch04p121properties/Info.plist;
293+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
292294
LD_RUNPATH_SEARCH_PATHS = (
293295
"$(inherited)",
294296
"@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 = "3237E0811AF3D6D300EF98F9"
18+
BuildableName = "bk1ch04p121properties.app"
19+
BlueprintName = "bk1ch04p121properties"
20+
ReferencedContainer = "container:bk1ch04p121properties.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 = "3237E0811AF3D6D300EF98F9"
48+
BuildableName = "bk1ch04p121properties.app"
49+
BlueprintName = "bk1ch04p121properties"
50+
ReferencedContainer = "container:bk1ch04p121properties.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 = "3237E0811AF3D6D300EF98F9"
65+
BuildableName = "bk1ch04p121properties.app"
66+
BlueprintName = "bk1ch04p121properties"
67+
ReferencedContainer = "container:bk1ch04p121properties.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>

Diff for: bk1ch04p125methods/bk1ch04p125methods.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
buildSettings = {
275275
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
276276
INFOPLIST_FILE = bk1ch04p125methods/Info.plist;
277+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
277278
LD_RUNPATH_SEARCH_PATHS = (
278279
"$(inherited)",
279280
"@executable_path/Frameworks",
@@ -289,6 +290,7 @@
289290
buildSettings = {
290291
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
291292
INFOPLIST_FILE = bk1ch04p125methods/Info.plist;
293+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
292294
LD_RUNPATH_SEARCH_PATHS = (
293295
"$(inherited)",
294296
"@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 = "3237E0AF1AF3E32A00EF98F9"
18+
BuildableName = "bk1ch04p125methods.app"
19+
BlueprintName = "bk1ch04p125methods"
20+
ReferencedContainer = "container:bk1ch04p125methods.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 = "3237E0AF1AF3E32A00EF98F9"
48+
BuildableName = "bk1ch04p125methods.app"
49+
BlueprintName = "bk1ch04p125methods"
50+
ReferencedContainer = "container:bk1ch04p125methods.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 = "3237E0AF1AF3E32A00EF98F9"
65+
BuildableName = "bk1ch04p125methods.app"
66+
BlueprintName = "bk1ch04p125methods"
67+
ReferencedContainer = "container:bk1ch04p125methods.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>

Diff for: bk1ch04p125methods/bk1ch04p125methods/ViewController.swift

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ struct Greeting {
3737
static var ambivalent : String {
3838
self.friendly + " but " + self.hostile
3939
}
40+
// static var ambivalent : String = {
41+
// friendly + " but " + hostile
42+
// }()
4043
static func beFriendly() {
4144
print(self.friendly)
4245
}

Diff for: bk1ch04p127subscripts/bk1ch04p127subscripts.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
buildSettings = {
275275
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
276276
INFOPLIST_FILE = bk1ch04p127subscripts/Info.plist;
277+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
277278
LD_RUNPATH_SEARCH_PATHS = (
278279
"$(inherited)",
279280
"@executable_path/Frameworks",
@@ -289,6 +290,7 @@
289290
buildSettings = {
290291
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
291292
INFOPLIST_FILE = bk1ch04p127subscripts/Info.plist;
293+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
292294
LD_RUNPATH_SEARCH_PATHS = (
293295
"$(inherited)",
294296
"@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 = "3237E0DD1AF3E7F500EF98F9"
18+
BuildableName = "bk1ch04p127subscripts.app"
19+
BlueprintName = "bk1ch04p127subscripts"
20+
ReferencedContainer = "container:bk1ch04p127subscripts.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 = "3237E0DD1AF3E7F500EF98F9"
48+
BuildableName = "bk1ch04p127subscripts.app"
49+
BlueprintName = "bk1ch04p127subscripts"
50+
ReferencedContainer = "container:bk1ch04p127subscripts.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 = "3237E0DD1AF3E7F500EF98F9"
65+
BuildableName = "bk1ch04p127subscripts.app"
66+
BlueprintName = "bk1ch04p127subscripts"
67+
ReferencedContainer = "container:bk1ch04p127subscripts.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>

0 commit comments

Comments
 (0)