From fc974787e88fd7b3d8e5e9d4ebd0a2dffdc5eed4 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Fri, 4 Oct 2024 23:19:22 +0200 Subject: [PATCH 1/6] Updated the Info.plist file for the Piper target to remove the app from the system dock. --- Piper.xcodeproj/project.pbxproj | 14 ++++++++++++++ Piper/Info.plist | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 Piper/Info.plist diff --git a/Piper.xcodeproj/project.pbxproj b/Piper.xcodeproj/project.pbxproj index 4306b5c..05cb4fe 100644 --- a/Piper.xcodeproj/project.pbxproj +++ b/Piper.xcodeproj/project.pbxproj @@ -54,11 +54,21 @@ ); target = 46D4BEE12CB07CB600FCFB84 /* UITests */; }; + 46D4BF532CB08A9500FCFB84 /* Exceptions for "Piper" folder in "Piper" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = 46D4BE762CB06ED300FCFB84 /* Piper */; + }; /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ 46D4BE792CB06ED300FCFB84 /* Piper */ = { isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 46D4BF532CB08A9500FCFB84 /* Exceptions for "Piper" folder in "Piper" target */, + ); path = Piper; sourceTree = ""; }; @@ -424,8 +434,10 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Piper/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Piper; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_LSUIElement = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -454,8 +466,10 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Piper/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Piper; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_LSUIElement = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/Piper/Info.plist b/Piper/Info.plist new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/Piper/Info.plist @@ -0,0 +1,5 @@ + + + + + -- 2.47.1 From a2d46fc0ea2fb1bff630f79eeddd0d469355bc70 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Fri, 4 Oct 2024 23:23:57 +0200 Subject: [PATCH 2/6] Replaced the main window for the PiperApp app in the Piper target with a menu bar. --- Piper/Sources/App/PiperApp.swift | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Piper/Sources/App/PiperApp.swift b/Piper/Sources/App/PiperApp.swift index b783cb0..77789e4 100644 --- a/Piper/Sources/App/PiperApp.swift +++ b/Piper/Sources/App/PiperApp.swift @@ -11,6 +11,9 @@ import SwiftData @main struct PiperApp: App { + + // MARK: Properties + var sharedModelContainer: ModelContainer = { let schema = Schema([ Item.self, @@ -23,11 +26,15 @@ struct PiperApp: App { fatalError("Could not create ModelContainer: \(error)") } }() + + // MARK: Body var body: some Scene { - WindowGroup { - ContentView() + MenuBarExtra { + EmptyView() + } label: { + Image(systemName: "circle.fill") } - .modelContainer(sharedModelContainer) } + } -- 2.47.1 From c23df6d0480437928e66dfa313cb5380c52e8a62 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Fri, 4 Oct 2024 23:49:13 +0200 Subject: [PATCH 3/6] Implemented a basic layout for the menu bar extra for the PiperApp app in the app target. --- Piper/Sources/App/PiperApp.swift | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Piper/Sources/App/PiperApp.swift b/Piper/Sources/App/PiperApp.swift index 77789e4..b08661e 100644 --- a/Piper/Sources/App/PiperApp.swift +++ b/Piper/Sources/App/PiperApp.swift @@ -31,10 +31,24 @@ struct PiperApp: App { var body: some Scene { MenuBarExtra { - EmptyView() + VStack(alignment: .leading) { + Text("Some text goes here...") + .foregroundStyle(.primary) + + Divider() + + Button { + // ... + } label: { + Text("Some text goes here...") + .frame(maxWidth: .infinity) + } + } + .padding() } label: { Image(systemName: "circle.fill") } + .menuBarExtraStyle(.window) } } -- 2.47.1 From 4693e6c943afe73912f7cc2553592d820450c850 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 5 Oct 2024 00:05:15 +0200 Subject: [PATCH 4/6] Moved the Info.plist file under the Resources folder in the app target. --- Piper.xcodeproj/project.pbxproj | 6 +++--- Piper/{ => Resources/Plists}/Info.plist | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename Piper/{ => Resources/Plists}/Info.plist (100%) diff --git a/Piper.xcodeproj/project.pbxproj b/Piper.xcodeproj/project.pbxproj index 05cb4fe..c7de080 100644 --- a/Piper.xcodeproj/project.pbxproj +++ b/Piper.xcodeproj/project.pbxproj @@ -57,7 +57,7 @@ 46D4BF532CB08A9500FCFB84 /* Exceptions for "Piper" folder in "Piper" target */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( - Info.plist, + Resources/Plists/Info.plist, ); target = 46D4BE762CB06ED300FCFB84 /* Piper */; }; @@ -434,7 +434,7 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = Piper/Info.plist; + INFOPLIST_FILE = Piper/Resources/Plists/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Piper; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; @@ -466,7 +466,7 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = Piper/Info.plist; + INFOPLIST_FILE = Piper/Resources/Plists/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Piper; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; diff --git a/Piper/Info.plist b/Piper/Resources/Plists/Info.plist similarity index 100% rename from Piper/Info.plist rename to Piper/Resources/Plists/Info.plist -- 2.47.1 From c698048a8052c7d6aa3f71feca6e60e2fd504313 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 5 Oct 2024 00:12:20 +0200 Subject: [PATCH 5/6] Defined the .gitignore file for the project. --- .gitignore | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..162f8a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,57 @@ +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Swift ### +# Xcode + +## User settings +xcuserdata/ + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +Packages/ +Package.resolved +*.xcodeproj +.swiftpm +.build/ -- 2.47.1 From cdda49ced2ec7469ee3a2c60b4f2e6d7627719cf Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 5 Oct 2024 00:14:23 +0200 Subject: [PATCH 6/6] Added the README file to the project. --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f4b5cc --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Piper \ No newline at end of file -- 2.47.1