-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from maiqingqiang/update-20240927
Switch Core Data & Fix Bug
- Loading branch information
Showing
56 changed files
with
1,127 additions
and
575 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1600" | ||
version = "1.7"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES" | ||
buildArchitectures = "Automatic"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "526675412C85EDCB001EF113" | ||
BuildableName = "ChatMLX.app" | ||
BlueprintName = "ChatMLX" | ||
ReferencedContainer = "container:ChatMLX.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
shouldAutocreateTestPlan = "YES"> | ||
</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 = "526675412C85EDCB001EF113" | ||
BuildableName = "ChatMLX.app" | ||
BlueprintName = "ChatMLX" | ||
ReferencedContainer = "container:ChatMLX.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<CommandLineArguments> | ||
<CommandLineArgument | ||
argument = "-com.apple.CoreData.ConcurrencyDebug 1" | ||
isEnabled = "YES"> | ||
</CommandLineArgument> | ||
</CommandLineArguments> | ||
<EnvironmentVariables> | ||
<EnvironmentVariable | ||
key = "CORESVG_VERBOSE" | ||
value = "1" | ||
isEnabled = "NO"> | ||
</EnvironmentVariable> | ||
</EnvironmentVariables> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "526675412C85EDCB001EF113" | ||
BuildableName = "ChatMLX.app" | ||
BlueprintName = "ChatMLX" | ||
ReferencedContainer = "container:ChatMLX.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
ChatMLX/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes
Binary file not shown.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// ErrorAlertModifier.swift | ||
// ChatMLX | ||
// | ||
// Created by John Mai on 2024/10/3. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ErrorAlertModifier: ViewModifier { | ||
@Binding var showErrorAlert: Bool | ||
@Binding var errorTitle: String? | ||
@Binding var error: Error? | ||
|
||
func body(content: Content) -> some View { | ||
content | ||
.alert( | ||
errorTitle ?? "Error", isPresented: $showErrorAlert, | ||
actions: { | ||
Button("OK") { | ||
error = nil | ||
} | ||
|
||
Button("Feedback") { | ||
error = nil | ||
NSWorkspace.shared.open( | ||
URL(string: "https://github.com/maiqingqiang/ChatMLX/issues")!) | ||
} | ||
}, | ||
message: { | ||
Text(error?.localizedDescription ?? "An unknown error occurred.") | ||
}) | ||
} | ||
} | ||
|
||
extension View { | ||
func errorAlert(isPresented: Binding<Bool>, title: Binding<String?>, error: Binding<Error?>) | ||
-> some View | ||
{ | ||
modifier(ErrorAlertModifier(showErrorAlert: isPresented, errorTitle: title, error: error)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Binding+Extensions.swift | ||
// ChatMLX | ||
// | ||
// Created by John Mai on 2024/10/2. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
extension Binding { | ||
func toUnwrapped<T>(defaultValue: T) -> Binding<T> where Value == T? { | ||
Binding<T>(get: { self.wrappedValue ?? defaultValue }, set: { self.wrappedValue = $0 }) | ||
} | ||
} |
Oops, something went wrong.