diff --git a/README.md b/README.md index 177bc9f..3bab510 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Task Routine Tracker+ -_A minimal & focused task tracker, for iPhone and iPad_ +_A minimal & focused task runner, for iPhone and iPad_ For full details, including free download links from the App Store, visit: diff --git a/Sources/App.entitlements b/Sources/App.entitlements index 4df6175..31d130e 100644 --- a/Sources/App.entitlements +++ b/Sources/App.entitlements @@ -13,5 +13,9 @@ CloudKit + com.apple.security.application-groups + + group.org.openalloc.trout + diff --git a/Sources/Assets.xcassets/AppIcon.appiconset/trt_logo.png b/Sources/Assets.xcassets/AppIcon.appiconset/trt_logo.png index 1b835c6..f4f5a82 100644 Binary files a/Sources/Assets.xcassets/AppIcon.appiconset/trt_logo.png and b/Sources/Assets.xcassets/AppIcon.appiconset/trt_logo.png differ diff --git a/Sources/Assets.xcassets/AppIcon.appiconset/trt_logo_alpha.png b/Sources/Assets.xcassets/AppIcon.appiconset/trt_logo_alpha.png index 1763a51..0230365 100644 Binary files a/Sources/Assets.xcassets/AppIcon.appiconset/trt_logo_alpha.png and b/Sources/Assets.xcassets/AppIcon.appiconset/trt_logo_alpha.png differ diff --git a/Sources/Assets.xcassets/app_icon.imageset/trt_logo_120.png b/Sources/Assets.xcassets/app_icon.imageset/trt_logo_120.png index 76b758c..c6ceef1 100644 Binary files a/Sources/Assets.xcassets/app_icon.imageset/trt_logo_120.png and b/Sources/Assets.xcassets/app_icon.imageset/trt_logo_120.png differ diff --git a/Sources/Assets.xcassets/app_icon.imageset/trt_logo_180.png b/Sources/Assets.xcassets/app_icon.imageset/trt_logo_180.png index eb4ccb7..d77de46 100644 Binary files a/Sources/Assets.xcassets/app_icon.imageset/trt_logo_180.png and b/Sources/Assets.xcassets/app_icon.imageset/trt_logo_180.png differ diff --git a/Sources/Assets.xcassets/app_icon.imageset/trt_logo_60.png b/Sources/Assets.xcassets/app_icon.imageset/trt_logo_60.png index 8d724e5..54f72b6 100644 Binary files a/Sources/Assets.xcassets/app_icon.imageset/trt_logo_60.png and b/Sources/Assets.xcassets/app_icon.imageset/trt_logo_60.png differ diff --git a/Sources/PlusApp.swift b/Sources/PlusApp.swift index 00dd453..21235a5 100644 --- a/Sources/PlusApp.swift +++ b/Sources/PlusApp.swift @@ -17,7 +17,7 @@ import TroutLib import TroutUI @main -struct Gym_MRoutine_Tracker_Plus_App: App { +struct Plus_App: App { @Environment(\.scenePhase) var scenePhase // MARK: - Locals @@ -39,7 +39,10 @@ struct Gym_MRoutine_Tracker_Plus_App: App { .preferredColorScheme(colorSchemeMode.colorScheme) } .onChange(of: scenePhase) { _ in - // save if: (1) app moved to background, and (2) changes are pending + // save if transitioning to inactive or background + guard scenePhase == .inactive || scenePhase == .background else { return } + + // and changes are pending do { try coreDataStack.container.viewContext.save() } catch { diff --git a/Sources/Views/RoutineRunList.swift b/Sources/Views/RoutineRunList.swift index db551c8..3a03837 100644 --- a/Sources/Views/RoutineRunList.swift +++ b/Sources/Views/RoutineRunList.swift @@ -1,5 +1,5 @@ // -// MRoutineRunList.swift +// RoutineRunList.swift // // Copyright 2023 OpenAlloc LLC // @@ -36,7 +36,7 @@ struct MRoutineRunList: View { private var archiveStore: NSPersistentStore - internal init(archiveStore: NSPersistentStore) { + init(archiveStore: NSPersistentStore) { self.archiveStore = archiveStore let predicate = ZRoutineRun.getPredicate(userRemoved: false) @@ -170,6 +170,11 @@ struct MRoutineRunList: View { } try viewContext.save() + + // update the widget(s), if any + try WidgetEntry.refresh(viewContext, + reload: true, + defaultColor: .accentColor) } catch { logger.error("\(#function): \(error.localizedDescription)") } diff --git a/Sources/Views/TaskRunList.swift b/Sources/Views/TaskRunList.swift index 85d4549..175793c 100644 --- a/Sources/Views/TaskRunList.swift +++ b/Sources/Views/TaskRunList.swift @@ -164,32 +164,15 @@ struct TaskRunList: View { } private func elapsedText(_ completedAt: Date?) -> some View { - ElapsedTimeText(elapsedSecs: getDuration(completedAt) ?? 0, timeElapsedFormat: timeElapsedFormat) + ElapsedTimeText(elapsedSecs: getDuration(completedAt) ?? 0, timeElapsedFormat: .hh_mm_ss) } -// private func intensityText(_ intensity: Float, _ units: Int16?) -> some View { -// Text(formattedIntensity(intensity, units)) -// .modify { -// if #available(iOS 16.1, watchOS 9.1, *) { -// $0.fontDesign(.monospaced) -// } else { -// $0.monospaced() -// } -// } -// } - private func durationText(_ duration: TimeInterval) -> some View { Text(tc.string(from: duration as NSNumber) ?? "") } // MARK: - Properties - // select a formatter to accommodate the duration - private var timeElapsedFormat: TimeElapsedFormat { - let secondsPerHour: TimeInterval = 3600 - return zRoutineRun.elapsedSecs < secondsPerHour ? .mm_ss : .hh_mm_ss - } - // MARK: - Actions // NOTE: 'removes' matching records, where present, from both mainStore and archiveStore. diff --git a/Task Routine Tracker Plus.xcodeproj/project.pbxproj b/Task Routine Tracker Plus.xcodeproj/project.pbxproj index 02ced50..eb6dd4b 100644 --- a/Task Routine Tracker Plus.xcodeproj/project.pbxproj +++ b/Task Routine Tracker Plus.xcodeproj/project.pbxproj @@ -12,6 +12,13 @@ 402A5F32296B835B00A43DB3 /* Tabler in Frameworks */ = {isa = PBXBuildFile; productRef = 402A5F31296B835B00A43DB3 /* Tabler */; }; 403CA2CE2971F6660084785B /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = 403CA2CD2971F6660084785B /* ZIPFoundation */; }; 403CA2D22972829F0084785B /* PlusSettingsForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 403CA2D12972829F0084785B /* PlusSettingsForm.swift */; }; + 4057023E29EA127A00F92502 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4004527629E399D200B0D7B2 /* WidgetKit.framework */; }; + 4057023F29EA127A00F92502 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4004527829E399D200B0D7B2 /* SwiftUI.framework */; }; + 4057024229EA127A00F92502 /* WidgetTRTPBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4057024129EA127A00F92502 /* WidgetTRTPBundle.swift */; }; + 4057024429EA127A00F92502 /* WidgetTRTP.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4057024329EA127A00F92502 /* WidgetTRTP.swift */; }; + 4057024629EA127A00F92502 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4057024529EA127A00F92502 /* Assets.xcassets */; }; + 4057024A29EA127A00F92502 /* WidgetTRTPExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 4057023D29EA127A00F92502 /* WidgetTRTPExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 4057024F29EA128200F92502 /* TroutUI in Frameworks */ = {isa = PBXBuildFile; productRef = 4057024E29EA128200F92502 /* TroutUI */; }; 40879D6E29CC08B600D3C85F /* TaskRunList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40879D6D29CC08B600D3C85F /* TaskRunList.swift */; }; 408FACFE296CAC9300D02C9C /* RoutineRunList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 408FACFD296CABC400D02C9C /* RoutineRunList.swift */; }; 4094B3EE29C371E900670963 /* MainPortrait.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4094B3ED29C371E900670963 /* MainPortrait.swift */; }; @@ -28,11 +35,43 @@ 40EBE1CC29635306004B9189 /* TroutUI in Frameworks */ = {isa = PBXBuildFile; productRef = 40EBE1CB29635306004B9189 /* TroutUI */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 4057024829EA127A00F92502 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 40E347B229452CF0003A19B9 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4057023C29EA127A00F92502; + remoteInfo = WidgetTRTPExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 4004528529E399D300B0D7B2 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 4057024A29EA127A00F92502 /* WidgetTRTPExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ + 4004527629E399D200B0D7B2 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + 4004527829E399D200B0D7B2 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; 4011EECC2961C9B000A36D87 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 4011EECE2961C9BC00A36D87 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 402A5F2E296B7F7B00A43DB3 /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = ""; }; 403CA2D12972829F0084785B /* PlusSettingsForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusSettingsForm.swift; sourceTree = ""; }; + 4057023D29EA127A00F92502 /* WidgetTRTPExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = WidgetTRTPExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 4057024129EA127A00F92502 /* WidgetTRTPBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetTRTPBundle.swift; sourceTree = ""; }; + 4057024329EA127A00F92502 /* WidgetTRTP.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetTRTP.swift; sourceTree = ""; }; + 4057024529EA127A00F92502 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 4057024729EA127A00F92502 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4057025029EA12A500F92502 /* WidgetTRTPExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WidgetTRTPExtension.entitlements; sourceTree = ""; }; 40879D6D29CC08B600D3C85F /* TaskRunList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskRunList.swift; sourceTree = ""; }; 408FACFD296CABC400D02C9C /* RoutineRunList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoutineRunList.swift; sourceTree = ""; }; 4094B3ED29C371E900670963 /* MainPortrait.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainPortrait.swift; sourceTree = ""; }; @@ -49,6 +88,16 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 4057023A29EA127A00F92502 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4057024F29EA128200F92502 /* TroutUI in Frameworks */, + 4057023F29EA127A00F92502 /* SwiftUI.framework in Frameworks */, + 4057023E29EA127A00F92502 /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 40E347B729452CF1003A19B9 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -81,9 +130,22 @@ path = Views; sourceTree = ""; }; + 4057024029EA127A00F92502 /* WidgetTRTP */ = { + isa = PBXGroup; + children = ( + 4057024129EA127A00F92502 /* WidgetTRTPBundle.swift */, + 4057024329EA127A00F92502 /* WidgetTRTP.swift */, + 4057024529EA127A00F92502 /* Assets.xcassets */, + 4057024729EA127A00F92502 /* Info.plist */, + ); + path = WidgetTRTP; + sourceTree = ""; + }; 40B51E41294549D90047377A /* Frameworks */ = { isa = PBXGroup; children = ( + 4004527629E399D200B0D7B2 /* WidgetKit.framework */, + 4004527829E399D200B0D7B2 /* SwiftUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -91,9 +153,11 @@ 40E347B129452CF0003A19B9 = { isa = PBXGroup; children = ( + 4057025029EA12A500F92502 /* WidgetTRTPExtension.entitlements */, 4011EECC2961C9B000A36D87 /* LICENSE */, 4011EECE2961C9BC00A36D87 /* README.md */, 40E347BC29452CF1003A19B9 /* Sources */, + 4057024029EA127A00F92502 /* WidgetTRTP */, 40E347BB29452CF1003A19B9 /* Products */, 40B51E41294549D90047377A /* Frameworks */, ); @@ -103,6 +167,7 @@ isa = PBXGroup; children = ( 40E347BA29452CF1003A19B9 /* Task Routine Tracker Plus.app */, + 4057023D29EA127A00F92502 /* WidgetTRTPExtension.appex */, ); name = Products; sourceTree = ""; @@ -131,6 +196,26 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 4057023C29EA127A00F92502 /* WidgetTRTPExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4057024B29EA127A00F92502 /* Build configuration list for PBXNativeTarget "WidgetTRTPExtension" */; + buildPhases = ( + 4057023929EA127A00F92502 /* Sources */, + 4057023A29EA127A00F92502 /* Frameworks */, + 4057023B29EA127A00F92502 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WidgetTRTPExtension; + packageProductDependencies = ( + 4057024E29EA128200F92502 /* TroutUI */, + ); + productName = WidgetTRTPExtension; + productReference = 4057023D29EA127A00F92502 /* WidgetTRTPExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; 40E347B929452CF1003A19B9 /* Task Routine Tracker Plus */ = { isa = PBXNativeTarget; buildConfigurationList = 40E347C929452CF1003A19B9 /* Build configuration list for PBXNativeTarget "Task Routine Tracker Plus" */; @@ -138,10 +223,12 @@ 40E347B629452CF1003A19B9 /* Sources */, 40E347B729452CF1003A19B9 /* Frameworks */, 40E347B829452CF1003A19B9 /* Resources */, + 4004528529E399D300B0D7B2 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + 4057024929EA127A00F92502 /* PBXTargetDependency */, ); name = "Task Routine Tracker Plus"; packageProductDependencies = ( @@ -163,9 +250,12 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1410; - LastUpgradeCheck = 1420; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1500; TargetAttributes = { + 4057023C29EA127A00F92502 = { + CreatedOnToolsVersion = 14.3; + }; 40E347B929452CF1003A19B9 = { CreatedOnToolsVersion = 14.1; }; @@ -191,11 +281,20 @@ projectRoot = ""; targets = ( 40E347B929452CF1003A19B9 /* Task Routine Tracker Plus */, + 4057023C29EA127A00F92502 /* WidgetTRTPExtension */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 4057023B29EA127A00F92502 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4057024629EA127A00F92502 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 40E347B829452CF1003A19B9 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -209,6 +308,15 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 4057023929EA127A00F92502 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4057024229EA127A00F92502 /* WidgetTRTPBundle.swift in Sources */, + 4057024429EA127A00F92502 /* WidgetTRTP.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 40E347B629452CF1003A19B9 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -228,11 +336,87 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 4057024929EA127A00F92502 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 4057023C29EA127A00F92502 /* WidgetTRTPExtension */; + targetProxy = 4057024829EA127A00F92502 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ + 4057024C29EA127A00F92502 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = WidgetTRTPExtension.entitlements; + CODE_SIGN_IDENTITY = "-"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 8; + DEVELOPMENT_TEAM = J735QC5U38; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WidgetTRTP/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = WidgetTRTP; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 13.3; + MARKETING_VERSION = 1.2.0; + PRODUCT_BUNDLE_IDENTIFIER = org.openalloc.trout.plus.WidgetTRTP; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 4057024D29EA127A00F92502 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = WidgetTRTPExtension.entitlements; + CODE_SIGN_IDENTITY = "-"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 8; + DEVELOPMENT_TEAM = J735QC5U38; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WidgetTRTP/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = WidgetTRTP; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 13.3; + MARKETING_VERSION = 1.2.0; + PRODUCT_BUNDLE_IDENTIFIER = org.openalloc.trout.plus.WidgetTRTP; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; 40E347C729452CF1003A19B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -266,6 +450,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -280,6 +465,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MARKETING_VERSION = 1.2.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -292,6 +478,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -325,6 +512,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -333,6 +521,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MARKETING_VERSION = 1.2.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SWIFT_COMPILATION_MODE = wholemodule; @@ -343,13 +532,14 @@ 40E347CA29452CF1003A19B9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Sources/App.entitlements; CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 8; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Sources/Preview Content\""; DEVELOPMENT_TEAM = J735QC5U38; @@ -373,7 +563,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = org.openalloc.trout.plus; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; @@ -389,13 +579,14 @@ 40E347CB29452CF1003A19B9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Sources/App.entitlements; CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 8; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Sources/Preview Content\""; DEVELOPMENT_TEAM = J735QC5U38; @@ -419,7 +610,7 @@ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = org.openalloc.trout.plus; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; @@ -435,6 +626,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 4057024B29EA127A00F92502 /* Build configuration list for PBXNativeTarget "WidgetTRTPExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4057024C29EA127A00F92502 /* Debug */, + 4057024D29EA127A00F92502 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 40E347B529452CF0003A19B9 /* Build configuration list for PBXProject "Task Routine Tracker Plus" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -501,6 +701,10 @@ package = 403CA2CC2971F6660084785B /* XCRemoteSwiftPackageReference "ZIPFoundation" */; productName = ZIPFoundation; }; + 4057024E29EA128200F92502 /* TroutUI */ = { + isa = XCSwiftPackageProductDependency; + productName = TroutUI; + }; 40B51E44294549DF0047377A /* TroutUI */ = { isa = XCSwiftPackageProductDependency; productName = TroutUI; diff --git a/Task Routine Tracker Plus.xcodeproj/xcshareddata/xcschemes/Task Routine Tracker Plus.xcscheme b/Task Routine Tracker Plus.xcodeproj/xcshareddata/xcschemes/Task Routine Tracker Plus.xcscheme index 7c55df1..dc02b2a 100644 --- a/Task Routine Tracker Plus.xcodeproj/xcshareddata/xcschemes/Task Routine Tracker Plus.xcscheme +++ b/Task Routine Tracker Plus.xcodeproj/xcshareddata/xcschemes/Task Routine Tracker Plus.xcscheme @@ -1,6 +1,6 @@ + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/WidgetTRTP/WidgetTRTP.swift b/WidgetTRTP/WidgetTRTP.swift new file mode 100644 index 0000000..d812d32 --- /dev/null +++ b/WidgetTRTP/WidgetTRTP.swift @@ -0,0 +1,37 @@ +// +// WidgetTRTP.swift +// +// Copyright 2023 OpenAlloc LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// + +import SwiftUI +import WidgetKit + +import TroutLib +import TroutUI + +struct WidgetTRTP: Widget { + let kind: String = "WidgetTRTP" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: Provider()) { entry in + WidgetView(entry: entry) + } + .configurationDisplayName("Task Routines") + .description("Time since last task routine.") + .supportedFamilies([.systemSmall]) + } +} + +struct WidgetTRTP_Previews: PreviewProvider { + static var previews: some View { + let entry = WidgetEntry(name: "Travel", imageName: nil, timeInterval: 1000, color: nil) + return WidgetView(entry: entry) + .accentColor(.blue) + .previewContext(WidgetPreviewContext(family: .systemSmall)) + } +} diff --git a/WidgetTRTP/WidgetTRTPBundle.swift b/WidgetTRTP/WidgetTRTPBundle.swift new file mode 100644 index 0000000..24b6be6 --- /dev/null +++ b/WidgetTRTP/WidgetTRTPBundle.swift @@ -0,0 +1,16 @@ +// +// WidgetTRTPBundle.swift +// WidgetTRTP +// +// Created by Reed Esau on 4/14/23. +// + +import SwiftUI +import WidgetKit + +@main +struct WidgetTRTPBundle: WidgetBundle { + var body: some Widget { + WidgetTRTP() + } +} diff --git a/WidgetTRTPExtension.entitlements b/WidgetTRTPExtension.entitlements new file mode 100644 index 0000000..a78ae4e --- /dev/null +++ b/WidgetTRTPExtension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.org.openalloc.trout + + +