diff --git a/DittoCommunity/.DS_Store b/DittoCommunity/.DS_Store new file mode 100644 index 0000000..e5e8dbc Binary files /dev/null and b/DittoCommunity/.DS_Store differ diff --git a/DittoCommunity/DittoCommunity.xcodeproj/project.pbxproj b/DittoCommunity/DittoCommunity.xcodeproj/project.pbxproj index 9764a3b..b9ba34d 100644 --- a/DittoCommunity/DittoCommunity.xcodeproj/project.pbxproj +++ b/DittoCommunity/DittoCommunity.xcodeproj/project.pbxproj @@ -7,18 +7,71 @@ objects = { /* Begin PBXBuildFile section */ + 3B3F228D2B11D7DC00351261 /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3B3F228C2B11D7DC00351261 /* Pretendard-Bold.otf */; }; + 3B3F228F2B11D7FB00351261 /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3B3F228E2B11D7FB00351261 /* Pretendard-SemiBold.otf */; }; + 3B3F22912B11D80600351261 /* Pretendard-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3B3F22902B11D80600351261 /* Pretendard-Regular.otf */; }; + 6C3EB03E2B11E070002D29C6 /* TestCompleteModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB03D2B11E070002D29C6 /* TestCompleteModalView.swift */; }; + 6C3EB0422B11E170002D29C6 /* CategoryModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB0412B11E170002D29C6 /* CategoryModalView.swift */; }; + 6C3EB0462B11E9DD002D29C6 /* CustomAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB0452B11E9DD002D29C6 /* CustomAlertView.swift */; }; + 6C3EB0482B120483002D29C6 /* ActionSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB0472B120483002D29C6 /* ActionSheetView.swift */; }; + 6C3EB04E2B121CF9002D29C6 /* CustomNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB04D2B121CF9002D29C6 /* CustomNavigationBar.swift */; }; + 6C3EB0542B122956002D29C6 /* FeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB0532B122956002D29C6 /* FeedView.swift */; }; + 6C3EB0582B122F93002D29C6 /* FeedViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB0572B122F93002D29C6 /* FeedViewModel.swift */; }; + 6C3EB05A2B1237A2002D29C6 /* CategoryType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB0592B1237A2002D29C6 /* CategoryType.swift */; }; + 6C3EB05D2B124606002D29C6 /* WrappingHStack in Frameworks */ = {isa = PBXBuildFile; productRef = 6C3EB05C2B124606002D29C6 /* WrappingHStack */; }; + 6C3EB0602B127BC2002D29C6 /* PopupView in Frameworks */ = {isa = PBXBuildFile; productRef = 6C3EB05F2B127BC2002D29C6 /* PopupView */; }; + 6C3EB0622B127BD9002D29C6 /* CategoryModalView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C3EB0612B127BD9002D29C6 /* CategoryModalView2.swift */; }; FBDDEFB42B11C6D500CB6B7C /* DittoCommunityApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFB32B11C6D500CB6B7C /* DittoCommunityApp.swift */; }; - FBDDEFB62B11C6D500CB6B7C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFB52B11C6D500CB6B7C /* ContentView.swift */; }; FBDDEFB82B11C6D600CB6B7C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FBDDEFB72B11C6D600CB6B7C /* Assets.xcassets */; }; FBDDEFBB2B11C6D600CB6B7C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FBDDEFBA2B11C6D600CB6B7C /* Preview Assets.xcassets */; }; + FBDDEFC32B11C75400CB6B7C /* MightyCombine in Frameworks */ = {isa = PBXBuildFile; productRef = FBDDEFC22B11C75400CB6B7C /* MightyCombine */; }; + FBDDEFC52B11C75400CB6B7C /* MightySwift in Frameworks */ = {isa = PBXBuildFile; productRef = FBDDEFC42B11C75400CB6B7C /* MightySwift */; }; + FBDDEFCD2B11CCB700CB6B7C /* MainTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFCC2B11CCB700CB6B7C /* MainTabView.swift */; }; + FBDDEFD02B11D2E500CB6B7C /* Color+DesignSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFCF2B11D2E500CB6B7C /* Color+DesignSystem.swift */; }; + FBDDEFD22B11D2F100CB6B7C /* Font+DesignSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFD12B11D2F100CB6B7C /* Font+DesignSystem.swift */; }; + FBDDEFD72B11DA9D00CB6B7C /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFD62B11DA9D00CB6B7C /* Profile.swift */; }; + FBDDEFD92B11DAA100CB6B7C /* Feed.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFD82B11DAA100CB6B7C /* Feed.swift */; }; + FBDDEFDC2B11DC8E00CB6B7C /* SympathyTestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFDB2B11DC8E00CB6B7C /* SympathyTestView.swift */; }; + FBDDEFDE2B11DE5800CB6B7C /* LoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFDD2B11DE5800CB6B7C /* LoginViewModel.swift */; }; + FBDDEFE02B11DF3100CB6B7C /* Image+Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFDF2B11DF3100CB6B7C /* Image+Icon.swift */; }; + FBDDEFE32B11E60D00CB6B7C /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFE22B11E60D00CB6B7C /* LoginView.swift */; }; + FBDDEFE72B11E97F00CB6B7C /* Color+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFE62B11E97F00CB6B7C /* Color+Hex.swift */; }; + FBDDEFE92B11EE3C00CB6B7C /* UINavigationController+UIGestureRecognizerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFE82B11EE3C00CB6B7C /* UINavigationController+UIGestureRecognizerDelegate.swift */; }; + FBDDEFEB2B12113600CB6B7C /* TestFinishView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFEA2B12113600CB6B7C /* TestFinishView.swift */; }; + FBDDEFED2B12155500CB6B7C /* UIscreen+ScreenSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDDEFEC2B12155500CB6B7C /* UIscreen+ScreenSize.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 3B3F228C2B11D7DC00351261 /* Pretendard-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Bold.otf"; sourceTree = ""; }; + 3B3F228E2B11D7FB00351261 /* Pretendard-SemiBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-SemiBold.otf"; sourceTree = ""; }; + 3B3F22902B11D80600351261 /* Pretendard-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Regular.otf"; sourceTree = ""; }; + 3B3F22922B11D9D300351261 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 6C3EB03D2B11E070002D29C6 /* TestCompleteModalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestCompleteModalView.swift; sourceTree = ""; }; + 6C3EB0412B11E170002D29C6 /* CategoryModalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryModalView.swift; sourceTree = ""; }; + 6C3EB0452B11E9DD002D29C6 /* CustomAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAlertView.swift; sourceTree = ""; }; + 6C3EB0472B120483002D29C6 /* ActionSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionSheetView.swift; sourceTree = ""; }; + 6C3EB04D2B121CF9002D29C6 /* CustomNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomNavigationBar.swift; sourceTree = ""; }; + 6C3EB0532B122956002D29C6 /* FeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedView.swift; sourceTree = ""; }; + 6C3EB0572B122F93002D29C6 /* FeedViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedViewModel.swift; sourceTree = ""; }; + 6C3EB0592B1237A2002D29C6 /* CategoryType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryType.swift; sourceTree = ""; }; + 6C3EB0612B127BD9002D29C6 /* CategoryModalView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryModalView2.swift; sourceTree = ""; }; FBDDEFB02B11C6D500CB6B7C /* DittoCommunity.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DittoCommunity.app; sourceTree = BUILT_PRODUCTS_DIR; }; FBDDEFB32B11C6D500CB6B7C /* DittoCommunityApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DittoCommunityApp.swift; sourceTree = ""; }; - FBDDEFB52B11C6D500CB6B7C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; FBDDEFB72B11C6D600CB6B7C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; FBDDEFBA2B11C6D600CB6B7C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + FBDDEFCC2B11CCB700CB6B7C /* MainTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTabView.swift; sourceTree = ""; }; + FBDDEFCF2B11D2E500CB6B7C /* Color+DesignSystem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+DesignSystem.swift"; sourceTree = ""; }; + FBDDEFD12B11D2F100CB6B7C /* Font+DesignSystem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Font+DesignSystem.swift"; sourceTree = ""; }; + FBDDEFD62B11DA9D00CB6B7C /* Profile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = ""; }; + FBDDEFD82B11DAA100CB6B7C /* Feed.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Feed.swift; sourceTree = ""; }; + FBDDEFDB2B11DC8E00CB6B7C /* SympathyTestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SympathyTestView.swift; sourceTree = ""; }; + FBDDEFDD2B11DE5800CB6B7C /* LoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = ""; }; + FBDDEFDF2B11DF3100CB6B7C /* Image+Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Image+Icon.swift"; sourceTree = ""; }; + FBDDEFE22B11E60D00CB6B7C /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = ""; }; + FBDDEFE62B11E97F00CB6B7C /* Color+Hex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Hex.swift"; sourceTree = ""; }; + FBDDEFE82B11EE3C00CB6B7C /* UINavigationController+UIGestureRecognizerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationController+UIGestureRecognizerDelegate.swift"; sourceTree = ""; }; + FBDDEFEA2B12113600CB6B7C /* TestFinishView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestFinishView.swift; sourceTree = ""; }; + FBDDEFEC2B12155500CB6B7C /* UIscreen+ScreenSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIscreen+ScreenSize.swift"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -26,12 +79,42 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 6C3EB0602B127BC2002D29C6 /* PopupView in Frameworks */, + FBDDEFC52B11C75400CB6B7C /* MightySwift in Frameworks */, + 6C3EB05D2B124606002D29C6 /* WrappingHStack in Frameworks */, + FBDDEFC32B11C75400CB6B7C /* MightyCombine in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3B3F228B2B11D77F00351261 /* Fonts */ = { + isa = PBXGroup; + children = ( + 3B3F228C2B11D7DC00351261 /* Pretendard-Bold.otf */, + 3B3F228E2B11D7FB00351261 /* Pretendard-SemiBold.otf */, + 3B3F22902B11D80600351261 /* Pretendard-Regular.otf */, + ); + path = Fonts; + sourceTree = ""; + }; + 6C3EB04B2B121CD5002D29C6 /* Component */ = { + isa = PBXGroup; + children = ( + 6C3EB04C2B121CDF002D29C6 /* NavigationBar */, + ); + path = Component; + sourceTree = ""; + }; + 6C3EB04C2B121CDF002D29C6 /* NavigationBar */ = { + isa = PBXGroup; + children = ( + 6C3EB04D2B121CF9002D29C6 /* CustomNavigationBar.swift */, + ); + path = NavigationBar; + sourceTree = ""; + }; FBDDEFA72B11C6D500CB6B7C = { isa = PBXGroup; children = ( @@ -51,9 +134,13 @@ FBDDEFB22B11C6D500CB6B7C /* DittoCommunity */ = { isa = PBXGroup; children = ( + 6C3EB04B2B121CD5002D29C6 /* Component */, + 3B3F22922B11D9D300351261 /* Info.plist */, FBDDEFB32B11C6D500CB6B7C /* DittoCommunityApp.swift */, - FBDDEFB52B11C6D500CB6B7C /* ContentView.swift */, - FBDDEFB72B11C6D600CB6B7C /* Assets.xcassets */, + FBDDEFE42B11E96F00CB6B7C /* Helper */, + FBDDEFCE2B11D2D100CB6B7C /* DesignSystem */, + 3B3F228B2B11D77F00351261 /* Fonts */, + FBDDEFC62B11CC8700CB6B7C /* View */, FBDDEFB92B11C6D600CB6B7C /* Preview Content */, ); path = DittoCommunity; @@ -67,6 +154,97 @@ path = "Preview Content"; sourceTree = ""; }; + FBDDEFC62B11CC8700CB6B7C /* View */ = { + isa = PBXGroup; + children = ( + FBDDEFE12B11E5FE00CB6B7C /* Login */, + FBDDEFD32B11DA8F00CB6B7C /* CustomModal */, + FBDDEFC92B11CC9B00CB6B7C /* Profile */, + FBDDEFC82B11CC9600CB6B7C /* Feed */, + FBDDEFC72B11CC9000CB6B7C /* MainTab */, + ); + path = View; + sourceTree = ""; + }; + FBDDEFC72B11CC9000CB6B7C /* MainTab */ = { + isa = PBXGroup; + children = ( + FBDDEFCC2B11CCB700CB6B7C /* MainTabView.swift */, + ); + path = MainTab; + sourceTree = ""; + }; + FBDDEFC82B11CC9600CB6B7C /* Feed */ = { + isa = PBXGroup; + children = ( + FBDDEFD82B11DAA100CB6B7C /* Feed.swift */, + 6C3EB0572B122F93002D29C6 /* FeedViewModel.swift */, + 6C3EB0532B122956002D29C6 /* FeedView.swift */, + ); + path = Feed; + sourceTree = ""; + }; + FBDDEFC92B11CC9B00CB6B7C /* Profile */ = { + isa = PBXGroup; + children = ( + FBDDEFD62B11DA9D00CB6B7C /* Profile.swift */, + ); + path = Profile; + sourceTree = ""; + }; + FBDDEFCE2B11D2D100CB6B7C /* DesignSystem */ = { + isa = PBXGroup; + children = ( + FBDDEFB72B11C6D600CB6B7C /* Assets.xcassets */, + FBDDEFCF2B11D2E500CB6B7C /* Color+DesignSystem.swift */, + FBDDEFD12B11D2F100CB6B7C /* Font+DesignSystem.swift */, + FBDDEFDF2B11DF3100CB6B7C /* Image+Icon.swift */, + ); + path = DesignSystem; + sourceTree = ""; + }; + FBDDEFD32B11DA8F00CB6B7C /* CustomModal */ = { + isa = PBXGroup; + children = ( + 6C3EB0472B120483002D29C6 /* ActionSheetView.swift */, + 6C3EB03D2B11E070002D29C6 /* TestCompleteModalView.swift */, + 6C3EB0412B11E170002D29C6 /* CategoryModalView.swift */, + 6C3EB0612B127BD9002D29C6 /* CategoryModalView2.swift */, + 6C3EB0452B11E9DD002D29C6 /* CustomAlertView.swift */, + 6C3EB0592B1237A2002D29C6 /* CategoryType.swift */, + ); + path = CustomModal; + sourceTree = ""; + }; + FBDDEFE12B11E5FE00CB6B7C /* Login */ = { + isa = PBXGroup; + children = ( + FBDDEFE22B11E60D00CB6B7C /* LoginView.swift */, + FBDDEFDD2B11DE5800CB6B7C /* LoginViewModel.swift */, + FBDDEFDB2B11DC8E00CB6B7C /* SympathyTestView.swift */, + FBDDEFEA2B12113600CB6B7C /* TestFinishView.swift */, + ); + path = Login; + sourceTree = ""; + }; + FBDDEFE42B11E96F00CB6B7C /* Helper */ = { + isa = PBXGroup; + children = ( + FBDDEFE52B11E97800CB6B7C /* Extension */, + ); + path = Helper; + sourceTree = ""; + }; + FBDDEFE52B11E97800CB6B7C /* Extension */ = { + isa = PBXGroup; + children = ( + FBDDEFE62B11E97F00CB6B7C /* Color+Hex.swift */, + FBDDEFEC2B12155500CB6B7C /* UIscreen+ScreenSize.swift */, + FBDDEFE82B11EE3C00CB6B7C /* UINavigationController+UIGestureRecognizerDelegate.swift */, + ); + path = Extension; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -83,6 +261,12 @@ dependencies = ( ); name = DittoCommunity; + packageProductDependencies = ( + FBDDEFC22B11C75400CB6B7C /* MightyCombine */, + FBDDEFC42B11C75400CB6B7C /* MightySwift */, + 6C3EB05C2B124606002D29C6 /* WrappingHStack */, + 6C3EB05F2B127BC2002D29C6 /* PopupView */, + ); productName = DittoCommunity; productReference = FBDDEFB02B11C6D500CB6B7C /* DittoCommunity.app */; productType = "com.apple.product-type.application"; @@ -111,6 +295,11 @@ Base, ); mainGroup = FBDDEFA72B11C6D500CB6B7C; + packageReferences = ( + FBDDEFC12B11C75400CB6B7C /* XCRemoteSwiftPackageReference "MightyCombine" */, + 6C3EB05B2B124606002D29C6 /* XCRemoteSwiftPackageReference "WrappingHStack" */, + 6C3EB05E2B127BC2002D29C6 /* XCRemoteSwiftPackageReference "PopupView" */, + ); productRefGroup = FBDDEFB12B11C6D500CB6B7C /* Products */; projectDirPath = ""; projectRoot = ""; @@ -126,7 +315,10 @@ buildActionMask = 2147483647; files = ( FBDDEFBB2B11C6D600CB6B7C /* Preview Assets.xcassets in Resources */, + 3B3F228D2B11D7DC00351261 /* Pretendard-Bold.otf in Resources */, + 3B3F22912B11D80600351261 /* Pretendard-Regular.otf in Resources */, FBDDEFB82B11C6D600CB6B7C /* Assets.xcassets in Resources */, + 3B3F228F2B11D7FB00351261 /* Pretendard-SemiBold.otf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -137,8 +329,30 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FBDDEFB62B11C6D500CB6B7C /* ContentView.swift in Sources */, + 6C3EB0482B120483002D29C6 /* ActionSheetView.swift in Sources */, FBDDEFB42B11C6D500CB6B7C /* DittoCommunityApp.swift in Sources */, + FBDDEFD72B11DA9D00CB6B7C /* Profile.swift in Sources */, + FBDDEFE02B11DF3100CB6B7C /* Image+Icon.swift in Sources */, + 6C3EB04E2B121CF9002D29C6 /* CustomNavigationBar.swift in Sources */, + FBDDEFD02B11D2E500CB6B7C /* Color+DesignSystem.swift in Sources */, + FBDDEFED2B12155500CB6B7C /* UIscreen+ScreenSize.swift in Sources */, + 6C3EB0542B122956002D29C6 /* FeedView.swift in Sources */, + 6C3EB05A2B1237A2002D29C6 /* CategoryType.swift in Sources */, + FBDDEFDC2B11DC8E00CB6B7C /* SympathyTestView.swift in Sources */, + FBDDEFE72B11E97F00CB6B7C /* Color+Hex.swift in Sources */, + FBDDEFD92B11DAA100CB6B7C /* Feed.swift in Sources */, + FBDDEFCD2B11CCB700CB6B7C /* MainTabView.swift in Sources */, + FBDDEFE92B11EE3C00CB6B7C /* UINavigationController+UIGestureRecognizerDelegate.swift in Sources */, + FBDDEFD22B11D2F100CB6B7C /* Font+DesignSystem.swift in Sources */, + FBDDEFE32B11E60D00CB6B7C /* LoginView.swift in Sources */, + FBDDEFDE2B11DE5800CB6B7C /* LoginViewModel.swift in Sources */, + 6C3EB0582B122F93002D29C6 /* FeedViewModel.swift in Sources */, + FBDDEFEB2B12113600CB6B7C /* TestFinishView.swift in Sources */, + 6C3EB0622B127BD9002D29C6 /* CategoryModalView2.swift in Sources */, + 6C3EB0422B11E170002D29C6 /* CategoryModalView.swift in Sources */, + 6C3EB0462B11E9DD002D29C6 /* CustomAlertView.swift in Sources */, + FBDDEFD22B11D2F100CB6B7C /* Font+DesignSystem.swift in Sources */, + 6C3EB03E2B11E070002D29C6 /* TestCompleteModalView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -275,11 +489,16 @@ DEVELOPMENT_TEAM = 76AJ433CP5; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = DittoCommunity/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "\"\""; + INFOPLIST_KEY_LSApplicationCategoryType = ""; 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"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UIUserInterfaceStyle = Light; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -287,9 +506,12 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = kim.DittoCommunity; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Debug; }; @@ -304,11 +526,16 @@ DEVELOPMENT_TEAM = 76AJ433CP5; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = DittoCommunity/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "\"\""; + INFOPLIST_KEY_LSApplicationCategoryType = ""; 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"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UIUserInterfaceStyle = Light; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -316,9 +543,12 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = kim.DittoCommunity; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = 1; }; name = Release; }; @@ -344,6 +574,56 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 6C3EB05B2B124606002D29C6 /* XCRemoteSwiftPackageReference "WrappingHStack" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/dkk/WrappingHStack"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 2.0.0; + }; + }; + 6C3EB05E2B127BC2002D29C6 /* XCRemoteSwiftPackageReference "PopupView" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/exyte/PopupView.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 2.0.0; + }; + }; + FBDDEFC12B11C75400CB6B7C /* XCRemoteSwiftPackageReference "MightyCombine" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/MightyCombine/MightyCombine.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.1.3; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 6C3EB05C2B124606002D29C6 /* WrappingHStack */ = { + isa = XCSwiftPackageProductDependency; + package = 6C3EB05B2B124606002D29C6 /* XCRemoteSwiftPackageReference "WrappingHStack" */; + productName = WrappingHStack; + }; + 6C3EB05F2B127BC2002D29C6 /* PopupView */ = { + isa = XCSwiftPackageProductDependency; + package = 6C3EB05E2B127BC2002D29C6 /* XCRemoteSwiftPackageReference "PopupView" */; + productName = PopupView; + }; + FBDDEFC22B11C75400CB6B7C /* MightyCombine */ = { + isa = XCSwiftPackageProductDependency; + package = FBDDEFC12B11C75400CB6B7C /* XCRemoteSwiftPackageReference "MightyCombine" */; + productName = MightyCombine; + }; + FBDDEFC42B11C75400CB6B7C /* MightySwift */ = { + isa = XCSwiftPackageProductDependency; + package = FBDDEFC12B11C75400CB6B7C /* XCRemoteSwiftPackageReference "MightyCombine" */; + productName = MightySwift; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = FBDDEFA82B11C6D500CB6B7C /* Project object */; } diff --git a/DittoCommunity/DittoCommunity.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DittoCommunity/DittoCommunity.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..40c0636 --- /dev/null +++ b/DittoCommunity/DittoCommunity.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,32 @@ +{ + "pins" : [ + { + "identity" : "mightycombine", + "kind" : "remoteSourceControl", + "location" : "https://github.com/MightyCombine/MightyCombine.git", + "state" : { + "revision" : "770244957849fa83bc095418836c4a0c46b6f20c", + "version" : "1.1.3" + } + }, + { + "identity" : "popupview", + "kind" : "remoteSourceControl", + "location" : "https://github.com/exyte/PopupView.git", + "state" : { + "revision" : "4e64eb67d4510c96f82efd9e34b8fa5b9b397791", + "version" : "2.8.3" + } + }, + { + "identity" : "wrappinghstack", + "kind" : "remoteSourceControl", + "location" : "https://github.com/dkk/WrappingHStack", + "state" : { + "revision" : "425d9488ba55f58f0b34498c64c054c77fc2a44b", + "version" : "2.2.11" + } + } + ], + "version" : 2 +} diff --git a/DittoCommunity/DittoCommunity/Component/NavigationBar/CustomNavigationBar.swift b/DittoCommunity/DittoCommunity/Component/NavigationBar/CustomNavigationBar.swift new file mode 100644 index 0000000..3a34711 --- /dev/null +++ b/DittoCommunity/DittoCommunity/Component/NavigationBar/CustomNavigationBar.swift @@ -0,0 +1,79 @@ +// +// CustomNavigationBar.swift +// DittoCommunity +// +// Created by Subeen on 2023/11/25. +// + +import SwiftUI + +struct CustomNavigationBar: View { + let title: String + + let isDisplayLeadingBtn: Bool + let isDisplayTrailingBtn: Bool + + let leadingItems: [(Icon, () -> Void)] + let trailingItems: [(Icon, () -> Void)] + + init( + title: String = "", + isDisplayLeadingBtn: Bool = true, + isDisplayTrailingBtn: Bool = true, + leadingItems: [(Icon, () -> Void)] = [(.chevronLeft, {})], + trailingItems: [(Icon, () -> Void)] = [(.chevronLeft, {}), (.chevronLeft, {})] + ) { + self.title = title + self.isDisplayLeadingBtn = isDisplayLeadingBtn + self.isDisplayTrailingBtn = isDisplayTrailingBtn + self.leadingItems = leadingItems + self.trailingItems = trailingItems + } + + var body: some View { + HStack(spacing: 0) { + if isDisplayLeadingBtn { + ForEach(leadingItems, id: \.0, content: { item in + Button( + action: { + item.1() + }, + label: { + item.0.image + } + ) + }) + } + + Spacer() + + Text(title) + .font(.t1) + + Spacer() + + if isDisplayTrailingBtn { + ForEach(trailingItems, id: \.0, content: { item in + Button( + action: { + item.1() + }, + label: { + item.0.image + } + ) + .padding(.leading, 18) + }) + } + } + .padding(.horizontal, 20) + .frame(height: 44) + } +} + +struct CustomNavigationBar_Previews: PreviewProvider { + static var previews: some View { + CustomNavigationBar() + .previewLayout(.sizeThatFits) + } +} diff --git a/DittoCommunity/DittoCommunity/ContentView.swift b/DittoCommunity/DittoCommunity/ContentView.swift deleted file mode 100644 index 5f0b5ce..0000000 --- a/DittoCommunity/DittoCommunity/ContentView.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// ContentView.swift -// DittoCommunity -// -// Created by 김인섭 on 11/25/23. -// - -import SwiftUI - -struct ContentView: View { - var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundStyle(.tint) - Text("Hello, world!") - } - .padding() - } -} - -#Preview { - ContentView() -} diff --git a/DittoCommunity/DittoCommunity/Assets.xcassets/AccentColor.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from DittoCommunity/DittoCommunity/Assets.xcassets/AccentColor.colorset/Contents.json rename to DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/DittoCommunity/DittoCommunity/Assets.xcassets/AppIcon.appiconset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from DittoCommunity/DittoCommunity/Assets.xcassets/AppIcon.appiconset/Contents.json rename to DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/222222.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/222222.colorset/Contents.json new file mode 100644 index 0000000..99b1180 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/222222.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x22", + "green" : "0x22", + "red" : "0x22" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/444444.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/444444.colorset/Contents.json new file mode 100644 index 0000000..a982db0 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/444444.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x44", + "green" : "0x44", + "red" : "0x44" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/888888.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/888888.colorset/Contents.json new file mode 100644 index 0000000..e2feb43 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/888888.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x88", + "green" : "0x88", + "red" : "0x88" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/BDBDBD.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/BDBDBD.colorset/Contents.json new file mode 100644 index 0000000..c200e44 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/BDBDBD.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xBD", + "green" : "0xBD", + "red" : "0xBD" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/Assets.xcassets/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/Contents.json similarity index 100% rename from DittoCommunity/DittoCommunity/Assets.xcassets/Contents.json rename to DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/Contents.json diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/DDDDDD.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/DDDDDD.colorset/Contents.json new file mode 100644 index 0000000..965cbd9 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/DDDDDD.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xDD", + "green" : "0xDD", + "red" : "0xDD" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/E9E9E9.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/E9E9E9.colorset/Contents.json new file mode 100644 index 0000000..47a98e1 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/E9E9E9.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xE9", + "green" : "0xE9", + "red" : "0xE9" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/F3F3F3.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/F3F3F3.colorset/Contents.json new file mode 100644 index 0000000..a7320b8 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/F3F3F3.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF3", + "green" : "0xF3", + "red" : "0xF3" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/FF922D.colorset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/FF922D.colorset/Contents.json new file mode 100644 index 0000000..ea5a662 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Color/FF922D.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0x2D", + "green" : "0x92", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/arrowRight.imageset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/arrowRight.imageset/Contents.json new file mode 100644 index 0000000..7848c1d --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/arrowRight.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "arrow._right.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/arrowRight.imageset/arrow._right.pdf b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/arrowRight.imageset/arrow._right.pdf new file mode 100644 index 0000000..4faefaa Binary files /dev/null and b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/arrowRight.imageset/arrow._right.pdf differ diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/cancel.imageset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/cancel.imageset/Contents.json new file mode 100644 index 0000000..6b8b412 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/cancel.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "cancle.pdf", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/cancel.imageset/cancle.pdf b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/cancel.imageset/cancle.pdf new file mode 100644 index 0000000..74e55a4 Binary files /dev/null and b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/cancel.imageset/cancle.pdf differ diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/chevronLeft.imageset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/chevronLeft.imageset/Contents.json new file mode 100644 index 0000000..6c3e5d3 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/chevronLeft.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "chevronLeft.pdf", + "idiom" : "iphone" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/chevronLeft.imageset/chevronLeft.pdf b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/chevronLeft.imageset/chevronLeft.pdf new file mode 100644 index 0000000..531e07e Binary files /dev/null and b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/chevronLeft.imageset/chevronLeft.pdf differ diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/complete.imageset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/complete.imageset/Contents.json new file mode 100644 index 0000000..dd32824 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/complete.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "complete.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/complete.imageset/complete.pdf b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/complete.imageset/complete.pdf new file mode 100644 index 0000000..1b24a93 Binary files /dev/null and b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/complete.imageset/complete.pdf differ diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/google.imageset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/google.imageset/Contents.json new file mode 100644 index 0000000..70e05cf --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/google.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "google.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/google.imageset/google.pdf b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/google.imageset/google.pdf new file mode 100644 index 0000000..2656ef3 Binary files /dev/null and b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/google.imageset/google.pdf differ diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/kakao.imageset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/kakao.imageset/Contents.json new file mode 100644 index 0000000..2ff1237 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/kakao.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "kakao.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/kakao.imageset/kakao.pdf b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/kakao.imageset/kakao.pdf new file mode 100644 index 0000000..c52b7f0 Binary files /dev/null and b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/kakao.imageset/kakao.pdf differ diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/naver.imageset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/naver.imageset/Contents.json new file mode 100644 index 0000000..59d595e --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/naver.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "naver.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/naver.imageset/naver.pdf b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/naver.imageset/naver.pdf new file mode 100644 index 0000000..a8e1051 Binary files /dev/null and b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/naver.imageset/naver.pdf differ diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/skip.imageset/Contents.json b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/skip.imageset/Contents.json new file mode 100644 index 0000000..441ac1a --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/skip.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "건너뛰기.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/skip.imageset/\352\261\264\353\204\210\353\233\260\352\270\260.pdf" "b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/skip.imageset/\352\261\264\353\204\210\353\233\260\352\270\260.pdf" new file mode 100644 index 0000000..e2fd963 Binary files /dev/null and "b/DittoCommunity/DittoCommunity/DesignSystem/Assets.xcassets/Icon/skip.imageset/\352\261\264\353\204\210\353\233\260\352\270\260.pdf" differ diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Color+DesignSystem.swift b/DittoCommunity/DittoCommunity/DesignSystem/Color+DesignSystem.swift new file mode 100644 index 0000000..163622d --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Color+DesignSystem.swift @@ -0,0 +1,23 @@ +// +// Color+DesignSystem.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import Foundation +import SwiftUI + +public extension Color { + + // MARK: - Gray Scale + static let gray01 = Color("F3F3F3") + static let gray02 = Color("E9E9E9") + static let gray03 = Color("DDDDDD") + static let gray04 = Color("BDBDBD") + static let gray05 = Color("888888") + static let gray06 = Color("444444") + static let gray07 = Color("222222") + + static let primary02 = Color("FF922D") +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Font+DesignSystem.swift b/DittoCommunity/DittoCommunity/DesignSystem/Font+DesignSystem.swift new file mode 100644 index 0000000..eb7b6c5 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Font+DesignSystem.swift @@ -0,0 +1,53 @@ +// +// Font+DesignSystem.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import Foundation +import SwiftUI + + +extension Font { + + public static var h1: Font { + return .custom("Pretendard-Bold", size: 24) + } + + public static var h2: Font { + return .custom("Pretendard-Bold", size: 20) + } + + public static var h3: Font { + return .custom("Pretendard-Bold", size: 16) + } + + public static var h4: Font { + return .custom("Pretendard-Bold", size: 14) + } + + public static var t1: Font { + return .custom("Pretendard-SemiBold", size: 16) + } + + public static var t2: Font { + return .custom("Pretendard-SemiBold", size: 14) + } + + public static var b1: Font { + return .custom("Pretendard-Regular", size: 16) + } + + public static var b2: Font { + return .custom("Pretendard-Regular", size: 14) + } + + public static var b3: Font { + return .custom("Pretendard-Regular", size: 12) + } + + public static var b4: Font { + return .custom("Pretendard-Regular", size: 10) + } +} diff --git a/DittoCommunity/DittoCommunity/DesignSystem/Image+Icon.swift b/DittoCommunity/DittoCommunity/DesignSystem/Image+Icon.swift new file mode 100644 index 0000000..670dfe8 --- /dev/null +++ b/DittoCommunity/DittoCommunity/DesignSystem/Image+Icon.swift @@ -0,0 +1,24 @@ +// +// Image+Icon.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import Foundation +import SwiftUI + +enum Icon: String { + case chevronLeft = "chevronLeft" + case skip = "skip" + case arrowRight = "arrowRight" + case complete = "complete" + case cancel = "cancel" + case naver = "naver" + case kakao = "kakao" + case google = "google" + + var image: Image { + return Image(self.rawValue) + } +} diff --git a/DittoCommunity/DittoCommunity/DittoCommunityApp.swift b/DittoCommunity/DittoCommunity/DittoCommunityApp.swift index 8d44bfe..6b928dc 100644 --- a/DittoCommunity/DittoCommunity/DittoCommunityApp.swift +++ b/DittoCommunity/DittoCommunity/DittoCommunityApp.swift @@ -9,9 +9,22 @@ import SwiftUI @main struct DittoCommunityApp: App { + + @StateObject var appState = AppState() + var body: some Scene { WindowGroup { - ContentView() + if appState.hasLogin { + MainTabView() + } else { + LoginView() + .environmentObject(appState) + } } } } + +class AppState: ObservableObject { + + @AppStorage("hasLogin") var hasLogin = false +} diff --git a/DittoCommunity/DittoCommunity/Fonts/Pretendard-Bold.otf b/DittoCommunity/DittoCommunity/Fonts/Pretendard-Bold.otf new file mode 100644 index 0000000..8e5e30a Binary files /dev/null and b/DittoCommunity/DittoCommunity/Fonts/Pretendard-Bold.otf differ diff --git a/DittoCommunity/DittoCommunity/Fonts/Pretendard-Regular.otf b/DittoCommunity/DittoCommunity/Fonts/Pretendard-Regular.otf new file mode 100644 index 0000000..08bf4cf Binary files /dev/null and b/DittoCommunity/DittoCommunity/Fonts/Pretendard-Regular.otf differ diff --git a/DittoCommunity/DittoCommunity/Fonts/Pretendard-SemiBold.otf b/DittoCommunity/DittoCommunity/Fonts/Pretendard-SemiBold.otf new file mode 100644 index 0000000..e7e36ab Binary files /dev/null and b/DittoCommunity/DittoCommunity/Fonts/Pretendard-SemiBold.otf differ diff --git a/DittoCommunity/DittoCommunity/Helper/Extension/Color+Hex.swift b/DittoCommunity/DittoCommunity/Helper/Extension/Color+Hex.swift new file mode 100644 index 0000000..1dd0b01 --- /dev/null +++ b/DittoCommunity/DittoCommunity/Helper/Extension/Color+Hex.swift @@ -0,0 +1,36 @@ +// +// Color+Hex.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import SwiftUI + +extension Color { + + init(hex: String) { + let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) + var int: UInt64 = 0 + Scanner(string: hex).scanHexInt64(&int) + let a, r, g, b: UInt64 + switch hex.count { + case 3: // RGB (12-bit) + (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) + case 6: // RGB (24-bit) + (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) + case 8: // ARGB (32-bit) + (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) + default: + (a, r, g, b) = (1, 1, 1, 0) + } + + self.init( + .sRGB, + red: Double(r) / 255, + green: Double(g) / 255, + blue: Double(b) / 255, + opacity: Double(a) / 255 + ) + } +} diff --git a/DittoCommunity/DittoCommunity/Helper/Extension/UINavigationController+UIGestureRecognizerDelegate.swift b/DittoCommunity/DittoCommunity/Helper/Extension/UINavigationController+UIGestureRecognizerDelegate.swift new file mode 100644 index 0000000..c940232 --- /dev/null +++ b/DittoCommunity/DittoCommunity/Helper/Extension/UINavigationController+UIGestureRecognizerDelegate.swift @@ -0,0 +1,20 @@ +// +// UINavigationController+UIGestureRecognizerDelegate.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import UIKit + +extension UINavigationController: UIGestureRecognizerDelegate { + + override open func viewDidLoad() { + super.viewDidLoad() + interactivePopGestureRecognizer?.delegate = self + + } + public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { + return viewControllers.count > 1 + } +} diff --git a/DittoCommunity/DittoCommunity/Helper/Extension/UIscreen+ScreenSize.swift b/DittoCommunity/DittoCommunity/Helper/Extension/UIscreen+ScreenSize.swift new file mode 100644 index 0000000..8802c15 --- /dev/null +++ b/DittoCommunity/DittoCommunity/Helper/Extension/UIscreen+ScreenSize.swift @@ -0,0 +1,14 @@ +// +// UIscreen+ScreenSize.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import UIKit + +extension UIScreen{ + static let screenWidth = UIScreen.main.bounds.size.width + static let screenHeight = UIScreen.main.bounds.size.height + static let screenSize = UIScreen.main.bounds.size +} diff --git a/DittoCommunity/DittoCommunity/Info.plist b/DittoCommunity/DittoCommunity/Info.plist new file mode 100644 index 0000000..e71c405 --- /dev/null +++ b/DittoCommunity/DittoCommunity/Info.plist @@ -0,0 +1,12 @@ + + + + + UIAppFonts + + Pretendard-Bold.otf + Pretendard-SemiBold.otf + Pretendard-Regular.otf + + + diff --git a/DittoCommunity/DittoCommunity/View/CustomModal/ActionSheetView.swift b/DittoCommunity/DittoCommunity/View/CustomModal/ActionSheetView.swift new file mode 100644 index 0000000..c340687 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/CustomModal/ActionSheetView.swift @@ -0,0 +1,63 @@ +// +// ActionSheetView.swift +// DittoCommunity +// +// Created by Subeen on 2023/11/25. +// + +import SwiftUI + +struct ActionSheetView: View { + + let items: [(String, () -> Void)] + + init(items: [(String, () -> Void)] = [("프로필 방문", {}), ("프로필 방문2", {}), ("프로필 방문3", {})]) { + self.items = items + } + + var body: some View { + ZStack { + Color.black.opacity(0.5).ignoresSafeArea(.all) + + VStack(spacing: 0) { + Spacer() + + Rectangle() + .foregroundColor(.white) + .frame(height: 60 * CGFloat(items.count)) + .overlay { + VStack(spacing: 0) { + + ForEach(items, id: \.0, content: { item in + Button( + action: { + item.1() + }, + label: { + Text(item.0) + .font(.b1) + .foregroundColor(.gray07) + .frame(maxWidth: .infinity, maxHeight: .infinity) + } + ) + Rectangle() + .frame(height: 1) + + }) + } + .foregroundColor(.gray03) + } + } + .edgesIgnoringSafeArea(.bottom) + + } + } +} + + + +struct ActionSheetView_Previews: PreviewProvider { + static var previews: some View { + ActionSheetView() + } +} diff --git a/DittoCommunity/DittoCommunity/View/CustomModal/CategoryModalView.swift b/DittoCommunity/DittoCommunity/View/CustomModal/CategoryModalView.swift new file mode 100644 index 0000000..dded1a5 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/CustomModal/CategoryModalView.swift @@ -0,0 +1,160 @@ +//// +//// CategoryModalView2.swift +//// DittoCommunity +//// +//// Created by Subeen on 2023/11/26. +//// +// +//import SwiftUI +//import WrappingHStack +//import PopupView +// +//struct CategoryModalView: View { +// @Binding var isCategoryTapped: Bool +// @Binding var category: String +// +// +// init( +// isCategoryTapped: Binding = .constant(true), +// category: Binding = .constant("") +// ) { +// _isCategoryTapped = isCategoryTapped +// _category = category +// } +// +// var body: some View { +//// CategoryView() +// +// ZStack { +// Color.white +// VStack(spacing: 0) { +// Spacer() +// .frame(height: 8) +// Rectangle() +// .foregroundColor(.gray03) +// .frame(width: 90, height: 6) +// .cornerRadius(50) +// Spacer() +// .frame(height: 32) +// // CategoryListView() +// WrappingHStack(CategoryType.allCases, id:\.self) { category in +// Button( +// action: { +// self.category = category.description +// isCategoryTapped.toggle() +// }, +// label: { +// Text(category.description) +// .font(.b2) +// .foregroundColor(.gray07) +// .padding(.horizontal, 12) +// .padding(.vertical, 6) +// .background(Color.gray01) +// .cornerRadius(8) +// } +// ) +// .padding(.bottom, 8) +// } +// .padding(.leading, 19) +// Spacer() +// } +// } +// .frame(height: 210) +// .roundedCorner(30, corners: [.topLeft, .topRight]) +// } +//} +// +//// MARK: - 카테고리 뷰 +////private struct CategoryView: View { +//// +//// fileprivate var body: some View { +//// ZStack { +//// Color.white +//// VStack(spacing: 0) { +//// Spacer() +//// .frame(height: 8) +//// Rectangle() +//// .foregroundColor(.gray03) +//// .frame(width: 90, height: 6) +//// .cornerRadius(50) +//// Spacer() +//// .frame(height: 32) +////// CategoryListView() +//// WrappingHStack(CategoryType.allCases, id:\.self) { category in +//// Button( +//// action: { +//// +//// }, +//// label: { +//// Text(category.description) +//// .font(.b2) +//// .foregroundColor(.gray07) +//// .padding(.horizontal, 12) +//// .padding(.vertical, 6) +//// .background(Color.gray01) +//// .cornerRadius(8) +//// } +//// ) +//// .padding(.bottom, 8) +//// } +//// .padding(.leading, 19) +//// Spacer() +//// } +//// } +//// .frame(height: 210) +//// .roundedCorner(30, corners: [.topLeft, .topRight]) +//// } +////} +// +//// MARK: - 카테고리 셀 뷰 +// +////fileprivate struct CategoryListView: View { +//// +//// fileprivate var body: some View { +//// WrappingHStack(CategoryType.allCases, id:\.self) { category in +//// Button( +//// action: { +//// +//// }, +//// label: { +//// Text(category.description) +//// .font(.b2) +//// .foregroundColor(.gray07) +//// .padding(.horizontal, 12) +//// .padding(.vertical, 6) +//// .background(Color.gray01) +//// .cornerRadius(8) +//// } +//// ) +//// .padding(.bottom, 8) +//// } +//// .padding(.leading, 19) +//// } +////} +// +// +//struct CategoryModalView_Previews: PreviewProvider { +// static var previews: some View { +// +// CategoryModalView2() +// .previewLayout(.sizeThatFits) +// } +//} +// +//// MARK: - 부분 Radius 설정 +// +//struct RoundedCorner: Shape { +// var radius: CGFloat = .infinity +// var corners: UIRectCorner = .allCorners +// +// func path(in rect: CGRect) -> Path { +// let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) +// return Path(path.cgPath) +// } +//} +// +//extension View { +// func roundedCorner(_ radius: CGFloat, corners: UIRectCorner) -> some View { +// clipShape(RoundedCorner(radius: radius, corners: corners) ) +// } +//} diff --git a/DittoCommunity/DittoCommunity/View/CustomModal/CategoryModalView2.swift b/DittoCommunity/DittoCommunity/View/CustomModal/CategoryModalView2.swift new file mode 100644 index 0000000..a3c8c68 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/CustomModal/CategoryModalView2.swift @@ -0,0 +1,160 @@ +// +// CategoryModalView2.swift +// DittoCommunity +// +// Created by Subeen on 2023/11/26. +// + +import SwiftUI +import WrappingHStack +import PopupView + +struct CategoryModalView2: View { + @Binding var isCategoryTapped: Bool + @Binding var category: String + + + init( + isCategoryTapped: Binding = .constant(true), + category: Binding = .constant("") + ) { + _isCategoryTapped = isCategoryTapped + _category = category + } + + var body: some View { +// CategoryView() + + ZStack { + Color.white + VStack(spacing: 0) { + Spacer() + .frame(height: 8) + Rectangle() + .foregroundColor(.gray03) + .frame(width: 90, height: 6) + .cornerRadius(50) + Spacer() + .frame(height: 32) + // CategoryListView() + WrappingHStack(CategoryType.allCases, id:\.self) { category in + Button( + action: { + self.category = category.description + isCategoryTapped.toggle() + }, + label: { + Text(category.description) + .font(.b2) + .foregroundColor(.gray07) + .padding(.horizontal, 12) + .padding(.vertical, 6) + .background(Color.gray01) + .cornerRadius(8) + } + ) + .padding(.bottom, 8) + } + .padding(.leading, 19) + Spacer() + } + } + .frame(height: 210) + .roundedCorner(30, corners: [.topLeft, .topRight]) + } +} + +// MARK: - 카테고리 뷰 +//private struct CategoryView: View { +// +// fileprivate var body: some View { +// ZStack { +// Color.white +// VStack(spacing: 0) { +// Spacer() +// .frame(height: 8) +// Rectangle() +// .foregroundColor(.gray03) +// .frame(width: 90, height: 6) +// .cornerRadius(50) +// Spacer() +// .frame(height: 32) +//// CategoryListView() +// WrappingHStack(CategoryType.allCases, id:\.self) { category in +// Button( +// action: { +// +// }, +// label: { +// Text(category.description) +// .font(.b2) +// .foregroundColor(.gray07) +// .padding(.horizontal, 12) +// .padding(.vertical, 6) +// .background(Color.gray01) +// .cornerRadius(8) +// } +// ) +// .padding(.bottom, 8) +// } +// .padding(.leading, 19) +// Spacer() +// } +// } +// .frame(height: 210) +// .roundedCorner(30, corners: [.topLeft, .topRight]) +// } +//} + +// MARK: - 카테고리 셀 뷰 + +//fileprivate struct CategoryListView: View { +// +// fileprivate var body: some View { +// WrappingHStack(CategoryType.allCases, id:\.self) { category in +// Button( +// action: { +// +// }, +// label: { +// Text(category.description) +// .font(.b2) +// .foregroundColor(.gray07) +// .padding(.horizontal, 12) +// .padding(.vertical, 6) +// .background(Color.gray01) +// .cornerRadius(8) +// } +// ) +// .padding(.bottom, 8) +// } +// .padding(.leading, 19) +// } +//} + + +struct CategoryModalView2_Previews: PreviewProvider { + static var previews: some View { + + CategoryModalView2() + .previewLayout(.sizeThatFits) + } +} + +// MARK: - 부분 Radius 설정 + +struct RoundedCorner: Shape { + var radius: CGFloat = .infinity + var corners: UIRectCorner = .allCorners + + func path(in rect: CGRect) -> Path { + let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) + return Path(path.cgPath) + } +} + +extension View { + func roundedCorner(_ radius: CGFloat, corners: UIRectCorner) -> some View { + clipShape(RoundedCorner(radius: radius, corners: corners) ) + } +} diff --git a/DittoCommunity/DittoCommunity/View/CustomModal/CategoryType.swift b/DittoCommunity/DittoCommunity/View/CustomModal/CategoryType.swift new file mode 100644 index 0000000..f155e93 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/CustomModal/CategoryType.swift @@ -0,0 +1,27 @@ +// +// CategoryType.swift +// DittoCommunity +// +// Created by Subeen on 2023/11/25. +// + +import Foundation + +enum CategoryType: String, CaseIterable, Identifiable, CustomStringConvertible { + + var id : String { UUID().uuidString } + + case relationship = "인간관계" + case love = "연애" + case family = "가족" + case company = "회사" + case employ = "취업/이직" + case health = "건강" + case develop = "자기계발" + case pet = "반려동물" + case etc = "기타" + + var description: String { + return self.rawValue + } +} diff --git a/DittoCommunity/DittoCommunity/View/CustomModal/CustomAlertView.swift b/DittoCommunity/DittoCommunity/View/CustomModal/CustomAlertView.swift new file mode 100644 index 0000000..9b2dc6e --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/CustomModal/CustomAlertView.swift @@ -0,0 +1,106 @@ +// +// FinishEditAlertView.swift +// DittoCommunity +// +// Created by Subeen on 2023/11/25. +// + +import SwiftUI + +struct CustomAlertView: View { +// let isLeftBtn: Bool +// let isRightBtn: Bool + + let alertTitle: String + let alertSubTitle: String + + let leftBtnTitle: String + let rightBtnTitle: String + + let leftBtnAction: () -> Void + let rightBtnAction: () -> Void + + + init( +// isLeftBtn: Bool = false, +// isRightBtn: Bool = false, + alertTitle: String = "작성 중인 글은 저장되지 않습니다.", + alertSubTitle: String = "작성을 그만두시겠어요?", + leftBtnTitle: String = "이어서 쓰기", + rightBtnTitle: String = "작성 그만두기", + leftBtnAction: @escaping () -> Void = {}, + rightBtnAction: @escaping () -> Void = {} + ) { +// self.isLeftBtn = isLeftBtn +// self.isRightBtn = isRightBtn + self.alertTitle = alertTitle + self.alertSubTitle = alertSubTitle + self.leftBtnTitle = leftBtnTitle + self.rightBtnTitle = rightBtnTitle + self.leftBtnAction = leftBtnAction + self.rightBtnAction = rightBtnAction + } + + var body: some View { + ZStack { + Color.black.opacity(0.5).ignoresSafeArea(.all) + + RoundedRectangle(cornerRadius: 16) + .overlay { + VStack(spacing: 0) { + Spacer() + Text(alertTitle) + .foregroundColor(.black) + Text(alertSubTitle) + .foregroundColor(.gray05) + Spacer() + Rectangle() + .frame(height: 1) + .foregroundColor(.gray03) + + HStack(spacing: 0) { + Button( + action: { + + }, + label: { + Text(leftBtnTitle) + .foregroundColor(.gray05) + .frame(maxWidth: .infinity, maxHeight: .infinity) + } + ) + + Rectangle() + .frame(width: 1, height: 56) + .foregroundColor(.gray03) + + Button( + action: { + + }, + label: { + Text(rightBtnTitle) + .foregroundColor(.black) + .frame(maxWidth: .infinity, maxHeight: .infinity) + + } + ) + } + .frame(height: 56) + + } + + } + .frame(width: 294, height: 168) + .foregroundColor(.white) + + } + } +} + +struct CustomAlertView_Previews: PreviewProvider { + static var previews: some View { + CustomAlertView() + .previewLayout(.sizeThatFits) + } +} diff --git a/DittoCommunity/DittoCommunity/View/CustomModal/TestCompleteModalView.swift b/DittoCommunity/DittoCommunity/View/CustomModal/TestCompleteModalView.swift new file mode 100644 index 0000000..77bcfd8 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/CustomModal/TestCompleteModalView.swift @@ -0,0 +1,94 @@ +// +// TestCompleteModalView.swift +// DittoCommunity +// +// Created by Subeen on 2023/11/25. +// + +import SwiftUI + +struct TestCompleteModalView: View { + var body: some View { + ZStack { + Color.black.opacity(0.5).ignoresSafeArea(.all) + + ModalView() + + } + } +} + +private struct ModalView: View { + + private var name: String = "너디너리" + + fileprivate var body: some View { + ZStack { + Color.white + + VStack(spacing: 73) { + Text("공감 테스트 완료") + + Text("\(name)님의\n의 공감지수") + + CircularProgressView(progress: 68) + + Button( + action: { + + }, + label: { + RoundedRectangle(cornerRadius: 100) + .overlay { + Text("공감지수 올리러 가기") + .foregroundColor(.white) + } + .frame(width: 206, height: 41) + } + ) + } + } + .frame(width: 347, height: 554) + .cornerRadius(20) + } + +} + +private struct CircularProgressView: View { + + let progress: Int // 공감지수 + + var body: some View { + ZStack { + Circle() + .stroke( + Color.pink.opacity(0.5), + lineWidth: 12 + ) + Circle() + // 2 + .trim(from: 0, to: CGFloat(progress)/100) + .stroke( + Color.pink, + style: StrokeStyle( + lineWidth: 12, + lineCap: .round + ) + ) + .rotationEffect(.degrees(-90)) + + VStack { + Text("공감지수") + Text("\(progress)%") + } + } + .frame(width: 100, height: 100) + } +} + + +struct TestCompleteModalView_Previews: PreviewProvider { + static var previews: some View { + TestCompleteModalView() + } +} diff --git a/DittoCommunity/DittoCommunity/View/Feed/Feed.swift b/DittoCommunity/DittoCommunity/View/Feed/Feed.swift new file mode 100644 index 0000000..ecc1599 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/Feed/Feed.swift @@ -0,0 +1,15 @@ +// +// Feed.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import Foundation + +struct Feed: Hashable { + var title: String + var category: String + var content: String + var id = UUID() +} diff --git a/DittoCommunity/DittoCommunity/View/Feed/FeedView.swift b/DittoCommunity/DittoCommunity/View/Feed/FeedView.swift new file mode 100644 index 0000000..5c45041 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/Feed/FeedView.swift @@ -0,0 +1,178 @@ +// +// FeedView.swift +// DittoCommunity +// +// Created by Subeen on 2023/11/25. +// + +import SwiftUI + +struct FeedView: View { + @StateObject var feedViewModel: FeedViewModel + @State var isCategoryTapped: Bool = false + @State var isCancel: Bool = false + @State var category = "" + + var body: some View { + + VStack { + CustomNavigationBar( + title: "글 작성", + isDisplayLeadingBtn: true, + isDisplayTrailingBtn: true, + leadingItems: [(Icon.cancel, { + // 게시물 등록 취소 +// isCancel.toggle() + })], + trailingItems: [(Icon.complete, { + // TODO: - 게시물 등록 + })] + ) + + // 피드 타이틀 인풋 뷰 + FeedTitleInputView(feedViewModel: feedViewModel) + + + Rectangle() + .stroke(Color.gray03) + .frame(height: 60) + .overlay { + Button( + action: { + isCategoryTapped.toggle() + }, + label: { + HStack { + Text(category == "" ? "공감을 원하는 글 카테고리를 선택하세요" : category) + .foregroundColor(category == "" ? .gray07 : .orange) + .font(.b1) + .frame(maxHeight: .infinity) + Spacer() + Icon.arrowRight.image + } + .padding(.horizontal, 20) + } + ) + } + + + + // 피트 콘텐츠 인풋 뷰 + FeedContentInputView(feedViewModel: feedViewModel) + } + .popup(isPresented: $isCategoryTapped) { + CategoryModalView2(isCategoryTapped: $isCategoryTapped, category: $category) + } customize: { + $0 + .type(.toast) + .position(.bottom) + .animation(.spring()) + .closeOnTapOutside(true) + .backgroundColor(.black.opacity(0.5)) + .dragToDismiss(true) + } + .overlay { + + if isCancel { + CustomAlertView( + alertTitle: "작성 중인 글은 저장되지 않습니다.", + alertSubTitle: "작성을 그만두시겠어요?", + leftBtnTitle: "이어서 쓰기", + rightBtnTitle: "작성 그만두기", + leftBtnAction: {}, + rightBtnAction: {} + ) + } + } + } +} + +// MARK: - 피드 타이틀 인풋 뷰 +fileprivate struct FeedTitleInputView: View { + @ObservedObject private var feedViewModel: FeedViewModel + + fileprivate init(feedViewModel: FeedViewModel) { + self.feedViewModel = feedViewModel + } + + fileprivate var body: some View { + TextField( + "제목을 입력하세요.", + text: $feedViewModel.feed.title + ) + .font(.h2) + .padding(.horizontal, 20) + } +} + +// MARK: - 카테고리 선택 뷰 +//struct CategorySelectView: View { +// +// @Binding var isCategoryTapped: Bool +// +// var body: some View { +// Rectangle() +// .stroke(Color.gray03) +// .frame(height: 60) +// .overlay { +// Button( +// action: { +// isCategoryTapped.toggle() +// }, +// label: { +// HStack { +// Text(category == "" ? "공감을 원하는 글 카테고리를 선택하세요" : category) +// .foregroundColor(.gray07) +// .font(.b1) +// .frame(maxHeight: .infinity) +// Spacer() +// Icon.arrowRight.image +// } +// .padding(.horizontal, 20) +// } +// ) +// } +// } +//} + +// MARK: - 피드 콘텐츠 인풋 뷰 +private struct FeedContentInputView: View { + @ObservedObject private var feedViewModel: FeedViewModel // ObservedObject로 주입 받기 + + fileprivate init(feedViewModel: FeedViewModel) { + self.feedViewModel = feedViewModel + } + + fileprivate var body: some View { + ZStack(alignment: .topLeading) { + TextEditor(text: $feedViewModel.feed.content) + .font(.b1) + + if feedViewModel.feed.content.isEmpty { + Text("내용을 입력해주세요") + .font(.b1) + .foregroundColor(.gray04) + .allowsHitTesting(false) // 터치가 먹지 않게 함. Text가 아닌 위의 TextEditor에 터치가 먹도록 함. + .padding(.top, 10) + .padding(.leading, 5) + } + } + .padding(.horizontal, 20) + } +} + + +struct FeedView_Previews: PreviewProvider { + static var previews: some View { + FeedView( + feedViewModel: .init( + feed: .init( + title: "", + category: "", + content: "" + ) + ) + ) + .previewLayout(.sizeThatFits) + } +} diff --git a/DittoCommunity/DittoCommunity/View/Feed/FeedViewModel.swift b/DittoCommunity/DittoCommunity/View/Feed/FeedViewModel.swift new file mode 100644 index 0000000..4c31cc4 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/Feed/FeedViewModel.swift @@ -0,0 +1,16 @@ +// +// FeedViewModel.swift +// DittoCommunity +// +// Created by Subeen on 2023/11/25. +// + +import Foundation + +class FeedViewModel: ObservableObject { + @Published var feed: Feed + + init(feed: Feed) { + self.feed = feed + } +} diff --git a/DittoCommunity/DittoCommunity/View/Login/LoginView.swift b/DittoCommunity/DittoCommunity/View/Login/LoginView.swift new file mode 100644 index 0000000..c0c645e --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/Login/LoginView.swift @@ -0,0 +1,137 @@ +// +// LoginView.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import SwiftUI + +struct LoginView: View { + + @StateObject var viewModel = LoginViewModel() + + var body: some View { + if viewModel.hasDoneTest { + TestFinishView() + } else { + NavigationView { + VStack { + Spacer() + loginButtonList + .padding(.bottom, 16) + bottomButton + } + .padding(.bottom, 101) + .edgesIgnoringSafeArea(.bottom) + .padding(.horizontal, 20) + } + } + } + + @ViewBuilder var loginButtonList: some View { + VStack(spacing: 8) { + ForEach(LoginMethod.allCases, id: \.self) { method in + NavigationLink { + SympathyTestView(pageIndex: 0) + .environmentObject(viewModel) + } label: { + loginButtonCell(method) + } + } + } + } + + @ViewBuilder func loginButtonCell(_ method: LoginMethod) -> some View { + HStack(spacing: 8) { + method.icon + Text(method.buttonTitle) + .foregroundColor(method.textColor) + .font(.b2) + } + .frame(height: 48) + .frame(maxWidth: .infinity) + .background(method.backgroundColor) + .overlay { + if let borderColor = method.borderColor { + RoundedRectangle(cornerRadius: 5) + .stroke(borderColor, lineWidth:1) + } + } + .cornerRadius(5) + } + + @ViewBuilder var bottomButton: some View { + HStack(spacing: 36) { + Text("이메일로 로그인") + Text("이메일로 회원가입") + } + .font(.b2) + .foregroundColor(.gray05) + .frame(height: 22) + } +} + +//#Preview { +// LoginView() +//} + +enum LoginMethod: CaseIterable { + + case kakao, naver, google + + var textColor: Color { + switch self { + case .kakao: + return Color(hex: "381E1F") + case .naver: + return .white + case .google: + return .gray07 + } + } + + var backgroundColor: Color { + switch self { + case .kakao: + return Color(hex: "F9E001") + case .naver: + return Color(hex: "2EC623") + case .google: + return .white + } + } + + var borderColor: Color? { + switch self { + case .kakao: + return .none + case .naver: + return .none + case .google: + return .gray03 + } + } + + var icon: Image { + switch self { + case .kakao: + return Icon.kakao.image + case .naver: + return Icon.naver.image + case .google: + return Icon.google.image + } + } + + var buttonTitle: String { + switch self { + case .kakao: + return "카카오로 로그인" + case .naver: + return "네이버로 로그인" + case .google: + return "구글로 로그인" + } + } +} diff --git a/DittoCommunity/DittoCommunity/View/Login/LoginViewModel.swift b/DittoCommunity/DittoCommunity/View/Login/LoginViewModel.swift new file mode 100644 index 0000000..20577ba --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/Login/LoginViewModel.swift @@ -0,0 +1,43 @@ +// +// SympathyTestViewModel.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import Foundation + +class LoginViewModel: ObservableObject { + + @Published var hasDoneTest = false + @Published var questions: [Question] = [ + .init(question: "나 오늘 택배 뜯다가\n칼에 손 베였어ㅠㅠ", options: [ + .init(text: "괜찮아? 어떡해 ㅠㅠ 아팠겠다. 병원은 갔어? ", score: 25), + .init(text: "뭔 택배? 얼마나 다쳤는데? ", score: 0) + ]), + .init(question: "너 오늘 힘들어 보이길래\n이거 보낸다 ㅠㅠ 힘내!", options: [ + .init(text: "헉..감동이야..잘먹을게! (진짜 감동)", score: 25), + .init(text: "고마워 잘 먹을게! (내가 힘들어보였나?) ", score: 0) + ]), + .init(question: "하..나 오늘 헤어졌어..\n위로 좀 해줘" , options: [ + .init(text: "괜찮아? 너무 힘들겠다 기다려봐 내가 전화할게! ", score: 25), + .init(text: "왜 헤어졌어?", score: 0) + ]), + .init(question: "헐 야 나 늦을 거 같아ㅠ\n퇴근시간이라 차가 막히네..", options: [ + .init(text: "음 알겠어 기다리고 있을게! (근데 사과는?) ", score: 25), + .init(text: "음 알겠어 기다리고 있을게! (이유가 타당하군) ", score: 0) + ]) + ] +} + +struct Question { + + var question: String + var options: [Option] + + struct Option { + var text: String + var isSelected: Bool = false + var score: Int + } +} diff --git a/DittoCommunity/DittoCommunity/View/Login/SympathyTestView.swift b/DittoCommunity/DittoCommunity/View/Login/SympathyTestView.swift new file mode 100644 index 0000000..1bc6a3f --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/Login/SympathyTestView.swift @@ -0,0 +1,180 @@ +// +// SympathyTestView.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import SwiftUI + +struct SympathyTestView: View { + + @Environment(\.dismiss) private var dismiss + @EnvironmentObject var viewModel: LoginViewModel + @EnvironmentObject var appState: AppState + + @State var navigateToNext = false + let pageIndex: Int + + var body: some View { + VStack(spacing: 0) { + topBar + .padding(.bottom, 36) + + // Indicator + VStack(spacing: 0) { + title + .padding(.bottom, 44) + Color.gray + .frame(maxWidth: .infinity) + .frame(height: 240) + .padding(.bottom, 36) + cellList + Spacer() + nextButton + }.padding(.horizontal, 20) + } + .navigationBarHidden(true) + .navigationBarBackButtonHidden(true) + } + + @ViewBuilder var topBar: some View { + VStack(spacing: 0) { +// HStack { +// Icon.chevronLeft.image.onTapGesture { dismiss() } +// Spacer() +// Text("건너뛰기") +// .font(.b2) +// .foregroundColor(.gray05) +// .onTapGesture { +// // TODO: - 네트워크 통신으로 로그인하기 +// appState.hasLogin = true +// } +// } + CustomNavigationBar( + isDisplayLeadingBtn: true, + isDisplayTrailingBtn: true, + leadingItems: [(.chevronLeft, { dismiss() })], + trailingItems: [(.skip, { + // TODO: - 네트워크 통신으로 로그인하기 + appState.hasLogin = true + + })] + ) +// .padding(.trailing, 10) +// .frame(height: 44) +// .padding(.horizontal, 20) + pageIndicator + } + } + + + @ViewBuilder var pageIndicator: some View { + HStack(spacing: 0) { + Color.gray07.frame(width: (CGFloat(UIScreen.screenWidth) / 4) * CGFloat(pageIndex + 1)) + Color.gray03.frame(maxWidth: .infinity) + }.frame(height: 4) + } + + @ViewBuilder var title: some View { + HStack { + Text(viewModel.questions[pageIndex].question) + .font(.h1) + .foregroundColor(.gray07) + .lineLimit(2) + Spacer() + }.frame(height: 68) + } + + @ViewBuilder var cellList: some View { + VStack(spacing: 8) { + ForEach(0..<2) { index in + cell(index: index) + } + } + } + + @ViewBuilder func cell(index: Int) -> some View { + + let isSelected = viewModel.questions[pageIndex].options[index].isSelected + + HStack { + Text(viewModel.questions[pageIndex].options[index].text) + Spacer() + } + .font(.b1) + .foregroundColor(.gray07) + .padding(.horizontal, 16) + .frame(height: 78) + .frame(maxWidth: .infinity) + .background(Color.white) + .overlay( + RoundedRectangle(cornerRadius: 8) + .stroke( + isSelected ? Color.primary02 : Color.gray03, + lineWidth: isSelected ? 2 : 1 + ) + ) + .onTapGesture { + + let elseButtonIndex = index == 0 ? 1 : 0 + + if isSelected { + viewModel.questions[pageIndex].options[index].isSelected.toggle() + } else if !isSelected, viewModel.questions[pageIndex].options[elseButtonIndex].isSelected == true { + viewModel.questions[pageIndex].options[0].isSelected.toggle() + viewModel.questions[pageIndex].options[1].isSelected.toggle() + } else if !isSelected { + viewModel.questions[pageIndex].options[index].isSelected.toggle() + } + } + } + + @ViewBuilder var nextButton: some View { + + let hasSelected = !viewModel.questions[pageIndex].options.filter { $0.isSelected }.isEmpty + + NavigationLink(isActive: $navigateToNext) { + SympathyTestView(pageIndex: pageIndex + 1) + .environmentObject(viewModel) + } label: { + EmptyView() + } + + Button(action: { + if 3 > pageIndex, hasSelected { + navigateToNext = true + } else if pageIndex == 3, hasSelected { + withAnimation { + viewModel.hasDoneTest = true + } + } + }, label: { + Text("다음") + .font(.t1) + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 58) + .background( + hasSelected ? Color.primary02 : Color.gray02 + ) + .cornerRadius(16) + }) + } + + @ViewBuilder var skipButton: some View { + Color.gray.cornerRadius(15) + .frame(height: 56) + .overlay { + Text("테스트 건너뛰기") + .font(.h2) + .foregroundColor(.white) + } + } +} + +//struct SympathyTestView_Previews: PreviewProvider { +// static var previews: some View { +// SympathyTestView(pageIndex: 0) +// } +//} diff --git a/DittoCommunity/DittoCommunity/View/Login/TestFinishView.swift b/DittoCommunity/DittoCommunity/View/Login/TestFinishView.swift new file mode 100644 index 0000000..9c8b7e7 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/Login/TestFinishView.swift @@ -0,0 +1,46 @@ +// +// TestFinishView.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import SwiftUI + +struct TestFinishView: View { + + @EnvironmentObject var appState: AppState + + var body: some View { + VStack(spacing: 8) { + Spacer() + Text("공감 테스트 완료") + .font(.h2) + .foregroundColor(.gray07) + Text("열심히 활동하면 공감지수를 올릴 수 있어요") + .font(.b2) + .foregroundColor(.gray05) + Spacer() + bottomButton + }.padding(.horizontal, 20) + } + + @ViewBuilder var bottomButton: some View { + Button(action: { + // TODO: - 네트워크로 로그인 하기 + appState.hasLogin = true + }, label: { + Text("공감하러 가기") + .font(.t1) + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 58) + .background(Color.primary02) + .cornerRadius(16) + }) + } +} + +#Preview { + TestFinishView() +} diff --git a/DittoCommunity/DittoCommunity/View/MainTab/MainTabView.swift b/DittoCommunity/DittoCommunity/View/MainTab/MainTabView.swift new file mode 100644 index 0000000..6835fe1 --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/MainTab/MainTabView.swift @@ -0,0 +1,67 @@ +// +// MainTabView.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import SwiftUI + +struct MainTabView: View { + + @State var tabTag = 1 + @State var showFeedPostView = false + + var body: some View { + VStack { + TabView(selection: $tabTag) { + Text("Feed") + .tag(1) + Text("Profile") + .tag(2) + } + .frame(maxHeight: .infinity) + bottomTabBar + } + .edgesIgnoringSafeArea(.bottom) + .frame(maxHeight: .infinity) + .sheet(isPresented: $showFeedPostView, content: { + Text("Feed Post") + }) + } + + @ViewBuilder var bottomTabBar: some View { + LazyVGrid(columns: Array(repeating: .init(), count: 3), content: { + Label( + title: { Text("Feed") }, + icon: { Image(systemName: "list.bullet") } + ).onTapGesture { + self.tabTag = 1 + } + Image(systemName: "plus.circle") + .onTapGesture { + showFeedPostView = true + } + Label( + title: { Text("Profile") }, + icon: { Image(systemName: "person") } + ).onTapGesture { + self.tabTag = 2 + } + }) + .padding(.bottom, 50) + .padding(.top, 20) + .background(Color.gray.opacity(0.1)) + } +} + +struct MainTabView_Previews: PreviewProvider { + static var previews: some View { + MainTabView() + } +} + +enum MainTabItem: Int { + case feedList = 1 + case profile = 2 +} diff --git a/DittoCommunity/DittoCommunity/View/Profile/Profile.swift b/DittoCommunity/DittoCommunity/View/Profile/Profile.swift new file mode 100644 index 0000000..ea6942c --- /dev/null +++ b/DittoCommunity/DittoCommunity/View/Profile/Profile.swift @@ -0,0 +1,8 @@ +// +// Profile.swift +// DittoCommunity +// +// Created by 김인섭 on 11/25/23. +// + +import Foundation