commit 259ed6da270f140dcea4ea16f01f1caeabac2daf Author: gibbyb Date: Wed May 22 16:06:53 2024 -0500 Init commit. diff --git a/Tech Tracker.xcodeproj/project.pbxproj b/Tech Tracker.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9a6f785 --- /dev/null +++ b/Tech Tracker.xcodeproj/project.pbxproj @@ -0,0 +1,619 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 03308F442BC2035300D59E96 /* Tech_TrackerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03308F432BC2035300D59E96 /* Tech_TrackerApp.swift */; }; + 03308F462BC2035300D59E96 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03308F452BC2035300D59E96 /* ContentView.swift */; }; + 03308F482BC2035500D59E96 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03308F472BC2035500D59E96 /* Assets.xcassets */; }; + 03308F4B2BC2035500D59E96 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03308F4A2BC2035500D59E96 /* Preview Assets.xcassets */; }; + 03308F552BC2035500D59E96 /* Tech_TrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03308F542BC2035500D59E96 /* Tech_TrackerTests.swift */; }; + 03308F5F2BC2035500D59E96 /* Tech_TrackerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03308F5E2BC2035500D59E96 /* Tech_TrackerUITests.swift */; }; + 03308F612BC2035500D59E96 /* Tech_TrackerUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03308F602BC2035500D59E96 /* Tech_TrackerUITestsLaunchTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 03308F512BC2035500D59E96 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 03308F382BC2035300D59E96 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 03308F3F2BC2035300D59E96; + remoteInfo = "Tech Tracker"; + }; + 03308F5B2BC2035500D59E96 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 03308F382BC2035300D59E96 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 03308F3F2BC2035300D59E96; + remoteInfo = "Tech Tracker"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 03308F402BC2035300D59E96 /* Tech Tracker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tech Tracker.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 03308F432BC2035300D59E96 /* Tech_TrackerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tech_TrackerApp.swift; sourceTree = ""; }; + 03308F452BC2035300D59E96 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 03308F472BC2035500D59E96 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 03308F4A2BC2035500D59E96 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 03308F502BC2035500D59E96 /* Tech TrackerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tech TrackerTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 03308F542BC2035500D59E96 /* Tech_TrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tech_TrackerTests.swift; sourceTree = ""; }; + 03308F5A2BC2035500D59E96 /* Tech TrackerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tech TrackerUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 03308F5E2BC2035500D59E96 /* Tech_TrackerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tech_TrackerUITests.swift; sourceTree = ""; }; + 03308F602BC2035500D59E96 /* Tech_TrackerUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tech_TrackerUITestsLaunchTests.swift; sourceTree = ""; }; + 03C6583F2BC46B55003554A5 /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 03308F3D2BC2035300D59E96 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 03308F4D2BC2035500D59E96 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 03308F572BC2035500D59E96 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 03308F372BC2035300D59E96 = { + isa = PBXGroup; + children = ( + 03308F422BC2035300D59E96 /* Tech Tracker */, + 03308F532BC2035500D59E96 /* Tech TrackerTests */, + 03308F5D2BC2035500D59E96 /* Tech TrackerUITests */, + 03308F412BC2035300D59E96 /* Products */, + ); + sourceTree = ""; + }; + 03308F412BC2035300D59E96 /* Products */ = { + isa = PBXGroup; + children = ( + 03308F402BC2035300D59E96 /* Tech Tracker.app */, + 03308F502BC2035500D59E96 /* Tech TrackerTests.xctest */, + 03308F5A2BC2035500D59E96 /* Tech TrackerUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 03308F422BC2035300D59E96 /* Tech Tracker */ = { + isa = PBXGroup; + children = ( + 03308F6D2BC214AB00D59E96 /* Images */, + 03308F432BC2035300D59E96 /* Tech_TrackerApp.swift */, + 03308F452BC2035300D59E96 /* ContentView.swift */, + 03C6583F2BC46B55003554A5 /* Config.xcconfig */, + 03308F472BC2035500D59E96 /* Assets.xcassets */, + 03308F492BC2035500D59E96 /* Preview Content */, + ); + path = "Tech Tracker"; + sourceTree = ""; + }; + 03308F492BC2035500D59E96 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 03308F4A2BC2035500D59E96 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 03308F532BC2035500D59E96 /* Tech TrackerTests */ = { + isa = PBXGroup; + children = ( + 03308F542BC2035500D59E96 /* Tech_TrackerTests.swift */, + ); + path = "Tech TrackerTests"; + sourceTree = ""; + }; + 03308F5D2BC2035500D59E96 /* Tech TrackerUITests */ = { + isa = PBXGroup; + children = ( + 03308F5E2BC2035500D59E96 /* Tech_TrackerUITests.swift */, + 03308F602BC2035500D59E96 /* Tech_TrackerUITestsLaunchTests.swift */, + ); + path = "Tech TrackerUITests"; + sourceTree = ""; + }; + 03308F6D2BC214AB00D59E96 /* Images */ = { + isa = PBXGroup; + children = ( + ); + path = Images; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 03308F3F2BC2035300D59E96 /* Tech Tracker */ = { + isa = PBXNativeTarget; + buildConfigurationList = 03308F642BC2035500D59E96 /* Build configuration list for PBXNativeTarget "Tech Tracker" */; + buildPhases = ( + 03308F3C2BC2035300D59E96 /* Sources */, + 03308F3D2BC2035300D59E96 /* Frameworks */, + 03308F3E2BC2035300D59E96 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Tech Tracker"; + productName = "Tech Tracker"; + productReference = 03308F402BC2035300D59E96 /* Tech Tracker.app */; + productType = "com.apple.product-type.application"; + }; + 03308F4F2BC2035500D59E96 /* Tech TrackerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 03308F672BC2035500D59E96 /* Build configuration list for PBXNativeTarget "Tech TrackerTests" */; + buildPhases = ( + 03308F4C2BC2035500D59E96 /* Sources */, + 03308F4D2BC2035500D59E96 /* Frameworks */, + 03308F4E2BC2035500D59E96 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 03308F522BC2035500D59E96 /* PBXTargetDependency */, + ); + name = "Tech TrackerTests"; + productName = "Tech TrackerTests"; + productReference = 03308F502BC2035500D59E96 /* Tech TrackerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 03308F592BC2035500D59E96 /* Tech TrackerUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 03308F6A2BC2035500D59E96 /* Build configuration list for PBXNativeTarget "Tech TrackerUITests" */; + buildPhases = ( + 03308F562BC2035500D59E96 /* Sources */, + 03308F572BC2035500D59E96 /* Frameworks */, + 03308F582BC2035500D59E96 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 03308F5C2BC2035500D59E96 /* PBXTargetDependency */, + ); + name = "Tech TrackerUITests"; + productName = "Tech TrackerUITests"; + productReference = 03308F5A2BC2035500D59E96 /* Tech TrackerUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 03308F382BC2035300D59E96 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1530; + LastUpgradeCheck = 1530; + TargetAttributes = { + 03308F3F2BC2035300D59E96 = { + CreatedOnToolsVersion = 15.3; + }; + 03308F4F2BC2035500D59E96 = { + CreatedOnToolsVersion = 15.3; + TestTargetID = 03308F3F2BC2035300D59E96; + }; + 03308F592BC2035500D59E96 = { + CreatedOnToolsVersion = 15.3; + TestTargetID = 03308F3F2BC2035300D59E96; + }; + }; + }; + buildConfigurationList = 03308F3B2BC2035300D59E96 /* Build configuration list for PBXProject "Tech Tracker" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 03308F372BC2035300D59E96; + productRefGroup = 03308F412BC2035300D59E96 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 03308F3F2BC2035300D59E96 /* Tech Tracker */, + 03308F4F2BC2035500D59E96 /* Tech TrackerTests */, + 03308F592BC2035500D59E96 /* Tech TrackerUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 03308F3E2BC2035300D59E96 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 03308F4B2BC2035500D59E96 /* Preview Assets.xcassets in Resources */, + 03308F482BC2035500D59E96 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 03308F4E2BC2035500D59E96 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 03308F582BC2035500D59E96 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 03308F3C2BC2035300D59E96 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 03308F462BC2035300D59E96 /* ContentView.swift in Sources */, + 03308F442BC2035300D59E96 /* Tech_TrackerApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 03308F4C2BC2035500D59E96 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 03308F552BC2035500D59E96 /* Tech_TrackerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 03308F562BC2035500D59E96 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 03308F5F2BC2035500D59E96 /* Tech_TrackerUITests.swift in Sources */, + 03308F612BC2035500D59E96 /* Tech_TrackerUITestsLaunchTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 03308F522BC2035500D59E96 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 03308F3F2BC2035300D59E96 /* Tech Tracker */; + targetProxy = 03308F512BC2035500D59E96 /* PBXContainerItemProxy */; + }; + 03308F5C2BC2035500D59E96 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 03308F3F2BC2035300D59E96 /* Tech Tracker */; + targetProxy = 03308F5B2BC2035500D59E96 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 03308F622BC2035500D59E96 /* 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; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 03308F632BC2035500D59E96 /* 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; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 03308F652BC2035500D59E96 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Tech Tracker/Preview Content\""; + DEVELOPMENT_TEAM = GQJNM5YK2M; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Tech-Tracker-Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Tech Tracker"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 0.2.3; + PRODUCT_BUNDLE_IDENTIFIER = "GibbyB.Tech-Tracker"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 03308F662BC2035500D59E96 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Tech Tracker/Preview Content\""; + DEVELOPMENT_TEAM = GQJNM5YK2M; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Tech-Tracker-Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Tech Tracker"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 0.2.3; + PRODUCT_BUNDLE_IDENTIFIER = "GibbyB.Tech-Tracker"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 03308F682BC2035500D59E96 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "GibbyB.Tech-TrackerTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Tech Tracker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Tech Tracker"; + }; + name = Debug; + }; + 03308F692BC2035500D59E96 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "GibbyB.Tech-TrackerTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Tech Tracker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Tech Tracker"; + }; + name = Release; + }; + 03308F6B2BC2035500D59E96 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "GibbyB.Tech-TrackerUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "Tech Tracker"; + }; + name = Debug; + }; + 03308F6C2BC2035500D59E96 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "GibbyB.Tech-TrackerUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "Tech Tracker"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 03308F3B2BC2035300D59E96 /* Build configuration list for PBXProject "Tech Tracker" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 03308F622BC2035500D59E96 /* Debug */, + 03308F632BC2035500D59E96 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 03308F642BC2035500D59E96 /* Build configuration list for PBXNativeTarget "Tech Tracker" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 03308F652BC2035500D59E96 /* Debug */, + 03308F662BC2035500D59E96 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 03308F672BC2035500D59E96 /* Build configuration list for PBXNativeTarget "Tech TrackerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 03308F682BC2035500D59E96 /* Debug */, + 03308F692BC2035500D59E96 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 03308F6A2BC2035500D59E96 /* Build configuration list for PBXNativeTarget "Tech TrackerUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 03308F6B2BC2035500D59E96 /* Debug */, + 03308F6C2BC2035500D59E96 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 03308F382BC2035300D59E96 /* Project object */; +} diff --git a/Tech Tracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Tech Tracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Tech Tracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Tech Tracker.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Tech Tracker.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Tech Tracker.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Tech Tracker.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Tech Tracker.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/Tech Tracker.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,5 @@ + + + + + diff --git a/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/UserInterfaceState.xcuserstate b/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..6ef5f58 Binary files /dev/null and b/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/WorkspaceSettings.xcsettings b/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..bbfef02 --- /dev/null +++ b/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,14 @@ + + + + + BuildLocationStyle + UseAppPreferences + CustomBuildLocationType + RelativeToDerivedData + DerivedDataLocationStyle + Default + ShowSharedSchemesAutomaticallyEnabled + + + diff --git a/Tech Tracker.xcodeproj/xcuserdata/gib.xcuserdatad/xcschemes/xcschememanagement.plist b/Tech Tracker.xcodeproj/xcuserdata/gib.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ffa15c7 --- /dev/null +++ b/Tech Tracker.xcodeproj/xcuserdata/gib.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Tech Tracker.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Tech Tracker/Assets.xcassets/AccentColor.colorset/Contents.json b/Tech Tracker/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..30f1059 --- /dev/null +++ b/Tech Tracker/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xAE", + "green" : "0x5E", + "red" : "0x4D" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tech Tracker/Assets.xcassets/AppIcon.appiconset/Contents.json b/Tech Tracker/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..f434400 --- /dev/null +++ b/Tech Tracker/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "logo.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tech Tracker/Assets.xcassets/AppIcon.appiconset/logo.png b/Tech Tracker/Assets.xcassets/AppIcon.appiconset/logo.png new file mode 100644 index 0000000..e198d87 Binary files /dev/null and b/Tech Tracker/Assets.xcassets/AppIcon.appiconset/logo.png differ diff --git a/Tech Tracker/Assets.xcassets/BackgroundColor.colorset/Contents.json b/Tech Tracker/Assets.xcassets/BackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..802fa68 --- /dev/null +++ b/Tech Tracker/Assets.xcassets/BackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFE" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0x00" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tech Tracker/Assets.xcassets/Contents.json b/Tech Tracker/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Tech Tracker/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tech Tracker/Assets.xcassets/TextColor.colorset/Contents.json b/Tech Tracker/Assets.xcassets/TextColor.colorset/Contents.json new file mode 100644 index 0000000..2bbe91e --- /dev/null +++ b/Tech Tracker/Assets.xcassets/TextColor.colorset/Contents.json @@ -0,0 +1,28 @@ +{ + "colors" : [ + { + "color" : { + "platform" : "ios", + "reference" : "darkTextColor" + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "platform" : "ios", + "reference" : "lightTextColor" + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tech Tracker/Assets.xcassets/logo.imageset/Contents.json b/Tech Tracker/Assets.xcassets/logo.imageset/Contents.json new file mode 100644 index 0000000..aae68a5 --- /dev/null +++ b/Tech Tracker/Assets.xcassets/logo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "logo.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tech Tracker/Assets.xcassets/logo.imageset/logo.png b/Tech Tracker/Assets.xcassets/logo.imageset/logo.png new file mode 100644 index 0000000..8973d13 Binary files /dev/null and b/Tech Tracker/Assets.xcassets/logo.imageset/logo.png differ diff --git a/Tech Tracker/Config.xcconfig b/Tech Tracker/Config.xcconfig new file mode 100644 index 0000000..b441615 --- /dev/null +++ b/Tech Tracker/Config.xcconfig @@ -0,0 +1,11 @@ +// +// Config.xcconfig +// Tech Tracker +// +// Created by Gabriel Brown on 4/8/24. +// + +// Configuration settings file format documentation can be found at: +// https://help.apple.com/xcode/#/dev745c5c974 +API_KEY = zAf4vYVN2pszrK +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) API_KEY=@\"$(API_KEY)\" diff --git a/Tech Tracker/ContentView.swift b/Tech Tracker/ContentView.swift new file mode 100644 index 0000000..ddcbdc1 --- /dev/null +++ b/Tech Tracker/ContentView.swift @@ -0,0 +1,486 @@ +// +// ContentView.swift +// Tech Tracker +// +// Created by Gabriel Brown on 4/6/24. +// +import SwiftUI +import Foundation +import Combine + +// Struct for Technician API +struct Technician: Identifiable, Codable { + let name: String + let status: String + let time: Date + + var id: String { name } // Computed property for Identifiable conformance + + enum CodingKeys: String, CodingKey { + case name, status, time + } +} + +// Struct for Update API +struct TechnicianUpdate: Codable { + let name: String + let status: String +} + +// Struct for History API +struct HistoryResponse: Decodable { + let data: [TechnicianHistory] + let meta: MetaData +} + +// Struct for the technician portion of the history API +struct TechnicianHistory: Identifiable, Codable { + let name: String + let status: String + let time: Date + var id: UUID { UUID() } + + enum CodingKeys: String, CodingKey { + case name, status, time + } +} + +// Struct for Metadata from History API +struct MetaData: Decodable { + let current_page: Int + let per_page: Int + let total_pages: Int + let total_count: Int +} + +// The Sheet View for updating technician status +struct StatusUpdateView: View { + @Binding var isPresented: Bool + var technicianName: (String) + var technicianStatus: (String) + var updateAction: (String) -> Void + + @State private var newStatus: String = "" + + var body: some View { + VStack(spacing: 15) { + + VStack(alignment: .leading, spacing: 5) { + Text(technicianName).bold() + .font(.largeTitle) + Text(technicianStatus).lineLimit(2).font(.title) + } + + TextField("New Status", text: $newStatus) + .padding() // Adds padding inside the TextField, making it taller + .textFieldStyle(RoundedBorderTextFieldStyle()) + .font(.title3) // Increases the font size of the text field content + .foregroundColor(.white) + .padding(.horizontal, 20) + + Button(action: { + updateAction(newStatus) + isPresented = false + }) { + Text("Update") + .font(.headline) // Make the button text larger + .padding() // Add padding around the button text to make the button larger + .frame(minWidth: 0, maxWidth: .infinity) // Makes the button expand to full width + .background(Color.accent) // Sets the button background color to blue + .foregroundColor(.white) // Sets the button text color to white + .cornerRadius(10) // Rounds the corners of the button + } + .padding(.top, 10) // Adds some space above the button + .padding(.horizontal, 30) + Spacer().frame(width: 0, height: 5) + HStack(spacing: 5) { + Button(action: { + updateAction("In the Office") + isPresented = false + }) { + Text("In the Office") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + Spacer().frame(width: 10) + Button(action: { + updateAction("At desk") + isPresented = false + }) { + Text("At desk") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + }.padding(.horizontal, 25) + HStack(spacing: 5) { + Button(action: { + updateAction("At lunch") + isPresented = false + }) { + Text("At lunch") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + Spacer().frame(width: 10) + Button(action: { + updateAction("At Hardy") + isPresented = false + }) { + Text("At Hardy") + .font(.headline) + .padding() + .frame(maxWidth: /*@START_MENU_TOKEN@*/.infinity/*@END_MENU_TOKEN@*/) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + }.padding(.horizontal, 25) + HStack(spacing: 5) { + Button(action: { + updateAction("At Police Department") + isPresented = false + }) { + Text("At Police Dpt") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + Spacer().frame(width: 10) + Button(action: { + updateAction("At City Hall") + isPresented = false + }) { + Text("At City Hall") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + }.padding(.horizontal, 25) + HStack(spacing: 5) { + Button(action: { + updateAction("In a meeting") + isPresented = false + }) { + Text("In a meeting") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + Spacer().frame(width: 10) + Button(action: { + updateAction("Out today") + isPresented = false + }) { + Text("Out today") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + }.padding(.horizontal, 25) + HStack(spacing: 5) { + Button(action: { + updateAction("Running late") + isPresented = false + }) { + Text("Running late") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + Spacer().frame(width: 10) + Button(action: { + updateAction("End of Shift") + isPresented = false + }) { + Text("End of Shift") + .font(.headline) + .padding() + .frame(maxWidth: .infinity) + .background(Color.accent) + .foregroundColor(.white) + .cornerRadius(10) + } + }.padding(.horizontal, 25) + } + .padding() + .padding(.top, 150) + } +} + +// Single class for interpretting all API's. Has fetch functions for all 3. +class TechnicianViewModel: ObservableObject { + + // Variables for containing our data from our APIs + @Published var technicians: [Technician] = [] + @Published var technicianHistories: [TechnicianHistory] = [] + @Published var currentPage = 1 + var totalPageCount = 1 + + // Fetch technicians function for Technicians API + func fetchTechnicians() { + let urlString = "https://techtracker.gibbyb.com/api/technicians?apikey=APIKEYHERE" + guard let url = URL(string: urlString) else { return } + + URLSession.shared.dataTask(with: url) { [weak self] data, response, error in + guard let data = data else { + DispatchQueue.main.async { + print("Networking error: \(error?.localizedDescription ?? "Unknown error")") + } + return + } + + let decoder = JSONDecoder() + // Had to make my own formatter because I couldn't get the JSON decoding to work right + // This may have to do with the added ms + let formatter = DateFormatter() + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + decoder.dateDecodingStrategy = .formatted(formatter) + + // Decode the JSON response. + do { + let decodedResponse = try decoder.decode([Technician].self, from: data) + DispatchQueue.main.async { + self?.technicians = decodedResponse + } + } catch { + DispatchQueue.main.async { + print("Decoding error: \(error)") + } + } + }.resume() + } + + // Update Technician Status function for the Update API + func updateTechnicianStatus(name: String, newStatus: String) { + let urlString = "https://techtracker.gibbyb.com/api/update_technicians?apikey=APIKEYHERE" + guard let url = URL(string: urlString) else { return } + + let updateData = [TechnicianUpdate(name: name, status: newStatus)] + // Wrap the array in a dictionary with a key that matches the backend expectation of an array. + // Even though this app only lets you update one technician at a time, the API was written for a + // web app that lets you update multiple technicians, so it expects an array. + let wrappedData = ["technicians": updateData] + guard let jsonData = try? JSONEncoder().encode(wrappedData) else { + print("Failed to encode update data") + return + } + + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.httpBody = jsonData + + URLSession.shared.dataTask(with: request) { data, response, error in + if let error = error { + DispatchQueue.main.async { + print("Error updating technician: \(error.localizedDescription)") + } + return + } + guard let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 200 else { + DispatchQueue.main.async { + print("Error with the response, unexpected status code: \(String(describing: response))") + } + return + } + + // The database automatically adds this update to the history so we do not need to think about that in this app. + DispatchQueue.main.async { + print("Technician updated successfully.") + // Refresh technician data + self.fetchTechnicians() + } + }.resume() + } + + // Fetch Technician History Function for the History API. Very similar to Technician API + // but with some added metadata + func fetchTechnicianHistory(page: Int = 1) { + let urlString = "https://techtracker.gibbyb.com/api/history?apikey=APIKEYHERE&page=\(page)" + guard let url = URL(string: urlString) else { return } + + URLSession.shared.dataTask(with: url) { [weak self] data, response, error in + guard let data = data else { + DispatchQueue.main.async { + print("Networking error: \(error?.localizedDescription ?? "Unknown error")") + } + return + } + + let decoder = JSONDecoder() + let formatter = DateFormatter() + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + decoder.dateDecodingStrategy = .formatted(formatter) + + do { + let jsonResponse = try decoder.decode(HistoryResponse.self, from: data) + DispatchQueue.main.async { + self?.technicianHistories = jsonResponse.data + self?.totalPageCount = jsonResponse.meta.total_pages + self?.currentPage = jsonResponse.meta.current_page + } + } catch { + DispatchQueue.main.async { + print("Decoding error: \(error)") + } + } + }.resume() + } + + func nextPage() { + guard currentPage < totalPageCount else {return} + currentPage += 1 + fetchTechnicianHistory(page: currentPage) + } + + func previousPage() { + guard currentPage > 1 else {return} + currentPage -= 1 + fetchTechnicianHistory(page: currentPage) + } + +} + + +struct ContentView: View { + @StateObject var viewModel = TechnicianViewModel() + @State private var showingUpdateView = false + @State private var selectedTechnicianName = "" + @State private var selectedTechnicianCurrStatus = "" + + var body: some View { + HStack { + Image("logo") + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 50, height:50) + .imageScale(.large) + .foregroundStyle(.tint) + Text("Tech Tracker") + .bold() + .font(.system(size: 36)) + } + TabView { + List { + ForEach(viewModel.technicians) { technician in + Button(action: { + self.showingUpdateView = true + self.selectedTechnicianName = technician.name + self.selectedTechnicianCurrStatus = technician.status + }) { + HStack { + VStack(alignment: .leading, spacing: 5) { + Text(technician.name).bold() + .font(.system(size: 23)) + Text(technician.status).lineLimit(2) + } + Spacer() + VStack(alignment: .trailing, spacing: 5) { + VStack { + Text(technician.time, format: .dateTime.hour().minute()).font(.system(size: 20)) + Text(technician.time, format: .dateTime.day().month()).font(.system(size: 18)) + } + } + } + .foregroundColor(.primary) + } + } + } + .tabItem { + Image(systemName: "pencil") + Text("Update") + } + .onAppear { + viewModel.fetchTechnicians() + } + .refreshable { + viewModel.fetchTechnicians() + } + .sheet(isPresented: $showingUpdateView) { + // Pass the selected technician name directly to an explicitly initialized StatusUpdateView + StatusUpdateView(isPresented: $showingUpdateView, + technicianName: selectedTechnicianName, + technicianStatus: selectedTechnicianCurrStatus, + updateAction: { newStatus in + viewModel.updateTechnicianStatus(name: selectedTechnicianName, newStatus: newStatus) + }) + } + + VStack { + List(viewModel.technicianHistories) { history in + HStack { + VStack(alignment: .leading, spacing: 5) { + Text(history.name).bold().font(.system(size: 22)) + Text(history.status).lineLimit(2) + } + Spacer() + VStack(alignment: .trailing, spacing: 5) { + Text(history.time, format: .dateTime.hour().minute()).font(.system(size: 20)) + Text(history.time, format: .dateTime.day().month()).font(.system(size: 18)) + } + } + } + HStack { + Button("Prev") { + viewModel.previousPage() + } + .disabled(viewModel.currentPage <= 1) + .font(.title2) + Spacer() + Text("Page \(viewModel.currentPage) of \(viewModel.totalPageCount)").font(.title3) + Spacer() + Button("Next") { + viewModel.nextPage() + } + .disabled(viewModel.currentPage >= viewModel.totalPageCount) + .font(.title2) + }.padding() + } + .tabItem { + Image(systemName: "book") + Text("History") + } + .onAppear { + viewModel.fetchTechnicianHistory() + } + .refreshable { + viewModel.fetchTechnicianHistory() + } + } + } +} + +#Preview { + ContentView() +} diff --git a/Tech Tracker/Images/logo.heic b/Tech Tracker/Images/logo.heic new file mode 100644 index 0000000..c67879e Binary files /dev/null and b/Tech Tracker/Images/logo.heic differ diff --git a/Tech Tracker/Images/logo.png b/Tech Tracker/Images/logo.png new file mode 100644 index 0000000..e198d87 Binary files /dev/null and b/Tech Tracker/Images/logo.png differ diff --git a/Tech Tracker/Preview Content/Preview Assets.xcassets/Contents.json b/Tech Tracker/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Tech Tracker/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Tech Tracker/Tech_TrackerApp.swift b/Tech Tracker/Tech_TrackerApp.swift new file mode 100644 index 0000000..7848a4f --- /dev/null +++ b/Tech Tracker/Tech_TrackerApp.swift @@ -0,0 +1,18 @@ +// +// Tech_TrackerApp.swift +// Tech Tracker +// +// Created by Gabriel Brown on 4/6/24. +// + +import SwiftUI + +@main +struct Tech_TrackerApp: App { + var body: some Scene { + WindowGroup { + ContentView() + .preferredColorScheme(.dark) + } + } +} diff --git a/Tech TrackerTests/Tech_TrackerTests.swift b/Tech TrackerTests/Tech_TrackerTests.swift new file mode 100644 index 0000000..9f96174 --- /dev/null +++ b/Tech TrackerTests/Tech_TrackerTests.swift @@ -0,0 +1,36 @@ +// +// Tech_TrackerTests.swift +// Tech TrackerTests +// +// Created by Gabriel Brown on 4/6/24. +// + +import XCTest +@testable import Tech_Tracker + +final class Tech_TrackerTests: 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. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Tech TrackerUITests/Tech_TrackerUITests.swift b/Tech TrackerUITests/Tech_TrackerUITests.swift new file mode 100644 index 0000000..04ec52a --- /dev/null +++ b/Tech TrackerUITests/Tech_TrackerUITests.swift @@ -0,0 +1,41 @@ +// +// Tech_TrackerUITests.swift +// Tech TrackerUITests +// +// Created by Gabriel Brown on 4/6/24. +// + +import XCTest + +final class Tech_TrackerUITests: 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. + } + + 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. + } + + 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/Tech TrackerUITests/Tech_TrackerUITestsLaunchTests.swift b/Tech TrackerUITests/Tech_TrackerUITestsLaunchTests.swift new file mode 100644 index 0000000..3218512 --- /dev/null +++ b/Tech TrackerUITests/Tech_TrackerUITestsLaunchTests.swift @@ -0,0 +1,32 @@ +// +// Tech_TrackerUITestsLaunchTests.swift +// Tech TrackerUITests +// +// Created by Gabriel Brown on 4/6/24. +// + +import XCTest + +final class Tech_TrackerUITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + 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) + } +} diff --git a/Tech-Tracker-Info.plist b/Tech-Tracker-Info.plist new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/Tech-Tracker-Info.plist @@ -0,0 +1,5 @@ + + + + +