Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2026-01-10 11:19:45 -06:00
parent 3007805011
commit 905d439b81
11 changed files with 23 additions and 23 deletions

View File

@ -1,5 +1,6 @@
import SwiftUI
import SwiftData
import Bedrock
@main
struct BusinessCardApp: App {
@ -26,7 +27,7 @@ struct BusinessCardApp: App {
do {
container = try ModelContainer(for: schema, configurations: [config])
} catch {
print("Failed to create container with App Group: \(error)")
Design.debugLog("Failed to create container with App Group: \(error)")
}
}
@ -42,13 +43,13 @@ struct BusinessCardApp: App {
do {
container = try ModelContainer(for: schema, configurations: [config])
} catch {
print("Failed to create container in Application Support: \(error)")
Design.debugLog("Failed to create container in Application Support: \(error)")
}
}
// Last resort: In-memory (data won't persist but app will work)
if container == nil {
print("WARNING: Using in-memory store - data will not persist!")
Design.debugLog("WARNING: Using in-memory store - data will not persist!")
let config = ModelConfiguration(
schema: schema,
isStoredInMemoryOnly: true,

View File

@ -19,8 +19,6 @@ extension UIImage {
// Create a smaller sample size for performance
let sampleSize = 50
let scaleX = max(1, width / sampleSize)
let scaleY = max(1, height / sampleSize)
guard let context = CGContext(
data: nil,
@ -139,3 +137,4 @@ private extension Color {
return rDiff < threshold && gDiff < threshold && bDiff < threshold
}
}

View File

@ -201,7 +201,7 @@ private struct FieldRow: View {
ScrollView {
AddedContactFieldsView(fields: $fields) { field in
print("Edit: \(field.fieldType.displayName)")
Design.debugLog("Edit: \(field.fieldType.displayName)")
}
.padding()
}

View File

@ -63,7 +63,7 @@ struct CameraWithCropper: View {
#Preview {
CameraWithCropper(
onSave: { _ in print("Saved") },
onCancel: { print("Cancelled") }
onSave: { _ in Design.debugLog("Saved") },
onCancel: { Design.debugLog("Cancelled") }
)
}

View File

@ -71,6 +71,6 @@ private struct FieldTypeButton: View {
#Preview {
ContactFieldPickerView { fieldType in
print("Selected: \(fieldType.displayName)")
Design.debugLog("Selected: \(fieldType.displayName)")
}
}

View File

@ -344,7 +344,7 @@ private struct OptionRow: View {
imageType: .profile,
hasExistingImage: false
) { data in
print(data != nil ? "Got image" : "Cancelled")
Design.debugLog(data != nil ? "Got image" : "Cancelled")
}
}
}

View File

@ -89,8 +89,8 @@ struct PhotoPickerWithCropper: View {
#Preview {
NavigationStack {
PhotoPickerWithCropper(
onSave: { _ in print("Saved") },
onCancel: { print("Cancelled") }
onSave: { _ in Design.debugLog("Saved") },
onCancel: { Design.debugLog("Cancelled") }
)
}
}

View File

@ -207,9 +207,9 @@ extension PhotoSourceOption {
title: "Add profile picture",
hasExistingPhoto: true,
additionalOptions: [],
onSelectFromLibrary: { print("Library") },
onTakePhoto: { print("Camera") },
onRemovePhoto: { print("Remove") }
onSelectFromLibrary: { Design.debugLog("Library") },
onTakePhoto: { Design.debugLog("Camera") },
onRemovePhoto: { Design.debugLog("Remove") }
)
}
}

View File

@ -276,7 +276,7 @@ private struct FlowLayout: Layout {
#Preview("Add Email") {
ContactFieldEditorSheet(fieldType: .email) { value, title in
print("Saved: \(value), \(title)")
Design.debugLog("Saved: \(value), \(title)")
}
}
@ -286,15 +286,15 @@ private struct FlowLayout: Layout {
initialValue: "linkedin.com/in/mattbruce",
initialTitle: "Connect with me"
) { value, title in
print("Saved: \(value), \(title)")
Design.debugLog("Saved: \(value), \(title)")
} onDelete: {
print("Deleted")
Design.debugLog("Deleted")
}
}
#Preview("Add Address") {
ContactFieldEditorSheet(fieldType: .address) { value, title in
print("Saved address: \(value), title: \(title)")
Design.debugLog("Saved address: \(value), title: \(title)")
}
}
@ -311,8 +311,8 @@ private struct FlowLayout: Layout {
initialValue: existingAddress.encode(),
initialTitle: "Work"
) { value, title in
print("Saved: \(value), title: \(title)")
Design.debugLog("Saved: \(value), title: \(title)")
} onDelete: {
print("Deleted")
Design.debugLog("Deleted")
}
}

View File

@ -334,6 +334,6 @@ private struct CustomColorPickerSheet: View {
LogoEditorSheet(
logoImage: UIImage(systemName: "building.2.fill")!
) { data in
print(data != nil ? "Saved logo" : "Cancelled")
Design.debugLog(data != nil ? "Saved logo" : "Cancelled")
}
}

View File

@ -582,6 +582,6 @@ private struct CropGridLines: View {
let sampleData = sampleImage.pngData()!
return PhotoCropperSheet(imageData: sampleData) { data in
print(data != nil ? "Saved" : "Cancelled")
Design.debugLog(data != nil ? "Saved" : "Cancelled")
}
}