Skip to content

Commit 6dd4d5c

Browse files
committed
Support Concurrency
1 parent 2b1bb5e commit 6dd4d5c

59 files changed

Lines changed: 392 additions & 502 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1330"
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 = "SwiftUIExample"
18+
BuildableName = "SwiftUIExample"
19+
BlueprintName = "SwiftUIExample"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "YES"
27+
buildForArchiving = "YES"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "UIKitExample"
32+
BuildableName = "UIKitExample"
33+
BlueprintName = "UIKitExample"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "YES"
40+
buildForProfiling = "YES"
41+
buildForArchiving = "YES"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "Shared"
46+
BuildableName = "Shared"
47+
BlueprintName = "Shared"
48+
ReferencedContainer = "container:">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
<BuildActionEntry
52+
buildForTesting = "YES"
53+
buildForRunning = "YES"
54+
buildForProfiling = "YES"
55+
buildForArchiving = "YES"
56+
buildForAnalyzing = "YES">
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "SwiftUIExampleModule"
60+
BuildableName = "SwiftUIExampleModule"
61+
BlueprintName = "SwiftUIExampleModule"
62+
ReferencedContainer = "container:">
63+
</BuildableReference>
64+
</BuildActionEntry>
65+
<BuildActionEntry
66+
buildForTesting = "YES"
67+
buildForRunning = "YES"
68+
buildForProfiling = "YES"
69+
buildForArchiving = "YES"
70+
buildForAnalyzing = "YES">
71+
<BuildableReference
72+
BuildableIdentifier = "primary"
73+
BlueprintIdentifier = "UIKItExampleModule"
74+
BuildableName = "UIKItExampleModule"
75+
BlueprintName = "UIKItExampleModule"
76+
ReferencedContainer = "container:">
77+
</BuildableReference>
78+
</BuildActionEntry>
79+
</BuildActionEntries>
80+
</BuildAction>
81+
<TestAction
82+
buildConfiguration = "Debug"
83+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
84+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
85+
shouldUseLaunchSchemeArgsEnv = "YES">
86+
<Testables>
87+
</Testables>
88+
</TestAction>
89+
<LaunchAction
90+
buildConfiguration = "Debug"
91+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
92+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
93+
launchStyle = "0"
94+
useCustomWorkingDirectory = "NO"
95+
ignoresPersistentStateOnLaunch = "NO"
96+
debugDocumentVersioning = "YES"
97+
debugServiceExtension = "internal"
98+
allowLocationSimulation = "YES">
99+
<MacroExpansion>
100+
<BuildableReference
101+
BuildableIdentifier = "primary"
102+
BlueprintIdentifier = "SwiftUIExample"
103+
BuildableName = "SwiftUIExample"
104+
BlueprintName = "SwiftUIExample"
105+
ReferencedContainer = "container:">
106+
</BuildableReference>
107+
</MacroExpansion>
108+
</LaunchAction>
109+
<ProfileAction
110+
buildConfiguration = "Release"
111+
shouldUseLaunchSchemeArgsEnv = "YES"
112+
savedToolIdentifier = ""
113+
useCustomWorkingDirectory = "NO"
114+
debugDocumentVersioning = "YES">
115+
<MacroExpansion>
116+
<BuildableReference
117+
BuildableIdentifier = "primary"
118+
BlueprintIdentifier = "UIKitExample"
119+
BuildableName = "UIKitExample"
120+
BlueprintName = "UIKitExample"
121+
ReferencedContainer = "container:">
122+
</BuildableReference>
123+
</MacroExpansion>
124+
</ProfileAction>
125+
<AnalyzeAction
126+
buildConfiguration = "Debug">
127+
</AnalyzeAction>
128+
<ArchiveAction
129+
buildConfiguration = "Release"
130+
revealArchiveInOrganizer = "YES">
131+
</ArchiveAction>
132+
</Scheme>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1330"
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 = "SwiftUIExample"
18+
BuildableName = "SwiftUIExample"
19+
BlueprintName = "SwiftUIExample"
20+
ReferencedContainer = "container:">
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 = "SwiftUIExample"
48+
BuildableName = "SwiftUIExample"
49+
BlueprintName = "SwiftUIExample"
50+
ReferencedContainer = "container:">
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 = "SwiftUIExample"
65+
BuildableName = "SwiftUIExample"
66+
BlueprintName = "SwiftUIExample"
67+
ReferencedContainer = "container:">
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>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1330"
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 = "UIKitExample"
18+
BuildableName = "UIKitExample"
19+
BlueprintName = "UIKitExample"
20+
ReferencedContainer = "container:">
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+
enableThreadSanitizer = "YES"
38+
launchStyle = "0"
39+
useCustomWorkingDirectory = "NO"
40+
ignoresPersistentStateOnLaunch = "NO"
41+
debugDocumentVersioning = "YES"
42+
debugServiceExtension = "internal"
43+
allowLocationSimulation = "YES">
44+
<BuildableProductRunnable
45+
runnableDebuggingMode = "0">
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "UIKitExample"
49+
BuildableName = "UIKitExample"
50+
BlueprintName = "UIKitExample"
51+
ReferencedContainer = "container:">
52+
</BuildableReference>
53+
</BuildableProductRunnable>
54+
</LaunchAction>
55+
<ProfileAction
56+
buildConfiguration = "Release"
57+
shouldUseLaunchSchemeArgsEnv = "YES"
58+
savedToolIdentifier = ""
59+
useCustomWorkingDirectory = "NO"
60+
debugDocumentVersioning = "YES">
61+
<BuildableProductRunnable
62+
runnableDebuggingMode = "0">
63+
<BuildableReference
64+
BuildableIdentifier = "primary"
65+
BlueprintIdentifier = "UIKitExample"
66+
BuildableName = "UIKitExample"
67+
BlueprintName = "UIKitExample"
68+
ReferencedContainer = "container:">
69+
</BuildableReference>
70+
</BuildableProductRunnable>
71+
</ProfileAction>
72+
<AnalyzeAction
73+
buildConfiguration = "Debug">
74+
</AnalyzeAction>
75+
<ArchiveAction
76+
buildConfiguration = "Release"
77+
revealArchiveInOrganizer = "YES">
78+
</ArchiveAction>
79+
</Scheme>

Example.swiftpm/Source/Shared/ColorViewController.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// ColorViewController.swift
3-
// Shared
4-
//
5-
// Created by Tomoya Hirano on 2021/05/26.
6-
//
7-
81
import UIKit
92

103
public final class ColorViewController: UIViewController {
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
//
2-
// CustomDebugItem.swift
3-
// Example
4-
//
5-
// Created by Tomoya Hirano on 2020/12/06.
6-
//
7-
81
import UIKit
92
import DebugMenu
103

114
public struct CustomDebugItem: DebugItem {
125
public init() {}
136
public let debugItemTitle: String = "Custom item"
14-
public let action: DebugItemAction = .toggle { UserDefaults.standard.bool(forKey: "key") } action: { (isOn, completions) in
7+
public let action: DebugItemAction = .toggle { UserDefaults.standard.bool(forKey: "key") } operation: { isOn in
158
let userDefaults = UserDefaults.standard
169
userDefaults.set(isOn, forKey: "key")
1710
if userDefaults.synchronize() {
18-
completions(.success(message: "Switch to \(isOn)"))
11+
return .success(message: "Switch to \(isOn)")
1912
} else {
20-
completions(.failure(message: "Failed to save"))
13+
return .failure(message: "Failed to save")
2114
}
2215
}
2316
}

Example.swiftpm/Source/UIKItExampleModule/App.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
4040
UserDefaultsResetDebugItem(),
4141
CustomDebugItem(),
4242
SliderDebugItem(title: "Attack Rate", current: { 0.1 }, range: 0.0...100.0, onChange: { value in print(value) }),
43-
KeyValueDebugItem(title: "UserDefaults", fetcher: { completions in
44-
let envelops = UserDefaults.standard.dictionaryRepresentation().map({ Envelope(key: $0.key, value: "\($0.value)") })
45-
completions(envelops)
43+
KeyValueDebugItem(title: "UserDefaults", fetcher: {
44+
return UserDefaults.standard.dictionaryRepresentation().map({ Envelope(key: $0.key, value: "\($0.value)") })
4645
}),
4746
GroupDebugItem(title: "Info", items: [
4847
AppInfoDebugItem(),

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:5.6
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

Sources/DebugMenu/Entity/AnyDebugItem.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
//
2-
// File.swift
3-
// DebugMenu
4-
//
5-
// Created by Tomoya Hirano on 2020/12/07.
6-
//
7-
8-
import UIKit
1+
import Foundation
92

103
struct AnyDebugItem: Hashable, Identifiable, DebugItem {
114
let id: String

Sources/DebugMenu/Entity/Application.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// Application.swift
3-
// App
4-
//
5-
// Created by Tomoya Hirano on 2020/03/01.
6-
//
7-
81
import Foundation
92

103
public class Application {

Sources/DebugMenu/Entity/DashboardItem.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// File.swift
3-
//
4-
//
5-
// Created by Tomoya Hirano on 2021/05/29.
6-
//
7-
81
import Foundation
92

103
public protocol DashboardItem {

0 commit comments

Comments
 (0)