From 905d439b815a3023cfee84b7a8559d5fabb33eef Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Sat, 10 Jan 2026 11:19:45 -0600 Subject: [PATCH] Signed-off-by: Matt Bruce --- BusinessCard/BusinessCardApp.swift | 7 ++++--- BusinessCard/Services/ColorExtractor.swift | 3 +-- .../Views/Components/AddedContactFieldsView.swift | 2 +- .../Views/Components/CameraWithCropper.swift | 4 ++-- .../Views/Components/ContactFieldPickerView.swift | 2 +- BusinessCard/Views/Components/ImageEditorFlow.swift | 2 +- .../Views/Components/PhotoPickerWithCropper.swift | 4 ++-- .../Views/Components/PhotoSourcePicker.swift | 6 +++--- .../Views/Sheets/ContactFieldEditorSheet.swift | 12 ++++++------ BusinessCard/Views/Sheets/LogoEditorSheet.swift | 2 +- BusinessCard/Views/Sheets/PhotoCropperSheet.swift | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/BusinessCard/BusinessCardApp.swift b/BusinessCard/BusinessCardApp.swift index eed0129..ed64e59 100644 --- a/BusinessCard/BusinessCardApp.swift +++ b/BusinessCard/BusinessCardApp.swift @@ -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, diff --git a/BusinessCard/Services/ColorExtractor.swift b/BusinessCard/Services/ColorExtractor.swift index 1b34eca..2861aff 100644 --- a/BusinessCard/Services/ColorExtractor.swift +++ b/BusinessCard/Services/ColorExtractor.swift @@ -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 } } + diff --git a/BusinessCard/Views/Components/AddedContactFieldsView.swift b/BusinessCard/Views/Components/AddedContactFieldsView.swift index 2c4cb1b..3ac900f 100644 --- a/BusinessCard/Views/Components/AddedContactFieldsView.swift +++ b/BusinessCard/Views/Components/AddedContactFieldsView.swift @@ -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() } diff --git a/BusinessCard/Views/Components/CameraWithCropper.swift b/BusinessCard/Views/Components/CameraWithCropper.swift index a03d50f..8640fa0 100644 --- a/BusinessCard/Views/Components/CameraWithCropper.swift +++ b/BusinessCard/Views/Components/CameraWithCropper.swift @@ -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") } ) } diff --git a/BusinessCard/Views/Components/ContactFieldPickerView.swift b/BusinessCard/Views/Components/ContactFieldPickerView.swift index f38dca0..b45c7e2 100644 --- a/BusinessCard/Views/Components/ContactFieldPickerView.swift +++ b/BusinessCard/Views/Components/ContactFieldPickerView.swift @@ -71,6 +71,6 @@ private struct FieldTypeButton: View { #Preview { ContactFieldPickerView { fieldType in - print("Selected: \(fieldType.displayName)") + Design.debugLog("Selected: \(fieldType.displayName)") } } diff --git a/BusinessCard/Views/Components/ImageEditorFlow.swift b/BusinessCard/Views/Components/ImageEditorFlow.swift index e0b8482..4b3c050 100644 --- a/BusinessCard/Views/Components/ImageEditorFlow.swift +++ b/BusinessCard/Views/Components/ImageEditorFlow.swift @@ -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") } } } diff --git a/BusinessCard/Views/Components/PhotoPickerWithCropper.swift b/BusinessCard/Views/Components/PhotoPickerWithCropper.swift index 4becfba..d423d08 100644 --- a/BusinessCard/Views/Components/PhotoPickerWithCropper.swift +++ b/BusinessCard/Views/Components/PhotoPickerWithCropper.swift @@ -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") } ) } } diff --git a/BusinessCard/Views/Components/PhotoSourcePicker.swift b/BusinessCard/Views/Components/PhotoSourcePicker.swift index 75da050..09c68a7 100644 --- a/BusinessCard/Views/Components/PhotoSourcePicker.swift +++ b/BusinessCard/Views/Components/PhotoSourcePicker.swift @@ -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") } ) } } diff --git a/BusinessCard/Views/Sheets/ContactFieldEditorSheet.swift b/BusinessCard/Views/Sheets/ContactFieldEditorSheet.swift index 88b40fb..381b34a 100644 --- a/BusinessCard/Views/Sheets/ContactFieldEditorSheet.swift +++ b/BusinessCard/Views/Sheets/ContactFieldEditorSheet.swift @@ -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") } } diff --git a/BusinessCard/Views/Sheets/LogoEditorSheet.swift b/BusinessCard/Views/Sheets/LogoEditorSheet.swift index 5b9e64d..86b95e7 100644 --- a/BusinessCard/Views/Sheets/LogoEditorSheet.swift +++ b/BusinessCard/Views/Sheets/LogoEditorSheet.swift @@ -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") } } diff --git a/BusinessCard/Views/Sheets/PhotoCropperSheet.swift b/BusinessCard/Views/Sheets/PhotoCropperSheet.swift index 9535596..6018c8c 100644 --- a/BusinessCard/Views/Sheets/PhotoCropperSheet.swift +++ b/BusinessCard/Views/Sheets/PhotoCropperSheet.swift @@ -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") } }