Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--wraparguments after-first

# was changing
# let routine: Routine = Routine.get(viewContext, forURIRepresentation: routineURI)
# to
# let routine = Routine.get(viewContext, forURIRepresentation: routineURI)
--disable redundantType
42 changes: 13 additions & 29 deletions Gym Routine Tracker Plus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
4001ED0D29732D4500F165ED /* ExportSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4001ED0C29732D4500F165ED /* ExportSettings.swift */; };
4001ED0F29732E1300F165ED /* ColorSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4001ED0E29732E1300F165ED /* ColorSettings.swift */; };
401064D92973374700BFB00E /* ZipDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 401064D82973374700BFB00E /* ZipDocument.swift */; };
4011EECD2961C9B000A36D87 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 4011EECC2961C9B000A36D87 /* LICENSE */; };
40245EF6296BE7D4007B5DAB /* ExerciseRunList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40245EF5296BE7D4007B5DAB /* ExerciseRunList.swift */; };
402A5F2F296B7FE000A43DB3 /* HistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 402A5F2E296B7F7B00A43DB3 /* HistoryView.swift */; };
402A5F32296B835B00A43DB3 /* Tabler in Frameworks */ = {isa = PBXBuildFile; productRef = 402A5F31296B835B00A43DB3 /* Tabler */; };
403CA2CE2971F6660084785B /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = 403CA2CD2971F6660084785B /* ZIPFoundation */; };
403CA2D0297220460084785B /* Export-Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 403CA2CF29721E750084785B /* Export-Utils.swift */; };
403CA2D22972829F0084785B /* PhoneSettingsForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 403CA2D12972829F0084785B /* PhoneSettingsForm.swift */; };
408FACFE296CAC9300D02C9C /* RoutineRunList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 408FACFD296CABC400D02C9C /* RoutineRunList.swift */; };
40B51E45294549DF0047377A /* GroutUI in Frameworks */ = {isa = PBXBuildFile; productRef = 40B51E44294549DF0047377A /* GroutUI */; };
Expand All @@ -29,14 +25,10 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
4001ED0C29732D4500F165ED /* ExportSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExportSettings.swift; sourceTree = "<group>"; };
4001ED0E29732E1300F165ED /* ColorSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorSettings.swift; sourceTree = "<group>"; };
401064D82973374700BFB00E /* ZipDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZipDocument.swift; sourceTree = "<group>"; };
4011EECC2961C9B000A36D87 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
4011EECE2961C9BC00A36D87 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
40245EF5296BE7D4007B5DAB /* ExerciseRunList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExerciseRunList.swift; sourceTree = "<group>"; };
402A5F2E296B7F7B00A43DB3 /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = "<group>"; };
403CA2CF29721E750084785B /* Export-Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Export-Utils.swift"; sourceTree = "<group>"; };
403CA2D12972829F0084785B /* PhoneSettingsForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneSettingsForm.swift; sourceTree = "<group>"; };
408FACFD296CABC400D02C9C /* RoutineRunList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoutineRunList.swift; sourceTree = "<group>"; };
40E347BA29452CF1003A19B9 /* Gym Routine Tracker Plus.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Gym Routine Tracker Plus.app"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -65,22 +57,11 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
401064DA2973378500BFB00E /* Helper */ = {
isa = PBXGroup;
children = (
401064D82973374700BFB00E /* ZipDocument.swift */,
403CA2CF29721E750084785B /* Export-Utils.swift */,
);
path = Helper;
sourceTree = "<group>";
};
401064DB2973378C00BFB00E /* Views */ = {
isa = PBXGroup;
children = (
40E347BF29452CF1003A19B9 /* ContentView.swift */,
4001ED0E29732E1300F165ED /* ColorSettings.swift */,
40245EF5296BE7D4007B5DAB /* ExerciseRunList.swift */,
4001ED0C29732D4500F165ED /* ExportSettings.swift */,
402A5F2E296B7F7B00A43DB3 /* HistoryView.swift */,
403CA2D12972829F0084785B /* PhoneSettingsForm.swift */,
408FACFD296CABC400D02C9C /* RoutineRunList.swift */,
Expand Down Expand Up @@ -119,7 +100,6 @@
children = (
40E347BD29452CF1003A19B9 /* PlusApp.swift */,
401064DB2973378C00BFB00E /* Views */,
401064DA2973378500BFB00E /* Helper */,
40E347C329452CF1003A19B9 /* App.entitlements */,
40E347C129452CF1003A19B9 /* Assets.xcassets */,
40EBCFDE294BFB880082A172 /* Info.plist */,
Expand Down Expand Up @@ -172,7 +152,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1410;
LastUpgradeCheck = 1410;
LastUpgradeCheck = 1420;
TargetAttributes = {
40E347B929452CF1003A19B9 = {
CreatedOnToolsVersion = 14.1;
Expand Down Expand Up @@ -223,10 +203,6 @@
files = (
40E347C029452CF1003A19B9 /* ContentView.swift in Sources */,
403CA2D22972829F0084785B /* PhoneSettingsForm.swift in Sources */,
4001ED0F29732E1300F165ED /* ColorSettings.swift in Sources */,
4001ED0D29732D4500F165ED /* ExportSettings.swift in Sources */,
401064D92973374700BFB00E /* ZipDocument.swift in Sources */,
403CA2D0297220460084785B /* Export-Utils.swift in Sources */,
408FACFE296CAC9300D02C9C /* RoutineRunList.swift in Sources */,
40245EF6296BE7D4007B5DAB /* ExerciseRunList.swift in Sources */,
402A5F2F296B7FE000A43DB3 /* HistoryView.swift in Sources */,
Expand Down Expand Up @@ -270,6 +246,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -328,6 +305,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -352,15 +330,18 @@
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 = 10;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Sources/Preview Content\"";
DEVELOPMENT_TEAM = J735QC5U38;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Sources/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Gym RT+";
INFOPLIST_KEY_CFBundleDisplayName = "Gym Routines";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.healthcare-fitness";
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
Expand All @@ -376,7 +357,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.6.1;
MARKETING_VERSION = 1.7.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openalloc.grout.plus;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
Expand All @@ -395,15 +376,18 @@
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 = 10;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Sources/Preview Content\"";
DEVELOPMENT_TEAM = J735QC5U38;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Sources/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Gym RT+";
INFOPLIST_KEY_CFBundleDisplayName = "Gym Routines";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.healthcare-fitness";
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
Expand All @@ -419,7 +403,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.6.1;
MARKETING_VERSION = 1.7.0;
PRODUCT_BUNDLE_IDENTIFIER = org.openalloc.grout.plus;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<key>Gym Routine Tracker Plus.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down
54 changes: 0 additions & 54 deletions Sources/Helper/Export-Utils.swift

This file was deleted.

32 changes: 0 additions & 32 deletions Sources/Helper/ZipDocument.swift

This file was deleted.

22 changes: 13 additions & 9 deletions Sources/PlusApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,35 @@ import SwiftUI

import GroutLib
import GroutUI
import TrackerLib
import TrackerUI

@main
struct Gym_Routine_Tracker_Plus_App: App {
let persistenceManager = PersistenceManager.shared
@Environment(\.scenePhase) var scenePhase

// MARK: - Locals

private let coreDataStack = CoreDataStack(isCloud: true)

@AppStorage(colorSchemeModeKey) var colorSchemeMode: ColorSchemeMode = .automatic

@Environment(\.scenePhase) var scenePhase
private let logger = Logger(subsystem: Bundle.main.bundleIdentifier!,
category: "App")

private let logger = Logger(
subsystem: Bundle.main.bundleIdentifier!,
category: "App"
)
// MARK: - Scene

var body: some Scene {
WindowGroup {
ContentView()
.environment(\.managedObjectContext,
persistenceManager.container.viewContext)
.environment(\.managedObjectContext, coreDataStack.container.viewContext)
.environmentObject(coreDataStack)
.preferredColorScheme(colorSchemeMode.colorScheme)
}
.onChange(of: scenePhase) { _ in
// save if: (1) app moved to background, and (2) changes are pending
do {
try persistenceManager.container.viewContext.save()
try coreDataStack.container.viewContext.save()
} catch {
logger.error("\(#function): \(error.localizedDescription)")
}
Expand Down
44 changes: 0 additions & 44 deletions Sources/Views/ColorSettings.swift

This file was deleted.

Loading