From 0cdb20e0652c90963bd9ece770c0934c7ba0eae5 Mon Sep 17 00:00:00 2001 From: Kameron Kenny Date: Mon, 17 Mar 2025 14:20:49 -0400 Subject: [PATCH] Initial Commit --- Gas Man.xcodeproj/project.pbxproj | 611 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcschemes/xcschememanagement.plist | 14 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 85 +++ Gas Man/Assets.xcassets/Contents.json | 6 + Gas Man/ContentView.swift | 88 +++ Gas Man/Gas_Man.entitlements | 20 + .../Gas_Man.xcdatamodeld/.xccurrentversion | 8 + .../Gas_Man.xcdatamodel/contents | 9 + Gas Man/Gas_ManApp.swift | 20 + Gas Man/Info.plist | 10 + Gas Man/Persistence.swift | 57 ++ .../Preview Assets.xcassets/Contents.json | 6 + Gas ManTests/Gas_ManTests.swift | 35 + Gas ManUITests/Gas_ManUITests.swift | 43 ++ .../Gas_ManUITestsLaunchTests.swift | 33 + 17 files changed, 1063 insertions(+) create mode 100644 Gas Man.xcodeproj/project.pbxproj create mode 100644 Gas Man.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Gas Man.xcodeproj/xcuserdata/kkenny.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Gas Man/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Gas Man/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Gas Man/Assets.xcassets/Contents.json create mode 100644 Gas Man/ContentView.swift create mode 100644 Gas Man/Gas_Man.entitlements create mode 100644 Gas Man/Gas_Man.xcdatamodeld/.xccurrentversion create mode 100644 Gas Man/Gas_Man.xcdatamodeld/Gas_Man.xcdatamodel/contents create mode 100644 Gas Man/Gas_ManApp.swift create mode 100644 Gas Man/Info.plist create mode 100644 Gas Man/Persistence.swift create mode 100644 Gas Man/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Gas ManTests/Gas_ManTests.swift create mode 100644 Gas ManUITests/Gas_ManUITests.swift create mode 100644 Gas ManUITests/Gas_ManUITestsLaunchTests.swift diff --git a/Gas Man.xcodeproj/project.pbxproj b/Gas Man.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6df2ad5 --- /dev/null +++ b/Gas Man.xcodeproj/project.pbxproj @@ -0,0 +1,611 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXContainerItemProxy section */ + 3D3444682D889F7F00AA3172 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3D3444482D889F7D00AA3172 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3D34444F2D889F7D00AA3172; + remoteInfo = "Gas Man"; + }; + 3D3444722D889F8000AA3172 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3D3444482D889F7D00AA3172 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3D34444F2D889F7D00AA3172; + remoteInfo = "Gas Man"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 3D3444502D889F7D00AA3172 /* Gas Man.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Gas Man.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3D3444672D889F7F00AA3172 /* Gas ManTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Gas ManTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3D3444712D889F8000AA3172 /* Gas ManUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Gas ManUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + 3D3444792D889F8000AA3172 /* Exceptions for "Gas Man" folder in "Gas Man" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = 3D34444F2D889F7D00AA3172 /* Gas Man */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 3D3444522D889F7D00AA3172 /* Gas Man */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 3D3444792D889F8000AA3172 /* Exceptions for "Gas Man" folder in "Gas Man" target */, + ); + path = "Gas Man"; + sourceTree = ""; + }; + 3D34446A2D889F7F00AA3172 /* Gas ManTests */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = "Gas ManTests"; + sourceTree = ""; + }; + 3D3444742D889F8000AA3172 /* Gas ManUITests */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = "Gas ManUITests"; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3D34444D2D889F7D00AA3172 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3444642D889F7F00AA3172 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D34446E2D889F8000AA3172 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3D3444472D889F7D00AA3172 = { + isa = PBXGroup; + children = ( + 3D3444522D889F7D00AA3172 /* Gas Man */, + 3D34446A2D889F7F00AA3172 /* Gas ManTests */, + 3D3444742D889F8000AA3172 /* Gas ManUITests */, + 3D3444512D889F7D00AA3172 /* Products */, + ); + sourceTree = ""; + }; + 3D3444512D889F7D00AA3172 /* Products */ = { + isa = PBXGroup; + children = ( + 3D3444502D889F7D00AA3172 /* Gas Man.app */, + 3D3444672D889F7F00AA3172 /* Gas ManTests.xctest */, + 3D3444712D889F8000AA3172 /* Gas ManUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3D34444F2D889F7D00AA3172 /* Gas Man */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D34447A2D889F8000AA3172 /* Build configuration list for PBXNativeTarget "Gas Man" */; + buildPhases = ( + 3D34444C2D889F7D00AA3172 /* Sources */, + 3D34444D2D889F7D00AA3172 /* Frameworks */, + 3D34444E2D889F7D00AA3172 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 3D3444522D889F7D00AA3172 /* Gas Man */, + ); + name = "Gas Man"; + packageProductDependencies = ( + ); + productName = "Gas Man"; + productReference = 3D3444502D889F7D00AA3172 /* Gas Man.app */; + productType = "com.apple.product-type.application"; + }; + 3D3444662D889F7F00AA3172 /* Gas ManTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D34447F2D889F8000AA3172 /* Build configuration list for PBXNativeTarget "Gas ManTests" */; + buildPhases = ( + 3D3444632D889F7F00AA3172 /* Sources */, + 3D3444642D889F7F00AA3172 /* Frameworks */, + 3D3444652D889F7F00AA3172 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3D3444692D889F7F00AA3172 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + 3D34446A2D889F7F00AA3172 /* Gas ManTests */, + ); + name = "Gas ManTests"; + packageProductDependencies = ( + ); + productName = "Gas ManTests"; + productReference = 3D3444672D889F7F00AA3172 /* Gas ManTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 3D3444702D889F8000AA3172 /* Gas ManUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D3444822D889F8000AA3172 /* Build configuration list for PBXNativeTarget "Gas ManUITests" */; + buildPhases = ( + 3D34446D2D889F8000AA3172 /* Sources */, + 3D34446E2D889F8000AA3172 /* Frameworks */, + 3D34446F2D889F8000AA3172 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3D3444732D889F8000AA3172 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + 3D3444742D889F8000AA3172 /* Gas ManUITests */, + ); + name = "Gas ManUITests"; + packageProductDependencies = ( + ); + productName = "Gas ManUITests"; + productReference = 3D3444712D889F8000AA3172 /* Gas ManUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3D3444482D889F7D00AA3172 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1610; + LastUpgradeCheck = 1610; + TargetAttributes = { + 3D34444F2D889F7D00AA3172 = { + CreatedOnToolsVersion = 16.1; + }; + 3D3444662D889F7F00AA3172 = { + CreatedOnToolsVersion = 16.1; + TestTargetID = 3D34444F2D889F7D00AA3172; + }; + 3D3444702D889F8000AA3172 = { + CreatedOnToolsVersion = 16.1; + TestTargetID = 3D34444F2D889F7D00AA3172; + }; + }; + }; + buildConfigurationList = 3D34444B2D889F7D00AA3172 /* Build configuration list for PBXProject "Gas Man" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3D3444472D889F7D00AA3172; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = 3D3444512D889F7D00AA3172 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3D34444F2D889F7D00AA3172 /* Gas Man */, + 3D3444662D889F7F00AA3172 /* Gas ManTests */, + 3D3444702D889F8000AA3172 /* Gas ManUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3D34444E2D889F7D00AA3172 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3444652D889F7F00AA3172 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D34446F2D889F8000AA3172 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3D34444C2D889F7D00AA3172 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3444632D889F7F00AA3172 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D34446D2D889F8000AA3172 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 3D3444692D889F7F00AA3172 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3D34444F2D889F7D00AA3172 /* Gas Man */; + targetProxy = 3D3444682D889F7F00AA3172 /* PBXContainerItemProxy */; + }; + 3D3444732D889F8000AA3172 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3D34444F2D889F7D00AA3172 /* Gas Man */; + targetProxy = 3D3444722D889F8000AA3172 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 3D34447B2D889F8000AA3172 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "Gas Man/Gas_Man.entitlements"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Gas Man/Preview Content\""; + DEVELOPMENT_TEAM = Z734T5CD6B; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Gas Man/Info.plist"; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 14.7; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "pro.thelinux.Gas-Man"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Debug; + }; + 3D34447C2D889F8000AA3172 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "Gas Man/Gas_Man.entitlements"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Gas Man/Preview Content\""; + DEVELOPMENT_TEAM = Z734T5CD6B; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Gas Man/Info.plist"; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 14.7; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "pro.thelinux.Gas-Man"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Release; + }; + 3D34447D2D889F8000AA3172 /* 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"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 3D34447E2D889F8000AA3172 /* Release */ = { + 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"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + }; + name = Release; + }; + 3D3444802D889F8000AA3172 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = Z734T5CD6B; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + MACOSX_DEPLOYMENT_TARGET = 14.7; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "pro.thelinux.Gas-ManTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Gas Man.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Gas Man"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Debug; + }; + 3D3444812D889F8000AA3172 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = Z734T5CD6B; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + MACOSX_DEPLOYMENT_TARGET = 14.7; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "pro.thelinux.Gas-ManTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Gas Man.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Gas Man"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Release; + }; + 3D3444832D889F8000AA3172 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = Z734T5CD6B; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + MACOSX_DEPLOYMENT_TARGET = 14.7; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "pro.thelinux.Gas-ManUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + TEST_TARGET_NAME = "Gas Man"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Debug; + }; + 3D3444842D889F8000AA3172 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = Z734T5CD6B; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + MACOSX_DEPLOYMENT_TARGET = 14.7; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "pro.thelinux.Gas-ManUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + TEST_TARGET_NAME = "Gas Man"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3D34444B2D889F7D00AA3172 /* Build configuration list for PBXProject "Gas Man" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D34447D2D889F8000AA3172 /* Debug */, + 3D34447E2D889F8000AA3172 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3D34447A2D889F8000AA3172 /* Build configuration list for PBXNativeTarget "Gas Man" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D34447B2D889F8000AA3172 /* Debug */, + 3D34447C2D889F8000AA3172 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3D34447F2D889F8000AA3172 /* Build configuration list for PBXNativeTarget "Gas ManTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D3444802D889F8000AA3172 /* Debug */, + 3D3444812D889F8000AA3172 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3D3444822D889F8000AA3172 /* Build configuration list for PBXNativeTarget "Gas ManUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D3444832D889F8000AA3172 /* Debug */, + 3D3444842D889F8000AA3172 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3D3444482D889F7D00AA3172 /* Project object */; +} diff --git a/Gas Man.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Gas Man.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Gas Man.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Gas Man.xcodeproj/xcuserdata/kkenny.xcuserdatad/xcschemes/xcschememanagement.plist b/Gas Man.xcodeproj/xcuserdata/kkenny.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..20c817c --- /dev/null +++ b/Gas Man.xcodeproj/xcuserdata/kkenny.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Gas Man.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Gas Man/Assets.xcassets/AccentColor.colorset/Contents.json b/Gas Man/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Gas Man/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Gas Man/Assets.xcassets/AppIcon.appiconset/Contents.json b/Gas Man/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..ffdfe15 --- /dev/null +++ b/Gas Man/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,85 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Gas Man/Assets.xcassets/Contents.json b/Gas Man/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Gas Man/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Gas Man/ContentView.swift b/Gas Man/ContentView.swift new file mode 100644 index 0000000..9201124 --- /dev/null +++ b/Gas Man/ContentView.swift @@ -0,0 +1,88 @@ +// +// ContentView.swift +// Gas Man +// +// Created by Kameron Kenny on 3/17/25. +// + +import SwiftUI +import CoreData + +struct ContentView: View { + @Environment(\.managedObjectContext) private var viewContext + + @FetchRequest( + sortDescriptors: [NSSortDescriptor(keyPath: \Item.timestamp, ascending: true)], + animation: .default) + private var items: FetchedResults + + var body: some View { + NavigationView { + List { + ForEach(items) { item in + NavigationLink { + Text("Item at \(item.timestamp!, formatter: itemFormatter)") + } label: { + Text(item.timestamp!, formatter: itemFormatter) + } + } + .onDelete(perform: deleteItems) + } + .toolbar { +#if os(iOS) + ToolbarItem(placement: .navigationBarTrailing) { + EditButton() + } +#endif + ToolbarItem { + Button(action: addItem) { + Label("Add Item", systemImage: "plus") + } + } + } + Text("Select an item") + } + } + + private func addItem() { + withAnimation { + let newItem = Item(context: viewContext) + newItem.timestamp = Date() + + do { + try viewContext.save() + } catch { + // Replace this implementation with code to handle the error appropriately. + // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + let nsError = error as NSError + fatalError("Unresolved error \(nsError), \(nsError.userInfo)") + } + } + } + + private func deleteItems(offsets: IndexSet) { + withAnimation { + offsets.map { items[$0] }.forEach(viewContext.delete) + + do { + try viewContext.save() + } catch { + // Replace this implementation with code to handle the error appropriately. + // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + let nsError = error as NSError + fatalError("Unresolved error \(nsError), \(nsError.userInfo)") + } + } + } +} + +private let itemFormatter: DateFormatter = { + let formatter = DateFormatter() + formatter.dateStyle = .short + formatter.timeStyle = .medium + return formatter +}() + +#Preview { + ContentView().environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) +} diff --git a/Gas Man/Gas_Man.entitlements b/Gas Man/Gas_Man.entitlements new file mode 100644 index 0000000..53000f3 --- /dev/null +++ b/Gas Man/Gas_Man.entitlements @@ -0,0 +1,20 @@ + + + + + aps-environment + development + com.apple.developer.aps-environment + development + com.apple.developer.icloud-container-identifiers + + com.apple.developer.icloud-services + + CloudKit + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/Gas Man/Gas_Man.xcdatamodeld/.xccurrentversion b/Gas Man/Gas_Man.xcdatamodeld/.xccurrentversion new file mode 100644 index 0000000..5d0a5a1 --- /dev/null +++ b/Gas Man/Gas_Man.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + Gas_Man.xcdatamodel + + diff --git a/Gas Man/Gas_Man.xcdatamodeld/Gas_Man.xcdatamodel/contents b/Gas Man/Gas_Man.xcdatamodeld/Gas_Man.xcdatamodel/contents new file mode 100644 index 0000000..e8d6ec8 --- /dev/null +++ b/Gas Man/Gas_Man.xcdatamodeld/Gas_Man.xcdatamodel/contents @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Gas Man/Gas_ManApp.swift b/Gas Man/Gas_ManApp.swift new file mode 100644 index 0000000..5dc3538 --- /dev/null +++ b/Gas Man/Gas_ManApp.swift @@ -0,0 +1,20 @@ +// +// Gas_ManApp.swift +// Gas Man +// +// Created by Kameron Kenny on 3/17/25. +// + +import SwiftUI + +@main +struct Gas_ManApp: App { + let persistenceController = PersistenceController.shared + + var body: some Scene { + WindowGroup { + ContentView() + .environment(\.managedObjectContext, persistenceController.container.viewContext) + } + } +} diff --git a/Gas Man/Info.plist b/Gas Man/Info.plist new file mode 100644 index 0000000..ca9a074 --- /dev/null +++ b/Gas Man/Info.plist @@ -0,0 +1,10 @@ + + + + + UIBackgroundModes + + remote-notification + + + diff --git a/Gas Man/Persistence.swift b/Gas Man/Persistence.swift new file mode 100644 index 0000000..e9118a4 --- /dev/null +++ b/Gas Man/Persistence.swift @@ -0,0 +1,57 @@ +// +// Persistence.swift +// Gas Man +// +// Created by Kameron Kenny on 3/17/25. +// + +import CoreData + +struct PersistenceController { + static let shared = PersistenceController() + + @MainActor + static let preview: PersistenceController = { + let result = PersistenceController(inMemory: true) + let viewContext = result.container.viewContext + for _ in 0..<10 { + let newItem = Item(context: viewContext) + newItem.timestamp = Date() + } + do { + try viewContext.save() + } catch { + // Replace this implementation with code to handle the error appropriately. + // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + let nsError = error as NSError + fatalError("Unresolved error \(nsError), \(nsError.userInfo)") + } + return result + }() + + let container: NSPersistentCloudKitContainer + + init(inMemory: Bool = false) { + container = NSPersistentCloudKitContainer(name: "Gas_Man") + if inMemory { + container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null") + } + container.loadPersistentStores(completionHandler: { (storeDescription, error) in + if let error = error as NSError? { + // Replace this implementation with code to handle the error appropriately. + // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + + /* + Typical reasons for an error here include: + * The parent directory does not exist, cannot be created, or disallows writing. + * The persistent store is not accessible, due to permissions or data protection when the device is locked. + * The device is out of space. + * The store could not be migrated to the current model version. + Check the error message to determine what the actual problem was. + */ + fatalError("Unresolved error \(error), \(error.userInfo)") + } + }) + container.viewContext.automaticallyMergesChangesFromParent = true + } +} diff --git a/Gas Man/Preview Content/Preview Assets.xcassets/Contents.json b/Gas Man/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Gas Man/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Gas ManTests/Gas_ManTests.swift b/Gas ManTests/Gas_ManTests.swift new file mode 100644 index 0000000..0ac4b10 --- /dev/null +++ b/Gas ManTests/Gas_ManTests.swift @@ -0,0 +1,35 @@ +// +// Gas_ManTests.swift +// Gas ManTests +// +// Created by Kameron Kenny on 3/17/25. +// + +import XCTest + +final class Gas_ManTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Gas ManUITests/Gas_ManUITests.swift b/Gas ManUITests/Gas_ManUITests.swift new file mode 100644 index 0000000..2b36c58 --- /dev/null +++ b/Gas ManUITests/Gas_ManUITests.swift @@ -0,0 +1,43 @@ +// +// Gas_ManUITests.swift +// Gas ManUITests +// +// Created by Kameron Kenny on 3/17/25. +// + +import XCTest + +final class Gas_ManUITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + @MainActor + func testExample() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + @MainActor + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/Gas ManUITests/Gas_ManUITestsLaunchTests.swift b/Gas ManUITests/Gas_ManUITestsLaunchTests.swift new file mode 100644 index 0000000..59fc23f --- /dev/null +++ b/Gas ManUITests/Gas_ManUITestsLaunchTests.swift @@ -0,0 +1,33 @@ +// +// Gas_ManUITestsLaunchTests.swift +// Gas ManUITests +// +// Created by Kameron Kenny on 3/17/25. +// + +import XCTest + +final class Gas_ManUITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + @MainActor + func testLaunch() throws { + let app = XCUIApplication() + app.launch() + + // Insert steps here to perform after app launch but before taking a screenshot, + // such as logging into a test account or navigating somewhere in the app + + let attachment = XCTAttachment(screenshot: app.screenshot()) + attachment.name = "Launch Screen" + attachment.lifetime = .keepAlways + add(attachment) + } +}