diff --git a/CountApp/CountApp.xcodeproj/project.pbxproj b/CountApp/CountApp.xcodeproj/project.pbxproj new file mode 100644 index 0000000..84b0ed7 --- /dev/null +++ b/CountApp/CountApp.xcodeproj/project.pbxproj @@ -0,0 +1,704 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + B38B77752B53A9AD0046EAC3 /* View+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B38B77742B53A9AD0046EAC3 /* View+Extension.swift */; }; + B38B77772B53C1800046EAC3 /* Numeric+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B38B77762B53C1800046EAC3 /* Numeric+Extension.swift */; }; + B38B77792B53C7040046EAC3 /* StatisticsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B38B77782B53C7040046EAC3 /* StatisticsView.swift */; }; + B38B777C2B53C9D20046EAC3 /* StatisticsCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B38B777B2B53C9D20046EAC3 /* StatisticsCellView.swift */; }; + B3FFE9EB2B52D67A00862E55 /* CountAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FFE9EA2B52D67A00862E55 /* CountAppApp.swift */; }; + B3FFE9EF2B52D67C00862E55 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B3FFE9EE2B52D67C00862E55 /* Assets.xcassets */; }; + B3FFE9F22B52D67C00862E55 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B3FFE9F12B52D67C00862E55 /* Preview Assets.xcassets */; }; + B3FFE9FC2B52D67C00862E55 /* CountAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FFE9FB2B52D67C00862E55 /* CountAppTests.swift */; }; + B3FFEA062B52D67C00862E55 /* CountAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FFEA052B52D67C00862E55 /* CountAppUITests.swift */; }; + B3FFEA082B52D67C00862E55 /* CountAppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FFEA072B52D67C00862E55 /* CountAppUITestsLaunchTests.swift */; }; + B3FFEA162B52D6B900862E55 /* ComposableArchitecture in Frameworks */ = {isa = PBXBuildFile; productRef = B3FFEA152B52D6B900862E55 /* ComposableArchitecture */; }; + B3FFEA1A2B52D87B00862E55 /* VitaminsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FFEA192B52D87B00862E55 /* VitaminsView.swift */; }; + B3FFEA1C2B52DC2D00862E55 /* Vitamin.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FFEA1B2B52DC2D00862E55 /* Vitamin.swift */; }; + B3FFEA1E2B52DE2900862E55 /* Vitamins.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FFEA1D2B52DE2900862E55 /* Vitamins.swift */; }; + B3FFEA212B52E30A00862E55 /* VitaminCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FFEA202B52E30A00862E55 /* VitaminCellView.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + B3FFE9F82B52D67C00862E55 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B3FFE9DF2B52D67A00862E55 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B3FFE9E62B52D67A00862E55; + remoteInfo = CountApp; + }; + B3FFEA022B52D67C00862E55 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B3FFE9DF2B52D67A00862E55 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B3FFE9E62B52D67A00862E55; + remoteInfo = CountApp; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + B38B77742B53A9AD0046EAC3 /* View+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Extension.swift"; sourceTree = ""; }; + B38B77762B53C1800046EAC3 /* Numeric+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Numeric+Extension.swift"; sourceTree = ""; }; + B38B77782B53C7040046EAC3 /* StatisticsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticsView.swift; sourceTree = ""; }; + B38B777B2B53C9D20046EAC3 /* StatisticsCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticsCellView.swift; sourceTree = ""; }; + B3FFE9E72B52D67A00862E55 /* CountApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CountApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B3FFE9EA2B52D67A00862E55 /* CountAppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountAppApp.swift; sourceTree = ""; }; + B3FFE9EE2B52D67C00862E55 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B3FFE9F12B52D67C00862E55 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B3FFE9F72B52D67C00862E55 /* CountAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CountAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + B3FFE9FB2B52D67C00862E55 /* CountAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountAppTests.swift; sourceTree = ""; }; + B3FFEA012B52D67C00862E55 /* CountAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CountAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + B3FFEA052B52D67C00862E55 /* CountAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountAppUITests.swift; sourceTree = ""; }; + B3FFEA072B52D67C00862E55 /* CountAppUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountAppUITestsLaunchTests.swift; sourceTree = ""; }; + B3FFEA192B52D87B00862E55 /* VitaminsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VitaminsView.swift; sourceTree = ""; }; + B3FFEA1B2B52DC2D00862E55 /* Vitamin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vitamin.swift; sourceTree = ""; }; + B3FFEA1D2B52DE2900862E55 /* Vitamins.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vitamins.swift; sourceTree = ""; }; + B3FFEA202B52E30A00862E55 /* VitaminCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VitaminCellView.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B3FFE9E42B52D67A00862E55 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B3FFEA162B52D6B900862E55 /* ComposableArchitecture in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B3FFE9F42B52D67C00862E55 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B3FFE9FE2B52D67C00862E55 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + B38B77732B53A9A30046EAC3 /* Extension */ = { + isa = PBXGroup; + children = ( + B38B77742B53A9AD0046EAC3 /* View+Extension.swift */, + B38B77762B53C1800046EAC3 /* Numeric+Extension.swift */, + ); + path = Extension; + sourceTree = ""; + }; + B38B777A2B53C9A50046EAC3 /* Subviews */ = { + isa = PBXGroup; + children = ( + B38B777B2B53C9D20046EAC3 /* StatisticsCellView.swift */, + ); + path = Subviews; + sourceTree = ""; + }; + B38B777D2B5411280046EAC3 /* Vitamins */ = { + isa = PBXGroup; + children = ( + B3FFEA1F2B52E2F500862E55 /* Subviews */, + B3FFEA192B52D87B00862E55 /* VitaminsView.swift */, + ); + path = Vitamins; + sourceTree = ""; + }; + B3FFE9DE2B52D67A00862E55 = { + isa = PBXGroup; + children = ( + B3FFE9E92B52D67A00862E55 /* CountApp */, + B3FFE9FA2B52D67C00862E55 /* CountAppTests */, + B3FFEA042B52D67C00862E55 /* CountAppUITests */, + B3FFE9E82B52D67A00862E55 /* Products */, + ); + sourceTree = ""; + }; + B3FFE9E82B52D67A00862E55 /* Products */ = { + isa = PBXGroup; + children = ( + B3FFE9E72B52D67A00862E55 /* CountApp.app */, + B3FFE9F72B52D67C00862E55 /* CountAppTests.xctest */, + B3FFEA012B52D67C00862E55 /* CountAppUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + B3FFE9E92B52D67A00862E55 /* CountApp */ = { + isa = PBXGroup; + children = ( + B3FFEA172B52D70900862E55 /* Vitamin */, + B38B77732B53A9A30046EAC3 /* Extension */, + B3FFE9EA2B52D67A00862E55 /* CountAppApp.swift */, + B3FFE9EE2B52D67C00862E55 /* Assets.xcassets */, + B3FFE9F02B52D67C00862E55 /* Preview Content */, + ); + path = CountApp; + sourceTree = ""; + }; + B3FFE9F02B52D67C00862E55 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B3FFE9F12B52D67C00862E55 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + B3FFE9FA2B52D67C00862E55 /* CountAppTests */ = { + isa = PBXGroup; + children = ( + B3FFE9FB2B52D67C00862E55 /* CountAppTests.swift */, + ); + path = CountAppTests; + sourceTree = ""; + }; + B3FFEA042B52D67C00862E55 /* CountAppUITests */ = { + isa = PBXGroup; + children = ( + B3FFEA052B52D67C00862E55 /* CountAppUITests.swift */, + B3FFEA072B52D67C00862E55 /* CountAppUITestsLaunchTests.swift */, + ); + path = CountAppUITests; + sourceTree = ""; + }; + B3FFEA172B52D70900862E55 /* Vitamin */ = { + isa = PBXGroup; + children = ( + B3FFEA222B52E32D00862E55 /* Reducer */, + B38B777D2B5411280046EAC3 /* Vitamins */, + B3FFEA182B52D86900862E55 /* Statistics */, + ); + path = Vitamin; + sourceTree = ""; + }; + B3FFEA182B52D86900862E55 /* Statistics */ = { + isa = PBXGroup; + children = ( + B38B777A2B53C9A50046EAC3 /* Subviews */, + B38B77782B53C7040046EAC3 /* StatisticsView.swift */, + ); + path = Statistics; + sourceTree = ""; + }; + B3FFEA1F2B52E2F500862E55 /* Subviews */ = { + isa = PBXGroup; + children = ( + B3FFEA202B52E30A00862E55 /* VitaminCellView.swift */, + ); + path = Subviews; + sourceTree = ""; + }; + B3FFEA222B52E32D00862E55 /* Reducer */ = { + isa = PBXGroup; + children = ( + B3FFEA1B2B52DC2D00862E55 /* Vitamin.swift */, + B3FFEA1D2B52DE2900862E55 /* Vitamins.swift */, + ); + path = Reducer; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B3FFE9E62B52D67A00862E55 /* CountApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = B3FFEA0B2B52D67C00862E55 /* Build configuration list for PBXNativeTarget "CountApp" */; + buildPhases = ( + B3FFE9E32B52D67A00862E55 /* Sources */, + B3FFE9E42B52D67A00862E55 /* Frameworks */, + B3FFE9E52B52D67A00862E55 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CountApp; + packageProductDependencies = ( + B3FFEA152B52D6B900862E55 /* ComposableArchitecture */, + ); + productName = CountApp; + productReference = B3FFE9E72B52D67A00862E55 /* CountApp.app */; + productType = "com.apple.product-type.application"; + }; + B3FFE9F62B52D67C00862E55 /* CountAppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = B3FFEA0E2B52D67C00862E55 /* Build configuration list for PBXNativeTarget "CountAppTests" */; + buildPhases = ( + B3FFE9F32B52D67C00862E55 /* Sources */, + B3FFE9F42B52D67C00862E55 /* Frameworks */, + B3FFE9F52B52D67C00862E55 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + B3FFE9F92B52D67C00862E55 /* PBXTargetDependency */, + ); + name = CountAppTests; + productName = CountAppTests; + productReference = B3FFE9F72B52D67C00862E55 /* CountAppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + B3FFEA002B52D67C00862E55 /* CountAppUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = B3FFEA112B52D67C00862E55 /* Build configuration list for PBXNativeTarget "CountAppUITests" */; + buildPhases = ( + B3FFE9FD2B52D67C00862E55 /* Sources */, + B3FFE9FE2B52D67C00862E55 /* Frameworks */, + B3FFE9FF2B52D67C00862E55 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + B3FFEA032B52D67C00862E55 /* PBXTargetDependency */, + ); + name = CountAppUITests; + productName = CountAppUITests; + productReference = B3FFEA012B52D67C00862E55 /* CountAppUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B3FFE9DF2B52D67A00862E55 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; + TargetAttributes = { + B3FFE9E62B52D67A00862E55 = { + CreatedOnToolsVersion = 15.0; + }; + B3FFE9F62B52D67C00862E55 = { + CreatedOnToolsVersion = 15.0; + TestTargetID = B3FFE9E62B52D67A00862E55; + }; + B3FFEA002B52D67C00862E55 = { + CreatedOnToolsVersion = 15.0; + TestTargetID = B3FFE9E62B52D67A00862E55; + }; + }; + }; + buildConfigurationList = B3FFE9E22B52D67A00862E55 /* Build configuration list for PBXProject "CountApp" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B3FFE9DE2B52D67A00862E55; + packageReferences = ( + B3FFEA142B52D6B900862E55 /* XCRemoteSwiftPackageReference "swift-composable-architecture" */, + ); + productRefGroup = B3FFE9E82B52D67A00862E55 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B3FFE9E62B52D67A00862E55 /* CountApp */, + B3FFE9F62B52D67C00862E55 /* CountAppTests */, + B3FFEA002B52D67C00862E55 /* CountAppUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B3FFE9E52B52D67A00862E55 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B3FFE9F22B52D67C00862E55 /* Preview Assets.xcassets in Resources */, + B3FFE9EF2B52D67C00862E55 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B3FFE9F52B52D67C00862E55 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B3FFE9FF2B52D67C00862E55 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B3FFE9E32B52D67A00862E55 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B3FFEA1C2B52DC2D00862E55 /* Vitamin.swift in Sources */, + B38B777C2B53C9D20046EAC3 /* StatisticsCellView.swift in Sources */, + B3FFEA212B52E30A00862E55 /* VitaminCellView.swift in Sources */, + B38B77772B53C1800046EAC3 /* Numeric+Extension.swift in Sources */, + B3FFEA1E2B52DE2900862E55 /* Vitamins.swift in Sources */, + B3FFEA1A2B52D87B00862E55 /* VitaminsView.swift in Sources */, + B38B77792B53C7040046EAC3 /* StatisticsView.swift in Sources */, + B38B77752B53A9AD0046EAC3 /* View+Extension.swift in Sources */, + B3FFE9EB2B52D67A00862E55 /* CountAppApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B3FFE9F32B52D67C00862E55 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B3FFE9FC2B52D67C00862E55 /* CountAppTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B3FFE9FD2B52D67C00862E55 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B3FFEA082B52D67C00862E55 /* CountAppUITestsLaunchTests.swift in Sources */, + B3FFEA062B52D67C00862E55 /* CountAppUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + B3FFE9F92B52D67C00862E55 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B3FFE9E62B52D67A00862E55 /* CountApp */; + targetProxy = B3FFE9F82B52D67C00862E55 /* PBXContainerItemProxy */; + }; + B3FFEA032B52D67C00862E55 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B3FFE9E62B52D67A00862E55 /* CountApp */; + targetProxy = B3FFEA022B52D67C00862E55 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + B3FFEA092B52D67C00862E55 /* 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; + 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; + }; + B3FFEA0A2B52D67C00862E55 /* 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; + 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; + }; + B3FFEA0C2B52D67C00862E55 /* 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 = "\"CountApp/Preview Content\""; + DEVELOPMENT_TEAM = S9ZP7UQ3NY; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = leo.CountApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B3FFEA0D2B52D67C00862E55 /* 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 = "\"CountApp/Preview Content\""; + DEVELOPMENT_TEAM = S9ZP7UQ3NY; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = leo.CountApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + B3FFEA0F2B52D67C00862E55 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = S9ZP7UQ3NY; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = leo.CountAppTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CountApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/CountApp"; + }; + name = Debug; + }; + B3FFEA102B52D67C00862E55 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = S9ZP7UQ3NY; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = leo.CountAppTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CountApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/CountApp"; + }; + name = Release; + }; + B3FFEA122B52D67C00862E55 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = S9ZP7UQ3NY; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = leo.CountAppUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = CountApp; + }; + name = Debug; + }; + B3FFEA132B52D67C00862E55 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = S9ZP7UQ3NY; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = leo.CountAppUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = CountApp; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B3FFE9E22B52D67A00862E55 /* Build configuration list for PBXProject "CountApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B3FFEA092B52D67C00862E55 /* Debug */, + B3FFEA0A2B52D67C00862E55 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B3FFEA0B2B52D67C00862E55 /* Build configuration list for PBXNativeTarget "CountApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B3FFEA0C2B52D67C00862E55 /* Debug */, + B3FFEA0D2B52D67C00862E55 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B3FFEA0E2B52D67C00862E55 /* Build configuration list for PBXNativeTarget "CountAppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B3FFEA0F2B52D67C00862E55 /* Debug */, + B3FFEA102B52D67C00862E55 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B3FFEA112B52D67C00862E55 /* Build configuration list for PBXNativeTarget "CountAppUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B3FFEA122B52D67C00862E55 /* Debug */, + B3FFEA132B52D67C00862E55 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + B3FFEA142B52D6B900862E55 /* XCRemoteSwiftPackageReference "swift-composable-architecture" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/pointfreeco/swift-composable-architecture"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.6.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + B3FFEA152B52D6B900862E55 /* ComposableArchitecture */ = { + isa = XCSwiftPackageProductDependency; + package = B3FFEA142B52D6B900862E55 /* XCRemoteSwiftPackageReference "swift-composable-architecture" */; + productName = ComposableArchitecture; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = B3FFE9DF2B52D67A00862E55 /* Project object */; +} diff --git a/CountApp/CountApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CountApp/CountApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/CountApp/CountApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CountApp/CountApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CountApp/CountApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/CountApp/CountApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/CountApp/CountApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/CountApp/CountApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..1d14698 --- /dev/null +++ b/CountApp/CountApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,113 @@ +{ + "pins" : [ + { + "identity" : "combine-schedulers", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/combine-schedulers", + "state" : { + "revision" : "9dc9cbe4bc45c65164fa653a563d8d8db61b09bb", + "version" : "1.0.0" + } + }, + { + "identity" : "swift-case-paths", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-case-paths", + "state" : { + "revision" : "76d7791b5bda47df7e3d4690c4c3aaf089730707", + "version" : "1.2.1" + } + }, + { + "identity" : "swift-clocks", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-clocks", + "state" : { + "revision" : "a8421d68068d8f45fbceb418fbf22c5dad4afd33", + "version" : "1.0.2" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections", + "state" : { + "revision" : "d029d9d39c87bed85b1c50adee7c41795261a192", + "version" : "1.0.6" + } + }, + { + "identity" : "swift-composable-architecture", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-composable-architecture", + "state" : { + "revision" : "ae491c9e3f66631e72d58db8bb4c27dfc3d3afd4", + "version" : "1.6.0" + } + }, + { + "identity" : "swift-concurrency-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-concurrency-extras", + "state" : { + "revision" : "bb5059bde9022d69ac516803f4f227d8ac967f71", + "version" : "1.1.0" + } + }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "aedcf6f4cd486ccef5b312ccac85d4b3f6e58605", + "version" : "1.1.2" + } + }, + { + "identity" : "swift-dependencies", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-dependencies", + "state" : { + "revision" : "c31b1445c4fae49e6fdb75496b895a3653f6aefc", + "version" : "1.1.5" + } + }, + { + "identity" : "swift-identified-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-identified-collections", + "state" : { + "revision" : "d1e45f3e1eee2c9193f5369fa9d70a6ddad635e8", + "version" : "1.0.0" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-syntax", + "state" : { + "revision" : "43c802fb7f96e090dde015344a94b5e85779eff1", + "version" : "509.1.0" + } + }, + { + "identity" : "swiftui-navigation", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swiftui-navigation", + "state" : { + "revision" : "78f9d72cf667adb47e2040aa373185c88c63f0dc", + "version" : "1.2.0" + } + }, + { + "identity" : "xctest-dynamic-overlay", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state" : { + "revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631", + "version" : "1.0.2" + } + } + ], + "version" : 2 +} diff --git a/CountApp/CountApp.xcodeproj/project.xcworkspace/xcuserdata/leo.xcuserdatad/UserInterfaceState.xcuserstate b/CountApp/CountApp.xcodeproj/project.xcworkspace/xcuserdata/leo.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..6dafd68 Binary files /dev/null and b/CountApp/CountApp.xcodeproj/project.xcworkspace/xcuserdata/leo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CountApp/CountApp.xcodeproj/xcuserdata/leo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/CountApp/CountApp.xcodeproj/xcuserdata/leo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..b1d252c --- /dev/null +++ b/CountApp/CountApp.xcodeproj/xcuserdata/leo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/CountApp/CountApp.xcodeproj/xcuserdata/leo.xcuserdatad/xcschemes/xcschememanagement.plist b/CountApp/CountApp.xcodeproj/xcuserdata/leo.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..c3ee37b --- /dev/null +++ b/CountApp/CountApp.xcodeproj/xcuserdata/leo.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + CountApp.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/CountApp/CountApp/Assets.xcassets/AccentColor.colorset/Contents.json b/CountApp/CountApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/CountApp/CountApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CountApp/CountApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/CountApp/CountApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/CountApp/CountApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CountApp/CountApp/Assets.xcassets/Contents.json b/CountApp/CountApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CountApp/CountApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CountApp/CountApp/CountAppApp.swift b/CountApp/CountApp/CountAppApp.swift new file mode 100644 index 0000000..0c43325 --- /dev/null +++ b/CountApp/CountApp/CountAppApp.swift @@ -0,0 +1,40 @@ +// +// CountAppApp.swift +// CountApp +// +// Created by Leo on 1/13/24. +// + +import SwiftUI +import ComposableArchitecture + +@main +struct CountAppApp: App { + var body: some Scene { + WindowGroup { + ContentView(store: Store(initialState: Vitamins.State(vitamins: .mocks)) { + Vitamins()._printChanges() + }) + } + } +} + +struct ContentView: View { + let store: StoreOf + + var body: some View { + TabView { + VitaminsView(store: store) // store 하나로 다수 뷰 사용 + .tabItem { + Image(systemName: "pills.fill") + Text("비타민") + } + + StatisticsView(store: store) + .tabItem { + Image(systemName: "chart.bar.doc.horizontal") + Text("먹은 횟수") + } + } + } +} diff --git a/CountApp/CountApp/Extension/Numeric+Extension.swift b/CountApp/CountApp/Extension/Numeric+Extension.swift new file mode 100644 index 0000000..2c423b4 --- /dev/null +++ b/CountApp/CountApp/Extension/Numeric+Extension.swift @@ -0,0 +1,14 @@ +// +// Numeric+Extension.swift +// CountApp +// +// Created by Leo on 1/14/24. +// + +import Foundation + +extension Numeric { + var toString: String { + String("\(self)") + } +} diff --git a/CountApp/CountApp/Extension/View+Extension.swift b/CountApp/CountApp/Extension/View+Extension.swift new file mode 100644 index 0000000..a36c8ea --- /dev/null +++ b/CountApp/CountApp/Extension/View+Extension.swift @@ -0,0 +1,33 @@ +// +// View+Extension.swift +// CountApp +// +// Created by Leo on 1/14/24. +// + +import SwiftUI + +// MARK: ViewModifier +struct VitaminCell: ViewModifier { + let color: Color + let height: CGFloat + + func body(content: Content) -> some View { + content + .frame(maxWidth: .infinity, maxHeight: height) + .contentShape(.contextMenuPreview, // contextmenu radius + RoundedRectangle(cornerRadius: 15)) + .background(color) + .clipShape(RoundedRectangle(cornerRadius: 15)) + .overlay { + RoundedRectangle(cornerRadius: 15) + .stroke(Color.gray.opacity(0.5), lineWidth: 0.5) + } + } +} + +extension View { + func vitaminCellFrame(color: Color, height: CGFloat = 70) -> some View { + modifier(VitaminCell(color: color, height: height)) + } +} diff --git a/CountApp/CountApp/Preview Content/Preview Assets.xcassets/Contents.json b/CountApp/CountApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CountApp/CountApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CountApp/CountApp/Vitamin/Reducer/Vitamin.swift b/CountApp/CountApp/Vitamin/Reducer/Vitamin.swift new file mode 100644 index 0000000..4d66145 --- /dev/null +++ b/CountApp/CountApp/Vitamin/Reducer/Vitamin.swift @@ -0,0 +1,42 @@ +// +// Vitamin.swift +// CountApp +// +// Created by Leo on 1/13/24. +// + +import SwiftUI +import ComposableArchitecture + +@Reducer +struct Vitamin { + + struct State: Equatable, Identifiable { + let id: UUID + let name: String + let color: Color + @BindingState var count: Int = 0 + } + + enum Action: BindableAction, Sendable { + case binding(BindingAction) + case increaseCount(Int) + case decreaseToZero + } + + var body: some Reducer { + BindingReducer() + Reduce { state, action in + switch action { + case .binding: + return .none + case .increaseCount(let count): + state.count += count + return .none + case .decreaseToZero: + state.count = 0 + return .none + } + } + } +} diff --git a/CountApp/CountApp/Vitamin/Reducer/Vitamins.swift b/CountApp/CountApp/Vitamin/Reducer/Vitamins.swift new file mode 100644 index 0000000..4238a4e --- /dev/null +++ b/CountApp/CountApp/Vitamin/Reducer/Vitamins.swift @@ -0,0 +1,68 @@ +// +// Vitamins.swift +// CountApp +// +// Created by Leo on 1/14/24. +// + +import SwiftUI +import ComposableArchitecture + +@Reducer +struct Vitamins { + + struct State: Equatable { + var vitamins: IdentifiedArrayOf = [] + } + + enum Action { + case vitamins(IdentifiedActionOf) + case resetAllVitamins + case resetVitamins(name: String) + } + + var body: some Reducer { + Reduce { state, action in + switch action { + case .vitamins: + return .none + case .resetAllVitamins: + state.vitamins.forEach { + var vitamin = $0 + vitamin.count = 0 + state.vitamins.updateOrAppend(vitamin) + } + return .none + case .resetVitamins(let name): + if var selectedVitamin = state.vitamins.first(where: { $0.name == name }) { + selectedVitamin.count = 0 + state.vitamins.updateOrAppend(selectedVitamin) + } + return .none + } + } + .forEach(\.vitamins, action: \.vitamins) { + Vitamin() + } + } +} + +extension IdentifiedArray where ID == Vitamin.State.ID, Element == Vitamin.State { + static let mocks: Self = [ + Vitamin.State(id: UUID(), + name: "비타민 C", + color: Color.yellow.opacity(0.5)), + Vitamin.State(id: UUID(), + name: "비타민 D", + color: Color.red.opacity(0.5)), + Vitamin.State(id: UUID(), + name: "비타민 B", + color: Color.blue.opacity(0.5)), + Vitamin.State(id: UUID(), + name: "루테인", + color: Color.pink.opacity(0.5)), + Vitamin.State(id: UUID(), + name: "유산균", + color: Color.green.opacity(0.5)), + ] +} diff --git a/CountApp/CountApp/Vitamin/Statistics/StatisticsView.swift b/CountApp/CountApp/Vitamin/Statistics/StatisticsView.swift new file mode 100644 index 0000000..4252f70 --- /dev/null +++ b/CountApp/CountApp/Vitamin/Statistics/StatisticsView.swift @@ -0,0 +1,69 @@ +// +// StatisticsView.swift +// CountApp +// +// Created by Leo on 1/14/24. +// + +import SwiftUI +import ComposableArchitecture + +struct StatisticsView: View { + + let store: StoreOf + + private let NAVIGATION_TITLE = "먹은 횟수" + + var body: some View { + WithViewStore(store, observe: { $0 }) { viewStore in + NavigationView { + VStack(spacing: 20) { + ForEachStore(store.scope(state: \.vitamins, + action: \.vitamins)) { store in + StatisticsCellView(store: store) + } + } + .navigationTitle(NAVIGATION_TITLE) + .navigationBarTitleDisplayMode(.automatic) + .toolbar { + Menu { + menuItems(with: viewStore) + } label: { + Image(systemName: "ellipsis.circle") + } + } + .frame(maxHeight: .infinity, alignment: .top) + .padding(.vertical) + } + } + } +} + +private extension StatisticsView { + func menuItems(with viewStore: ViewStore) -> some View { + Group { + Button( + role: .destructive, + action: { + viewStore.send(.resetAllVitamins) + }, label: { + Text("모두 초기화") + } + ) + + ForEach(viewStore.state.vitamins) { + let name = $0.name + Button("\(name) 초기화") { + viewStore.send(.resetVitamins(name: name)) + } + } + } + } +} + +#Preview { + StatisticsView( + store: Store(initialState: Vitamins.State()){ + + }) +} diff --git a/CountApp/CountApp/Vitamin/Statistics/Subviews/StatisticsCellView.swift b/CountApp/CountApp/Vitamin/Statistics/Subviews/StatisticsCellView.swift new file mode 100644 index 0000000..dffce9a --- /dev/null +++ b/CountApp/CountApp/Vitamin/Statistics/Subviews/StatisticsCellView.swift @@ -0,0 +1,52 @@ +// +// StatisticsCellView.swift +// CountApp +// +// Created by Leo on 1/14/24. +// + +import SwiftUI +import ComposableArchitecture + +struct StatisticsCellView: View { + + let store: StoreOf + + @State var isShowCount: Bool = false + + var body: some View { + WithViewStore(self.store, observe: { $0 }) { viewStore in + HStack { + vitaminName(with: viewStore.name) + vitamineCount(count: viewStore.count.toString) + } + .vitaminCellFrame(color: viewStore.color, height: 50) + } + .padding(.horizontal, 40) + } +} + +private extension StatisticsCellView { + + func vitaminName(with name: String) -> some View { + Text(name) + .font(.subheadline) + } + + func vitamineCount(count: String) -> some View { + Text(count + " 번") + } +} + +#Preview { + StatisticsCellView(store: Store( + initialState: Vitamin.State( + id: UUID(), + name: "VitaminC", + color: Color.yellow.opacity(0.5) + ), + reducer: { + + } + )) +} diff --git a/CountApp/CountApp/Vitamin/Vitamins/Subviews/VitaminCellView.swift b/CountApp/CountApp/Vitamin/Vitamins/Subviews/VitaminCellView.swift new file mode 100644 index 0000000..57a9d7f --- /dev/null +++ b/CountApp/CountApp/Vitamin/Vitamins/Subviews/VitaminCellView.swift @@ -0,0 +1,112 @@ +// +// VitaminCellView.swift +// CountApp +// +// Created by Leo on 1/14/24. +// + +import SwiftUI +import ComposableArchitecture +import Combine + +struct VitaminCellView: View { + + let store: StoreOf + + @State var isShowingCount: Bool = false { + didSet { + if isShowingCount { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + withAnimation { + isShowingCount = false + } + } + } + } + } + + var body: some View { + WithViewStore(self.store, observe: { $0 }) { viewStore in + HStack { + pillImage + vitaminName(with: viewStore.name) + } + .vitaminCellFrame(color: viewStore.color) + .overlay(alignment: .trailing) { + vitamineCount(count: viewStore.count.toString) + .opacity(isShowingCount ? 1 : 0) + .padding(.trailing, 60) + } + .onChange(of: viewStore.count) { + withAnimation { + isShowingCount = true + } + } + .contextMenu { + menuItems(with: viewStore) + } + .onTapGesture { + viewStore.send(.increaseCount(1)) + } + } + .padding(.horizontal, 40) + } +} + +private extension VitaminCellView { + typealias VitaminStore = ViewStore + + var pillImage: Image { + Image(systemName: "pills.fill") + } + + func vitaminName(with name: String) -> some View { + Text(name) + .font(.subheadline) + } + + func vitamineCount(count: String) -> some View { + Text("+ " + count) + } + + func menuItems(with viewStore: VitaminStore) -> some View { + let increaseSteps = [1, 5, 10] + return Group { + resetAllButton(with: viewStore) + + ForEach(0.. Button { + Button( + role: .destructive, + action: { + viewStore.send(.decreaseToZero) + }, label: { + Text("모두 초기화") + } + ) + } + + func increaseButton(with viewStore: VitaminStore, step: Int) -> Button { + Button("+" + step.toString) { + viewStore.send(.increaseCount(step)) + } + } +} + +#Preview { + VitaminCellView(store: Store( + initialState: Vitamin.State( + id: UUID(), + name: "VitaminC", + color: Color.yellow.opacity(0.5) + ), + reducer: { + + } + )) +} diff --git a/CountApp/CountApp/Vitamin/Vitamins/VitaminsView.swift b/CountApp/CountApp/Vitamin/Vitamins/VitaminsView.swift new file mode 100644 index 0000000..c113653 --- /dev/null +++ b/CountApp/CountApp/Vitamin/Vitamins/VitaminsView.swift @@ -0,0 +1,40 @@ +// +// VitaminsView.swift +// CountApp +// +// Created by Leo on 1/13/24. +// + +import SwiftUI +import ComposableArchitecture + +struct VitaminsView: View { + + let store: StoreOf + + private let NAVIGATION_TITLE = "비타민을 먹으세요" + + var body: some View { + WithViewStore(store, observe: { $0 }) { viewStore in + NavigationView { + VStack(spacing: 20) { + ForEachStore(store.scope(state: \.vitamins, + action: \.vitamins)) { store in + VitaminCellView(store: store) + } + } + .navigationTitle(NAVIGATION_TITLE) + .navigationBarTitleDisplayMode(.automatic) + .frame(maxHeight: .infinity, alignment: .top) + .padding(.vertical) + } + } + } +} + +#Preview { + VitaminsView( + store: Store(initialState: Vitamins.State()){ + + }) +} diff --git a/CountApp/CountAppTests/CountAppTests.swift b/CountApp/CountAppTests/CountAppTests.swift new file mode 100644 index 0000000..5a1c579 --- /dev/null +++ b/CountApp/CountAppTests/CountAppTests.swift @@ -0,0 +1,36 @@ +// +// CountAppTests.swift +// CountAppTests +// +// Created by Leo on 1/13/24. +// + +import XCTest +@testable import CountApp + +final class CountAppTests: 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/CountApp/CountAppUITests/CountAppUITests.swift b/CountApp/CountAppUITests/CountAppUITests.swift new file mode 100644 index 0000000..612e014 --- /dev/null +++ b/CountApp/CountAppUITests/CountAppUITests.swift @@ -0,0 +1,41 @@ +// +// CountAppUITests.swift +// CountAppUITests +// +// Created by Leo on 1/13/24. +// + +import XCTest + +final class CountAppUITests: 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/CountApp/CountAppUITests/CountAppUITestsLaunchTests.swift b/CountApp/CountAppUITests/CountAppUITestsLaunchTests.swift new file mode 100644 index 0000000..0edc47a --- /dev/null +++ b/CountApp/CountAppUITests/CountAppUITestsLaunchTests.swift @@ -0,0 +1,32 @@ +// +// CountAppUITestsLaunchTests.swift +// CountAppUITests +// +// Created by Leo on 1/13/24. +// + +import XCTest + +final class CountAppUITestsLaunchTests: 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) + } +}