From 63c3f57bbfaf7a3d9d06c73ee7f8c8ab2dd828da Mon Sep 17 00:00:00 2001 From: Jason Morley Date: Wed, 11 Oct 2023 17:34:12 -1000 Subject: [PATCH 1/2] refactor: Move `EKCalendar` and `EKCalendarItem` extensions into separate files --- macos/Overview/Extensions/EKCalendar.swift | 30 +++++++++++++++++++ .../Overview/Extensions/EKCalendarItem.swift | 30 +++++++++++++++++++ macos/Overview/OverviewApp.swift | 8 ----- 3 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 macos/Overview/Extensions/EKCalendar.swift create mode 100644 macos/Overview/Extensions/EKCalendarItem.swift diff --git a/macos/Overview/Extensions/EKCalendar.swift b/macos/Overview/Extensions/EKCalendar.swift new file mode 100644 index 0000000..c8648fe --- /dev/null +++ b/macos/Overview/Extensions/EKCalendar.swift @@ -0,0 +1,30 @@ +// Copyright (c) 2021-2023 Jason Barrie Morley +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +import EventKit +import SwiftUI + +extension EKCalendar: Identifiable { + + public var id: String { + return calendarIdentifier + } + +} diff --git a/macos/Overview/Extensions/EKCalendarItem.swift b/macos/Overview/Extensions/EKCalendarItem.swift new file mode 100644 index 0000000..d8cf708 --- /dev/null +++ b/macos/Overview/Extensions/EKCalendarItem.swift @@ -0,0 +1,30 @@ +// Copyright (c) 2021-2023 Jason Barrie Morley +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +import EventKit +import SwiftUI + +extension EKCalendarItem: Identifiable { + + public var id: String { + return calendarItemIdentifier + } + +} diff --git a/macos/Overview/OverviewApp.swift b/macos/Overview/OverviewApp.swift index 07313d9..7ef6348 100644 --- a/macos/Overview/OverviewApp.swift +++ b/macos/Overview/OverviewApp.swift @@ -23,14 +23,6 @@ import SwiftUI import Diligence -extension EKCalendar: Identifiable { - public var id: String { calendarIdentifier } -} - -extension EKCalendarItem: Identifiable { - public var id: String { calendarItemIdentifier } -} - @main struct OverviewApp: App { From 0d11e13aebc916a40b43ed7d298b2ca8b100c036 Mon Sep 17 00:00:00 2001 From: Jason Morley Date: Wed, 11 Oct 2023 17:40:07 -1000 Subject: [PATCH 2/2] Actually update the project file --- macos/Overview.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/macos/Overview.xcodeproj/project.pbxproj b/macos/Overview.xcodeproj/project.pbxproj index 8abff0e..a03948f 100644 --- a/macos/Overview.xcodeproj/project.pbxproj +++ b/macos/Overview.xcodeproj/project.pbxproj @@ -29,6 +29,8 @@ D8DCDE0825F6F9410083DF48 /* MonthView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8DCDE0725F6F9410083DF48 /* MonthView.swift */; }; D8DCDE1225F6FD060083DF48 /* YearView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8DCDE1125F6FD060083DF48 /* YearView.swift */; }; D8FA1F432AD7872000E18E26 /* OverviewError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FA1F422AD7872000E18E26 /* OverviewError.swift */; }; + D8FA1F452AD79EFE00E18E26 /* EKCalendar.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FA1F442AD79EFE00E18E26 /* EKCalendar.swift */; }; + D8FA1F472AD79F1D00E18E26 /* EKCalendarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FA1F462AD79F1D00E18E26 /* EKCalendarItem.swift */; }; D8FE3AD42911700A00C6F7FE /* Interact in Frameworks */ = {isa = PBXBuildFile; productRef = D8FE3AD32911700A00C6F7FE /* Interact */; }; D8FE3AD62911738E00C6F7FE /* interact-license in Resources */ = {isa = PBXBuildFile; fileRef = D8FE3AD52911738E00C6F7FE /* interact-license */; }; D8FE3AD92911789500C6F7FE /* Summary.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FE3AD82911789500C6F7FE /* Summary.swift */; }; @@ -85,6 +87,8 @@ D8DCDE1125F6FD060083DF48 /* YearView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YearView.swift; sourceTree = ""; }; D8FA1F412AD7691100E18E26 /* OverviewRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = OverviewRelease.entitlements; sourceTree = ""; }; D8FA1F422AD7872000E18E26 /* OverviewError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverviewError.swift; sourceTree = ""; }; + D8FA1F442AD79EFE00E18E26 /* EKCalendar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EKCalendar.swift; sourceTree = ""; }; + D8FA1F462AD79F1D00E18E26 /* EKCalendarItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EKCalendarItem.swift; sourceTree = ""; }; D8FE3AD229116FE900C6F7FE /* interact */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = interact; path = ../interact; sourceTree = ""; }; D8FE3AD52911738E00C6F7FE /* interact-license */ = {isa = PBXFileReference; lastKnownFileType = text; path = "interact-license"; sourceTree = ""; }; D8FE3AD82911789500C6F7FE /* Summary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Summary.swift; sourceTree = ""; }; @@ -125,6 +129,8 @@ children = ( D81507DE25FD0D5300290DD2 /* Calendar.swift */, D832648428E8EAA300D1C1B7 /* Date.swift */, + D8FA1F442AD79EFE00E18E26 /* EKCalendar.swift */, + D8FA1F462AD79F1D00E18E26 /* EKCalendarItem.swift */, D81507EB25FDB05100290DD2 /* EKEvent.swift */, D8805D9F2603A0A700C23C11 /* EKEventStore.swift */, D8805D9526039D4D00C23C11 /* Int.swift */, @@ -402,6 +408,7 @@ D8FE3ADD29117B8000C6F7FE /* Event.swift in Sources */, D8DCDE0825F6F9410083DF48 /* MonthView.swift in Sources */, D8DCDE1225F6FD060083DF48 /* YearView.swift in Sources */, + D8FA1F472AD79F1D00E18E26 /* EKCalendarItem.swift in Sources */, D8805DA02603A0A700C23C11 /* EKEventStore.swift in Sources */, D81507E725FD8AF600290DD2 /* ApplicationModel.swift in Sources */, D8B435A229119A96008F4F6F /* CalendarError.swift in Sources */, @@ -410,6 +417,7 @@ D8805D9626039D4D00C23C11 /* Int.swift in Sources */, D8A3D3D42911F105002AFC32 /* Set.swift in Sources */, D8FA1F432AD7872000E18E26 /* OverviewError.swift in Sources */, + D8FA1F452AD79EFE00E18E26 /* EKCalendar.swift in Sources */, D8FE3ADB291178BF00C6F7FE /* CalendarItem.swift in Sources */, D832648828E8EBF300D1C1B7 /* DateRangeIterator.swift in Sources */, D8805D9B26039DED00C23C11 /* CheckboxStyle.swift in Sources */,