Skip to content

Commit

Permalink
Support Concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
noppefoxwolf committed Mar 27, 2022
1 parent 2b1bb5e commit 6dd4d5c
Show file tree
Hide file tree
Showing 59 changed files with 392 additions and 502 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftUIExample"
BuildableName = "SwiftUIExample"
BlueprintName = "SwiftUIExample"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UIKitExample"
BuildableName = "UIKitExample"
BlueprintName = "UIKitExample"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Shared"
BuildableName = "Shared"
BlueprintName = "Shared"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftUIExampleModule"
BuildableName = "SwiftUIExampleModule"
BlueprintName = "SwiftUIExampleModule"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UIKItExampleModule"
BuildableName = "UIKItExampleModule"
BlueprintName = "UIKItExampleModule"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftUIExample"
BuildableName = "SwiftUIExample"
BlueprintName = "SwiftUIExample"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UIKitExample"
BuildableName = "UIKitExample"
BlueprintName = "UIKitExample"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftUIExample"
BuildableName = "SwiftUIExample"
BlueprintName = "SwiftUIExample"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftUIExample"
BuildableName = "SwiftUIExample"
BlueprintName = "SwiftUIExample"
ReferencedContainer = "container:">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftUIExample"
BuildableName = "SwiftUIExample"
BlueprintName = "SwiftUIExample"
ReferencedContainer = "container:">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UIKitExample"
BuildableName = "UIKitExample"
BlueprintName = "UIKitExample"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableThreadSanitizer = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UIKitExample"
BuildableName = "UIKitExample"
BlueprintName = "UIKitExample"
ReferencedContainer = "container:">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UIKitExample"
BuildableName = "UIKitExample"
BlueprintName = "UIKitExample"
ReferencedContainer = "container:">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
7 changes: 0 additions & 7 deletions Example.swiftpm/Source/Shared/ColorViewController.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
//
// ColorViewController.swift
// Shared
//
// Created by Tomoya Hirano on 2021/05/26.
//

import UIKit

public final class ColorViewController: UIViewController {
Expand Down
13 changes: 3 additions & 10 deletions Example.swiftpm/Source/Shared/CustomDebugItem.swift
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
//
// CustomDebugItem.swift
// Example
//
// Created by Tomoya Hirano on 2020/12/06.
//

import UIKit
import DebugMenu

public struct CustomDebugItem: DebugItem {
public init() {}
public let debugItemTitle: String = "Custom item"
public let action: DebugItemAction = .toggle { UserDefaults.standard.bool(forKey: "key") } action: { (isOn, completions) in
public let action: DebugItemAction = .toggle { UserDefaults.standard.bool(forKey: "key") } operation: { isOn in
let userDefaults = UserDefaults.standard
userDefaults.set(isOn, forKey: "key")
if userDefaults.synchronize() {
completions(.success(message: "Switch to \(isOn)"))
return .success(message: "Switch to \(isOn)")
} else {
completions(.failure(message: "Failed to save"))
return .failure(message: "Failed to save")
}
}
}
5 changes: 2 additions & 3 deletions Example.swiftpm/Source/UIKItExampleModule/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
UserDefaultsResetDebugItem(),
CustomDebugItem(),
SliderDebugItem(title: "Attack Rate", current: { 0.1 }, range: 0.0...100.0, onChange: { value in print(value) }),
KeyValueDebugItem(title: "UserDefaults", fetcher: { completions in
let envelops = UserDefaults.standard.dictionaryRepresentation().map({ Envelope(key: $0.key, value: "\($0.value)") })
completions(envelops)
KeyValueDebugItem(title: "UserDefaults", fetcher: {
return UserDefaults.standard.dictionaryRepresentation().map({ Envelope(key: $0.key, value: "\($0.value)") })
}),
GroupDebugItem(title: "Info", items: [
AppInfoDebugItem(),
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
9 changes: 1 addition & 8 deletions Sources/DebugMenu/Entity/AnyDebugItem.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
//
// File.swift
// DebugMenu
//
// Created by Tomoya Hirano on 2020/12/07.
//

import UIKit
import Foundation

struct AnyDebugItem: Hashable, Identifiable, DebugItem {
let id: String
Expand Down
7 changes: 0 additions & 7 deletions Sources/DebugMenu/Entity/Application.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
//
// Application.swift
// App
//
// Created by Tomoya Hirano on 2020/03/01.
//

import Foundation

public class Application {
Expand Down
7 changes: 0 additions & 7 deletions Sources/DebugMenu/Entity/DashboardItem.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
//
// File.swift
//
//
// Created by Tomoya Hirano on 2021/05/29.
//

import Foundation

public protocol DashboardItem {
Expand Down
Loading

0 comments on commit 6dd4d5c

Please sign in to comment.