diff --git a/Pods/Pods.xcodeproj/xcuserdata/hakyung.xcuserdatad/xcschemes/xcschememanagement.plist b/Pods/Pods.xcodeproj/xcuserdata/hakyung.xcuserdatad/xcschemes/xcschememanagement.plist index 556f49b..0ea8545 100644 --- a/Pods/Pods.xcodeproj/xcuserdata/hakyung.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Pods/Pods.xcodeproj/xcuserdata/hakyung.xcuserdatad/xcschemes/xcschememanagement.plist @@ -88,6 +88,42 @@ orderHint 11 + KakaoSDKAuth.xcscheme + + isShown + + orderHint + 26 + + KakaoSDKAuth.xcscheme_^#shared#^_ + + orderHint + 26 + + KakaoSDKCommon.xcscheme + + isShown + + orderHint + 27 + + KakaoSDKCommon.xcscheme_^#shared#^_ + + orderHint + 27 + + KakaoSDKUser.xcscheme + + isShown + + orderHint + 28 + + KakaoSDKUser.xcscheme_^#shared#^_ + + orderHint + 28 + Kingfisher.xcscheme isShown diff --git a/README.md b/README.md index b45a0c3..4f78f18 100644 --- a/README.md +++ b/README.md @@ -1 +1,17 @@ -# Thirty-iOS \ No newline at end of file +1811054_pc_header + +
+ +
30일 챌린지 기록하기
+ +
+ + Download on the App Store + +
+
+1811054_pc_detail_1 + +1811054_pc_detail_11 + +1811054_pc_detail_4 diff --git a/Thirty.xcodeproj/project.pbxproj b/Thirty.xcodeproj/project.pbxproj index c59c02c..2a1c370 100644 --- a/Thirty.xcodeproj/project.pbxproj +++ b/Thirty.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 753B078D286BC82200B62F35 /* CommunityAllVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753B078C286BC82200B62F35 /* CommunityAllVC.swift */; }; 753B078F286BC84500B62F35 /* FindFriendVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753B078E286BC84500B62F35 /* FindFriendVC.swift */; }; 753EB1DB27EB65A300D20579 /* MyInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753EB1DA27EB65A300D20579 /* MyInfoVC.swift */; }; + 7549DEB62993C4C7004045EA /* UILabel+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7549DEB52993C4C7004045EA /* UILabel+Extension.swift */; }; 7562CB35287656960004EC99 /* CreateChallengeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7562CB34287656960004EC99 /* CreateChallengeVC.swift */; }; 75771D3D292C506D00706881 /* MyFriendManageVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75771D3C292C506D00706881 /* MyFriendManageVC.swift */; }; 75771D3F292C51B100706881 /* MyFriendManageReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75771D3E292C51B100706881 /* MyFriendManageReactor.swift */; }; @@ -109,10 +110,11 @@ F98C9AE628C4C225003A25CD /* ExploreVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F98C9AE528C4C225003A25CD /* ExploreVC.swift */; }; F98C9AE828C4CC66003A25CD /* BucketAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F98C9AE728C4CC66003A25CD /* BucketAPI.swift */; }; F98C9AEA28C4CEC9003A25CD /* Token.swift in Sources */ = {isa = PBXBuildFile; fileRef = F98C9AE928C4CEC9003A25CD /* Token.swift */; }; + F99B69E4298627A8001F6003 /* SelectChallengeThemeNewVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F99B69E3298627A8001F6003 /* SelectChallengeThemeNewVC.swift */; }; + F99B69E629863CB5001F6003 /* SelectChallengeThemeNewReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F99B69E529863CB5001F6003 /* SelectChallengeThemeNewReactor.swift */; }; F99C6FD128F3195B00F5F1DD /* CommunityAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F99C6FD028F3195B00F5F1DD /* CommunityAPI.swift */; }; F9A65627288D02B300544D83 /* CommunityListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A65626288D02B300544D83 /* CommunityListCell.swift */; }; F9A65629288D07AB00544D83 /* Community.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A65628288D07AB00544D83 /* Community.swift */; }; - F9A6562B288D08CF00544D83 /* CommunityListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A6562A288D08CF00544D83 /* CommunityListViewModel.swift */; }; F9B0D46527EF654A0092F2B8 /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9B0D46427EF654A0092F2B8 /* TabBarController.swift */; }; F9B0D46827EF67210092F2B8 /* CommunityNC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9B0D46727EF67210092F2B8 /* CommunityNC.swift */; }; F9B4859427FC8926003A129B /* Challenge.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9B4859327FC8926003A129B /* Challenge.swift */; }; @@ -160,6 +162,7 @@ 753B078C286BC82200B62F35 /* CommunityAllVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityAllVC.swift; sourceTree = ""; }; 753B078E286BC84500B62F35 /* FindFriendVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FindFriendVC.swift; sourceTree = ""; }; 753EB1DA27EB65A300D20579 /* MyInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyInfoVC.swift; sourceTree = ""; }; + 7549DEB52993C4C7004045EA /* UILabel+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+Extension.swift"; sourceTree = ""; }; 7562CB34287656960004EC99 /* CreateChallengeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateChallengeVC.swift; sourceTree = ""; }; 75771D3C292C506D00706881 /* MyFriendManageVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFriendManageVC.swift; sourceTree = ""; }; 75771D3E292C51B100706881 /* MyFriendManageReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFriendManageReactor.swift; sourceTree = ""; }; @@ -243,10 +246,11 @@ F98C9AE528C4C225003A25CD /* ExploreVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExploreVC.swift; sourceTree = ""; }; F98C9AE728C4CC66003A25CD /* BucketAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BucketAPI.swift; sourceTree = ""; }; F98C9AE928C4CEC9003A25CD /* Token.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Token.swift; sourceTree = ""; }; + F99B69E3298627A8001F6003 /* SelectChallengeThemeNewVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectChallengeThemeNewVC.swift; sourceTree = ""; }; + F99B69E529863CB5001F6003 /* SelectChallengeThemeNewReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectChallengeThemeNewReactor.swift; sourceTree = ""; }; F99C6FD028F3195B00F5F1DD /* CommunityAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityAPI.swift; sourceTree = ""; }; F9A65626288D02B300544D83 /* CommunityListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityListCell.swift; sourceTree = ""; }; F9A65628288D07AB00544D83 /* Community.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Community.swift; sourceTree = ""; }; - F9A6562A288D08CF00544D83 /* CommunityListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityListViewModel.swift; sourceTree = ""; }; F9B0D46427EF654A0092F2B8 /* TabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarController.swift; sourceTree = ""; }; F9B0D46727EF67210092F2B8 /* CommunityNC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityNC.swift; sourceTree = ""; }; F9B4859327FC8926003A129B /* Challenge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Challenge.swift; sourceTree = ""; }; @@ -318,6 +322,8 @@ isa = PBXGroup; children = ( 757D45AF28DBD837004DBC5A /* SplashVC.swift */, + F99B69E3298627A8001F6003 /* SelectChallengeThemeNewVC.swift */, + F99B69E529863CB5001F6003 /* SelectChallengeThemeNewReactor.swift */, 757D66C82874FEDF00E3C5DE /* SelectChallengeThemeVC.swift */, 757D66CA2874FEFB00E3C5DE /* SelectChallengeVC.swift */, F9C6504828B9F49D0026405A /* SelectChallengeReactor.swift */, @@ -419,7 +425,6 @@ isa = PBXGroup; children = ( 759D328227C8933700A88C02 /* Community.storyboard */, - F9A6562A288D08CF00544D83 /* CommunityListViewModel.swift */, F9BF9EDF28F3AB6900F95CE5 /* CommunityReactor.swift */, 753B078C286BC82200B62F35 /* CommunityAllVC.swift */, 753B078A286BC80200B62F35 /* CommunityFriendVC.swift */, @@ -509,6 +514,7 @@ 75A7741A28DD2C5000B7775C /* Date+Extension.swift */, 75A7741C28DD2D0600B7775C /* UIImageView+Extension.swift */, 758B0F082900C47800FEDBEF /* UICollectionView+Extension.swift */, + 7549DEB52993C4C7004045EA /* UILabel+Extension.swift */, ); path = Extension; sourceTree = ""; @@ -736,16 +742,19 @@ F9BC339D27EC9FB600F0C722 /* MyAlertVC.swift in Sources */, 757D66CD2875048900E3C5DE /* WelcomeVC.swift in Sources */, 7504D90B28F70EF30033A27F /* Announcement.swift in Sources */, + F99B69E629863CB5001F6003 /* SelectChallengeThemeNewReactor.swift in Sources */, F9E01FC128CE1A7D00649EC7 /* WelcomePopupVC.swift in Sources */, 75C586C827E307D50022B5D8 /* ExploreListVC.swift in Sources */, F9BC33A327EC9FFD00F0C722 /* MyNoticeVC.swift in Sources */, F9BC33A027EC9FD700F0C722 /* MyShareSettingVC.swift in Sources */, 7562CB35287656960004EC99 /* CreateChallengeVC.swift in Sources */, + 7549DEB62993C4C7004045EA /* UILabel+Extension.swift in Sources */, F96EBBBC28D5B59800FECD00 /* TokenManager.swift in Sources */, 75A7741B28DD2C5000B7775C /* Date+Extension.swift in Sources */, 757C96822863E169005CCBA3 /* ChallengeExportVC.swift in Sources */, 759D328B27C8A45000A88C02 /* ChallengeVC.swift in Sources */, 751A19F427E8A8890025812D /* UIColor+Extension.swift in Sources */, + F99B69E4298627A8001F6003 /* SelectChallengeThemeNewVC.swift in Sources */, 75B6B3C128EEF2E10081AA36 /* ChallengeExportReactor.swift in Sources */, 75073B1C280F8080008814EE /* ChallengeAPI.swift in Sources */, F98C9AEA28C4CEC9003A25CD /* Token.swift in Sources */, @@ -760,7 +769,6 @@ F94CCC2A28F46B01002B05F5 /* LoginReactor.swift in Sources */, 7537C2732953D2700031C4FE /* CompleteChallengeDetailReactor.swift in Sources */, 7501A4FC27E239B500EB4EB0 /* MyNC.swift in Sources */, - F9A6562B288D08CF00544D83 /* CommunityListViewModel.swift in Sources */, F960391A2915F7E100F296DA /* WelcomeSignUpReactor.swift in Sources */, F96EBBC228D5BDE000FECD00 /* MyBadgeReactor.swift in Sources */, 757C96782863E080005CCBA3 /* ChallengeDetailImageVC.swift in Sources */, @@ -976,8 +984,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Thirty/Thirty.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 2YT3299DFQ; INFOPLIST_FILE = Thirty/Info.plist; @@ -986,10 +994,10 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.8; + MARKETING_VERSION = 1.0.9; PRODUCT_BUNDLE_IDENTIFIER = com.sookmyung.thirty; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Thirty Distribution"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; @@ -1002,8 +1010,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Thirty/Thirty.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 2YT3299DFQ; INFOPLIST_FILE = Thirty/Info.plist; @@ -1012,10 +1020,10 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.8; + MARKETING_VERSION = 1.0.9; PRODUCT_BUNDLE_IDENTIFIER = com.sookmyung.thirty; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Thirty Distribution"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; diff --git a/Thirty.xcodeproj/xcuserdata/hakyung.xcuserdatad/xcschemes/xcschememanagement.plist b/Thirty.xcodeproj/xcuserdata/hakyung.xcuserdatad/xcschemes/xcschememanagement.plist index 3cf5b70..12afd4c 100644 --- a/Thirty.xcodeproj/xcuserdata/hakyung.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Thirty.xcodeproj/xcuserdata/hakyung.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ Thirty.xcscheme_^#shared#^_ orderHint - 26 + 29
diff --git a/Thirty.xcworkspace/xcuserdata/hakyung.xcuserdatad/UserInterfaceState.xcuserstate b/Thirty.xcworkspace/xcuserdata/hakyung.xcuserdatad/UserInterfaceState.xcuserstate index b86382f..cc691e8 100644 Binary files a/Thirty.xcworkspace/xcuserdata/hakyung.xcuserdatad/UserInterfaceState.xcuserstate and b/Thirty.xcworkspace/xcuserdata/hakyung.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Thirty.xcworkspace/xcuserdata/mobile.xcuserdatad/UserInterfaceState.xcuserstate b/Thirty.xcworkspace/xcuserdata/mobile.xcuserdatad/UserInterfaceState.xcuserstate index 0028537..fa3a562 100644 Binary files a/Thirty.xcworkspace/xcuserdata/mobile.xcuserdatad/UserInterfaceState.xcuserstate and b/Thirty.xcworkspace/xcuserdata/mobile.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/Contents.json b/Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/Contents.json similarity index 71% rename from Thirty/App/Asset/Assets.xcassets/samplecat.imageset/Contents.json rename to Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/Contents.json index dc194a4..10fefdd 100644 --- a/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/Contents.json +++ b/Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/Contents.json @@ -1,17 +1,16 @@ { "images" : [ { - "filename" : "IMG_1992.JPG", + "filename" : "minus.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "IMG_1992-1.JPG", + "filename" : "minus@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "IMG_1992-2.JPG", "idiom" : "universal", "scale" : "3x" } diff --git a/Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/minus.png b/Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/minus.png new file mode 100644 index 0000000..6f4c66f Binary files /dev/null and b/Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/minus.png differ diff --git a/Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/minus@2x.png b/Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/minus@2x.png new file mode 100644 index 0000000..ce69e04 Binary files /dev/null and b/Thirty/App/Asset/Assets.xcassets/App/Common/icon_image_x_black.imageset/minus@2x.png differ diff --git a/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Contents.json b/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Contents.json new file mode 100644 index 0000000..001ba33 --- /dev/null +++ b/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "Union-1.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Union@2x-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Union-1.png b/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Union-1.png new file mode 100644 index 0000000..b0a3424 Binary files /dev/null and b/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Union-1.png differ diff --git a/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Union@2x-1.png b/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Union@2x-1.png new file mode 100644 index 0000000..c9b10fc Binary files /dev/null and b/Thirty/App/Asset/Assets.xcassets/App/Community/comment.imageset/Union@2x-1.png differ diff --git a/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Contents.json b/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Contents.json new file mode 100644 index 0000000..0060388 --- /dev/null +++ b/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "Union.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Union@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Union.png b/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Union.png new file mode 100644 index 0000000..0b6a055 Binary files /dev/null and b/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Union.png differ diff --git a/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Union@2x.png b/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Union@2x.png new file mode 100644 index 0000000..0e7f277 Binary files /dev/null and b/Thirty/App/Asset/Assets.xcassets/App/Community/like.imageset/Union@2x.png differ diff --git a/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992-1.JPG b/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992-1.JPG deleted file mode 100644 index d5832da..0000000 Binary files a/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992-1.JPG and /dev/null differ diff --git a/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992-2.JPG b/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992-2.JPG deleted file mode 100644 index d5832da..0000000 Binary files a/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992-2.JPG and /dev/null differ diff --git a/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992.JPG b/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992.JPG deleted file mode 100644 index d5832da..0000000 Binary files a/Thirty/App/Asset/Assets.xcassets/samplecat.imageset/IMG_1992.JPG and /dev/null differ diff --git a/Thirty/App/Asset/Base.lproj/Main.storyboard b/Thirty/App/Asset/Base.lproj/Main.storyboard index 36ee208..1da2ceb 100644 --- a/Thirty/App/Asset/Base.lproj/Main.storyboard +++ b/Thirty/App/Asset/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -11,6 +11,9 @@ + + BlatantRegular + Pretendard-Bold @@ -107,7 +110,7 @@ - + @@ -483,7 +479,7 @@ - + @@ -492,12 +488,12 @@ - + - - - - + + + + @@ -507,26 +503,70 @@ + + + - + + - + + - + + + + + - - + + - @@ -566,7 +606,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1000,16 +1380,19 @@ + + + @@ -1027,6 +1410,12 @@ + + + + + + diff --git a/Thirty/App/Model/Bucket.swift b/Thirty/App/Model/Bucket.swift index a03402d..aa16247 100644 --- a/Thirty/App/Model/Bucket.swift +++ b/Thirty/App/Model/Bucket.swift @@ -32,6 +32,7 @@ struct BucketAnswer: Codable { var stamp: Int? var created_at: String? var updated_at: String? + var musicOpenGraph: MusicOpenGraph? init(answerid: Int? = nil, created_at: String = "", updated_at: String? = "", music: String? = "", date: Int = 0, detail: String? = "", image: String? = "", stamp: Int, mission: String? = "") { self.answerid = answerid @@ -46,6 +47,18 @@ struct BucketAnswer: Codable { } } +struct MusicOpenGraph: Codable { + var url: String? + var title: String? + var image: ImageCodable? +} + +struct ImageCodable: Codable { + var url: String? + var width: String? + var height: String? +} + struct BucketStatusResponse: Codable { var bucketStatus: String? } diff --git a/Thirty/App/Model/Category.swift b/Thirty/App/Model/Category.swift index 54cb261..2b3bb65 100644 --- a/Thirty/App/Model/Category.swift +++ b/Thirty/App/Model/Category.swift @@ -22,3 +22,16 @@ enum CategoryType: String { case fitness = "피트니스" case study = "공부" } + +func korNameOfCategory(_ type: CategoryType.RawValue?) -> String { + switch type { + case "취미": return "HOBBY" + case "덕질": return "FAN" + case "연애": return "LOVE" + case "셀프케어": return "SELFCARE" + case "다이어트": return "DIET" + case "피트니스": return "FITNESS" + case "공부": return "STUDY" + default: return "" + } +} diff --git a/Thirty/App/Model/Challenge.swift b/Thirty/App/Model/Challenge.swift index e380c9a..236b1a8 100644 --- a/Thirty/App/Model/Challenge.swift +++ b/Thirty/App/Model/Challenge.swift @@ -16,6 +16,7 @@ struct Challenge: Codable { var is_public: Bool? var category: Category? var thumbnail: String? + var isUserOwned: Bool? } struct CommunityChallengeItem: Decodable { diff --git a/Thirty/App/Model/Community.swift b/Thirty/App/Model/Community.swift index b0afdaa..1021391 100644 --- a/Thirty/App/Model/Community.swift +++ b/Thirty/App/Model/Community.swift @@ -33,4 +33,5 @@ struct CommunityChallenge2: Decodable { var stamp: Int? var created_at: String? var isFriend: Bool? + var isFolded: Bool? = true } diff --git a/Thirty/App/Network/API/BucketAPI.swift b/Thirty/App/Network/API/BucketAPI.swift index 75595e8..3ec6308 100644 --- a/Thirty/App/Network/API/BucketAPI.swift +++ b/Thirty/App/Network/API/BucketAPI.swift @@ -110,7 +110,7 @@ extension BucketAPI: TargetType { let date = "\(bucketAnswer.date)".data(using: String.Encoding.utf8) ?? Data() let stamp = "\(bucketAnswer.stamp ?? 0)".data(using: String.Encoding.utf8) ?? Data() - let music = "".data(using: String.Encoding.utf8) ?? Data() + let music = "\(bucketAnswer.music ?? "")".data(using: String.Encoding.utf8) ?? Data() let detail = "\(bucketAnswer.detail ?? "")".data(using: String.Encoding.utf8) ?? Data() let dateData = MultipartFormData(provider: .data(date), name: "date") @@ -133,7 +133,7 @@ extension BucketAPI: TargetType { let date = "\(bucketAnswer.date)".data(using: String.Encoding.utf8) ?? Data() let stamp = "\(bucketAnswer.stamp ?? 0)".data(using: String.Encoding.utf8) ?? Data() - let music = "".data(using: String.Encoding.utf8) ?? Data() + let music = "\(bucketAnswer.music ?? "")".data(using: String.Encoding.utf8) ?? Data() let detail = "\(bucketAnswer.detail ?? "")".data(using: String.Encoding.utf8) ?? Data() let dateData = MultipartFormData(provider: .data(date), name: "date") diff --git a/Thirty/App/Network/API/ChallengeAPI.swift b/Thirty/App/Network/API/ChallengeAPI.swift index cc0cdfa..fec4e5d 100644 --- a/Thirty/App/Network/API/ChallengeAPI.swift +++ b/Thirty/App/Network/API/ChallengeAPI.swift @@ -65,7 +65,10 @@ extension ChallengeAPI: TargetType { } var headers: [String: String]? { - return ["Content-Type": "application/json"] +// return ["Content-Type": "application/json"] + return [ + "Authorization": "Bearer \(TokenManager.shared.loadAccessToken() ?? "")" + ] } } diff --git a/Thirty/App/UI/Challenge/BucketAnswerEnrollVC.swift b/Thirty/App/UI/Challenge/BucketAnswerEnrollVC.swift index 963f106..66563fd 100644 --- a/Thirty/App/UI/Challenge/BucketAnswerEnrollVC.swift +++ b/Thirty/App/UI/Challenge/BucketAnswerEnrollVC.swift @@ -20,12 +20,16 @@ class BucketAnswerEnrollVC: UIViewController, StoryboardView { @IBOutlet weak var linkView: UIView! @IBOutlet weak var linkImageView: UIImageView! + @IBOutlet weak var linkTitleLabel: UILabel! + @IBOutlet weak var linkUrlLabel: UILabel! + @IBOutlet weak var linkImageDeleteButton: UIButton! @IBOutlet weak var bucketImgView: UIView! @IBOutlet weak var bucketImageDeleteButton: UIButton! @IBOutlet weak var bucketImageView: UIImageView! @IBOutlet weak var badgeView: UIView! + @IBOutlet weak var badgeDeleteButton: UIButton! @IBOutlet weak var badgeImageView: UIImageView! @IBOutlet weak var galleryButton: UIButton! @@ -35,6 +39,7 @@ class BucketAnswerEnrollVC: UIViewController, StoryboardView { var bucketId: String = "" var bucketAnswer: BucketAnswer = BucketAnswer(stamp: 0) var selectedStamp: Int = 0 + var musicLink: String? var editFlag = false var textViewPlaceHolder = "내용을 입력하세요." @@ -69,6 +74,15 @@ class BucketAnswerEnrollVC: UIViewController, StoryboardView { self.selectedStamp = stampNum } }).disposed(by: disposeBag) + } else if let linkPopupVC = segue.destination as? BucketLinkPopupVC { + linkPopupVC.inputMusicLink + .subscribe(onNext: { musicLink in + if !musicLink.isEmpty { + #warning("등록시 링크 썸네일") +// self.linkView.isHidden = false + self.musicLink = musicLink + } + }).disposed(by: disposeBag) } } @@ -96,6 +110,7 @@ class BucketAnswerEnrollVC: UIViewController, StoryboardView { completeButton.rx.tap .bind { var bucketAnswerText = "" + var musicLinkText = "" if self.bucketAnswerTextView.text != self.textViewPlaceHolder { bucketAnswerText = self.bucketAnswerTextView.text } @@ -105,10 +120,14 @@ class BucketAnswerEnrollVC: UIViewController, StoryboardView { return } + if let musicLink = self.musicLink { + musicLinkText = musicLink + } + self.loadingView.isHidden = false self.loadingIndicator.startAnimating() let bucketAnswer = BucketAnswer(answerid: self.bucketAnswer.answerid, - music: "", + music: musicLinkText, date: self.bucketAnswer.date, detail: bucketAnswerText, image: "", @@ -143,6 +162,18 @@ class BucketAnswerEnrollVC: UIViewController, StoryboardView { self.bucketImgView.isHidden = true self.bucketImageView.image = UIImage() }.disposed(by: disposeBag) + + badgeDeleteButton.rx.tap + .bind { + self.badgeView.isHidden = true + self.selectedStamp = 0 + }.disposed(by: disposeBag) + + linkImageDeleteButton.rx.tap + .bind { + self.linkView.isHidden = true + self.musicLink = "" + }.disposed(by: disposeBag) } private func bindState(_ reactor: BucketAnswerEnrollReactor) { @@ -162,6 +193,21 @@ class BucketAnswerEnrollVC: UIViewController, StoryboardView { self?.bucketImgView.isHidden = true } + if let musicLink = bucketAnswer.musicOpenGraph, let musicLinkImage = musicLink.image?.url { + self?.linkView.isHidden = false + if let imageUrl = URL(string: musicLinkImage) { + self?.linkImageView.isHidden = false + self?.linkImageView.kf.setImage(with: imageUrl) + self?.musicLink = musicLink.url + self?.linkTitleLabel.text = musicLink.title + self?.linkUrlLabel.text = musicLink.url + } else { + self?.linkImageView.isHidden = true + } + } else { + self?.linkView.isHidden = true + } + if let stampNum = bucketAnswer.stamp, stampNum != 0 { self?.badgeView.isHidden = false self?.badgeImageView.image = UIImage(named: "badge_\(stampNum)") diff --git a/Thirty/App/UI/Challenge/BucketDetailVC.swift b/Thirty/App/UI/Challenge/BucketDetailVC.swift index 43acfcb..7f46f29 100644 --- a/Thirty/App/UI/Challenge/BucketDetailVC.swift +++ b/Thirty/App/UI/Challenge/BucketDetailVC.swift @@ -20,6 +20,8 @@ class BucketDetailVC: UIViewController, StoryboardView { @IBOutlet weak var linkImageView: UIView! @IBOutlet weak var linkImage: UIImageView! + @IBOutlet weak var linkUrlLabel: UILabel! + @IBOutlet weak var linkTitleLabel: UILabel! @IBOutlet weak var detailImageView: UIView! @IBOutlet weak var detailImage: UIImageView! @@ -103,8 +105,16 @@ class BucketDetailVC: UIViewController, StoryboardView { self.detailImageView.isHidden = true } - if let bucketLink = answer?.music, !bucketLink.isEmpty { + if let musicLink = answer?.musicOpenGraph, let musicLinkImage = musicLink.image?.url { self.linkImageView.isHidden = false + if let imageUrl = URL(string: musicLinkImage) { + self.linkImage.isHidden = false + self.linkImage.kf.setImage(with: imageUrl) + self.linkTitleLabel.text = musicLink.title + self.linkUrlLabel.text = musicLink.url + } else { + self.linkImage.isHidden = true + } } else { self.linkImageView.isHidden = true } diff --git a/Thirty/App/UI/Challenge/BucketLinkPopupVC.swift b/Thirty/App/UI/Challenge/BucketLinkPopupVC.swift index 933b133..f1fb64e 100644 --- a/Thirty/App/UI/Challenge/BucketLinkPopupVC.swift +++ b/Thirty/App/UI/Challenge/BucketLinkPopupVC.swift @@ -7,6 +7,7 @@ import UIKit import RxSwift +import RxRelay class BucketLinkPopupVC: UIViewController { @IBOutlet weak var linkTextField: UITextField! @@ -14,6 +15,7 @@ class BucketLinkPopupVC: UIViewController { @IBOutlet weak var confirmButton: UIButton! let disposeBag = DisposeBag() + var inputMusicLink = BehaviorRelay(value: "") override func viewDidLoad() { super.viewDidLoad() @@ -25,7 +27,8 @@ class BucketLinkPopupVC: UIViewController { confirmButton.rx.tap .bind { - + self.inputMusicLink.accept(self.linkTextField.text ?? "") + self.dismiss(animated: true) }.disposed(by: disposeBag) } } diff --git a/Thirty/App/UI/Challenge/Challenge.storyboard b/Thirty/App/UI/Challenge/Challenge.storyboard index 3350700..0e4bf16 100644 --- a/Thirty/App/UI/Challenge/Challenge.storyboard +++ b/Thirty/App/UI/Challenge/Challenge.storyboard @@ -1,9 +1,9 @@ - + - + @@ -707,21 +707,21 @@ - + - + + + + + + + + + - + + + - + @@ -933,6 +971,7 @@ + @@ -943,7 +982,10 @@ + + + @@ -1030,15 +1072,19 @@ diff --git a/Thirty/App/UI/Community/CommunityAllVC.swift b/Thirty/App/UI/Community/CommunityAllVC.swift index 602e44c..689ba05 100644 --- a/Thirty/App/UI/Community/CommunityAllVC.swift +++ b/Thirty/App/UI/Community/CommunityAllVC.swift @@ -33,15 +33,23 @@ class CommunityAllVC: UIViewController, StoryboardView { private func bindState(_ reactor: CommunityReactor) { reactor.state .map { $0.allCommunityList ?? [] } - .bind(to: communityEveryOneTableView.rx.items(cellIdentifier: CommunityListCell.identifier, cellType: CommunityListCell.self)) { _, item, cell in + .bind(to: communityEveryOneTableView.rx.items(cellIdentifier: CommunityListCell.identifier, cellType: CommunityListCell.self)) { index, item, cell in cell.nicknameButton.setTitle(item.usernickname, for: .normal) cell.challengeTitleLabel.text = item.challenge cell.challengeOrderLabel.text = "#\(item.date)" cell.challengeNameLabel.text = item.mission cell.detailLabel.text = item.detail + +// let readmoreFont = UIFont(name: "Pretendard-Light", size: 16.0) +// +// if item.isFolded == nil { +// if let detailText = item.detail, detailText.count > 30 { +// cell.detailLabel.addTrailing(with: "... ", moreText: "더보기", moreTextFont: readmoreFont!, moreTextColor: .gray400 ?? .black) +// } +// } + cell.challengeCreatedAtLabel.text = item.created_at?.iSO8601Date().dateToString().dateMMDD() -// cell.detailLabel.numberOfLines = 1 cell.addFriendButton.isHidden = item.isFriend ?? true @@ -54,15 +62,14 @@ class CommunityAllVC: UIViewController, StoryboardView { if let imageUrl = URL(string: item.image ?? "") { cell.challengeImage.isHidden = false -// cell.challengeImage.load(url: imageUrl) cell.challengeImage.kf.setImage(with: imageUrl) } else { cell.challengeImage.isHidden = true } - cell.makeExpand = { [weak self] _ in + cell.makeExpand = { _ in cell.detailLabel.numberOfLines = 0 - self?.communityEveryOneTableView.reloadData() + reactor.action.onNext(.unFoldCell(index)) } cell.nicknameClicked = { [weak self] in @@ -81,9 +88,7 @@ class CommunityAllVC: UIViewController, StoryboardView { alertVC.addAction(deleteContentAction) self?.present(alertVC, animated: true, completion: nil) - } - } .disposed(by: disposeBag) diff --git a/Thirty/App/UI/Community/CommunityFriendVC.swift b/Thirty/App/UI/Community/CommunityFriendVC.swift index c5da5e9..0e55a7d 100644 --- a/Thirty/App/UI/Community/CommunityFriendVC.swift +++ b/Thirty/App/UI/Community/CommunityFriendVC.swift @@ -14,13 +14,11 @@ class CommunityFriendVC: UIViewController, StoryboardView { @IBOutlet weak var noFriendView: UIView! @IBOutlet weak var loginButton: UIButton! - let viewModel = CommunityListViewModel() var disposeBag = DisposeBag() typealias Reactor = CommunityReactor - + override func viewDidLoad() { super.viewDidLoad() - reactor = CommunityReactor() } @@ -42,18 +40,24 @@ class CommunityFriendVC: UIViewController, StoryboardView { private func bindState(_ reactor: CommunityReactor) { reactor.state .map { $0.friendCommunityList ?? [] } - .bind(to: communityFriendTableView.rx.items(cellIdentifier: CommunityListCell.identifier, cellType: CommunityListCell.self)) { _, item, cell in - + .bind(to: communityFriendTableView.rx.items(cellIdentifier: CommunityListCell.identifier, cellType: CommunityListCell.self)) { index, item, cell in + cell.nicknameButton.setTitle(item.usernickname, for: .normal) cell.challengeTitleLabel.text = item.challenge cell.challengeOrderLabel.text = "#\(item.date)" cell.challengeNameLabel.text = item.mission cell.detailLabel.text = item.detail + + let readmoreFont = UIFont(name: "Pretendard-Light", size: 16.0) + + if item.isFolded == nil { + if let detailText = item.detail, detailText.count > 30 { + cell.detailLabel.addTrailing(with: "... ", moreText: "더보기", moreTextFont: readmoreFont!, moreTextColor: .gray400 ?? .black) + } + } + cell.challengeCreatedAtLabel.text = item.created_at?.iSO8601Date().dateToString().dateMMDD() -// cell.detailLabel.numberOfLines = 1 -// cell.addFriend = { _ in -// -// } + cell.nicknameClicked = { [weak self] in let alertVC = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) @@ -70,21 +74,19 @@ class CommunityFriendVC: UIViewController, StoryboardView { alertVC.addAction(deleteContentAction) self?.present(alertVC, animated: true, completion: nil) - } - + if let imageUrl = URL(string: item.image ?? "") { cell.challengeImage.isHidden = false - cell.challengeImage.load(url: imageUrl) + cell.challengeImage.kf.setImage(with: imageUrl) } else { cell.challengeImage.isHidden = true } - - cell.makeExpand = { [weak self] _ in + + cell.makeExpand = { _ in cell.detailLabel.numberOfLines = 0 - self?.communityFriendTableView.reloadData() + reactor.action.onNext(.unFoldCell(index)) } - } .disposed(by: disposeBag) @@ -95,7 +97,6 @@ class CommunityFriendVC: UIViewController, StoryboardView { self.view.showToast(message: message) } }).disposed(by: disposeBag) - } @objc func nicknameTapped(_ sender: UITapGestureRecognizer) { diff --git a/Thirty/App/UI/Community/CommunityListCell.swift b/Thirty/App/UI/Community/CommunityListCell.swift index e5f9d00..401bd3b 100644 --- a/Thirty/App/UI/Community/CommunityListCell.swift +++ b/Thirty/App/UI/Community/CommunityListCell.swift @@ -16,7 +16,6 @@ class CommunityListCell: UITableViewCell { @IBOutlet weak var challengeCreatedAtLabel: UILabel! @IBOutlet weak var challengeImage: UIImageView! @IBOutlet weak var challengeImageStackView: UIStackView! - @IBOutlet weak var moreButton: UIButton! @IBOutlet weak var addFriendButton: UIButton! static var identifier = "CommunityListCell" @@ -27,16 +26,19 @@ class CommunityListCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() + + let labelClickEvent = UITapGestureRecognizer(target: self, action: #selector(self.labelClicked(sender:))) + self.detailLabel.addGestureRecognizer(labelClickEvent) + } + + @objc func labelClicked(sender: UITapGestureRecognizer) { + makeExpand?(true) } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) } - @IBAction func expandCell() { - makeExpand?(true) - } - @IBAction func addFriendButtonClicked(_ sender: Any) { addFriend?(true) } diff --git a/Thirty/App/UI/Community/CommunityListViewModel.swift b/Thirty/App/UI/Community/CommunityListViewModel.swift deleted file mode 100644 index d4d813e..0000000 --- a/Thirty/App/UI/Community/CommunityListViewModel.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// CommunityListViewModel.swift -// Thirty -// -// Created by 송하경 on 2022/07/24. -// - -import Foundation -import RxSwift - -class CommunityListViewModel { - let friendChallengeList: [CommunityChallenge] = [ - CommunityChallenge(userNickname: "깨찰빵", challengeTitle: "아이돌 덕질 챌린지", challengeOrder: 3, challengeName: "닮은 버릇이 있다면?", challengeDetail: "지성이는 코 찡긋거리는 버릇이 있는데, 이렇게 해서 손을 대지 않고 코를 긁는 것 같다. 나도 안경을 올리려고 얼굴을 찌푸릴 때가 있는데 어쩜 이렇게 청초할수가 있을까", challengeDate: "07.24", challengeImage: nil, isExpanded: false), - CommunityChallenge(userNickname: "무머무머", challengeTitle: "반려동물 챌린지", challengeOrder: 15, challengeName: "반려동물이 제일 예뻐보일 땐?", challengeDetail: "난 늘 일하고 돌아오면서 스트레스 쌓여있는 상태인데, 매일 두고 나갔다가 한참 뒤에 돌아오는 내가 뭐가 좋다고 그렇게 꼬리를 흔들면서 달려올까?!", challengeDate: "01.08", challengeImage: nil, isExpanded: false), - CommunityChallenge(userNickname: "부들개지", challengeTitle: "음악 챌린지", challengeOrder: 2, challengeName: "오늘 날씨 같은 음악은?", challengeDetail: "새소년의 난춘", challengeDate: "01.08", challengeImage: nil, isExpanded: false) -// CommunityChallenge(userNickname: "하갱", challengeTitle: "마라톤 챌린지", challengeOrder: 3, challengeName: "4일차", challengeDetail: "힘드러4", challengeDate: "07.27", challengeImage: nil, isExpanded: false) - ] - - let everyoneChallengeList: [CommunityChallenge] = [ - CommunityChallenge(userNickname: "익명1", challengeTitle: "덕질 챌린지", challengeOrder: 0, challengeName: "닮은 버릇이 있다면?", challengeDetail: "지성이는 코 찡긋거리는 버릇이 있는데, 이렇게 해서 손을 대지 않고 코를 긁는 것 같다. 나도 안경을 올리려고 얼굴을 찌뿌릴 때가 있는데", challengeDate: "08.08", challengeImage: nil, isExpanded: false), - CommunityChallenge(userNickname: "뉸뉴", challengeTitle: "회사 챌린지", challengeOrder: 1, challengeName: "집에갈래", challengeDetail: "회사는 왜 다녀야할까 돈 많은 백수가 옛날엔 하나도 안부러웠는데 누구보다 부러울수가 없다 흐흐흐흐", challengeDate: "08.01", challengeImage: nil, isExpanded: false), - CommunityChallenge(userNickname: "난나", challengeTitle: "날씨 챌린지", challengeOrder: 2, challengeName: "하늘에 구멍뚫림", challengeDetail: "비가 엄청 많이 온다 나갔다가 흠뻑쇼 하고 돌아온 성으니", challengeDate: "07.26", challengeImage: nil, isExpanded: false), - CommunityChallenge(userNickname: "송송", challengeTitle: "노래 챌린지", challengeOrder: 3, challengeName: "비오는날 플리", challengeDetail: "비오는날에는 우산 듣기", challengeDate: "07.27", challengeImage: nil, isExpanded: false) - ] - - lazy var friendChallengeObservable = BehaviorSubject<[CommunityChallenge]>(value: friendChallengeList) - lazy var everyoneChallengeObservable = BehaviorSubject<[CommunityChallenge]>(value: everyoneChallengeList) -} diff --git a/Thirty/App/UI/Community/CommunityReactor.swift b/Thirty/App/UI/Community/CommunityReactor.swift index a1402de..09215dd 100644 --- a/Thirty/App/UI/Community/CommunityReactor.swift +++ b/Thirty/App/UI/Community/CommunityReactor.swift @@ -17,6 +17,7 @@ class CommunityReactor: Reactor { case requestFriend(String) case reportUser(String) case blockUser(String) + case unFoldCell(Int) } enum Mutation { @@ -24,6 +25,7 @@ class CommunityReactor: Reactor { case getFriendCommunityList([CommunityChallenge2]) case reportUser(String) case blockUser(String) + case unFoldCellEvent(Int) } struct State { @@ -44,6 +46,8 @@ class CommunityReactor: Reactor { return reportUserRx(targetUserId) case .blockUser(let targetUserId): return blockUserRx(targetUserId) + case .unFoldCell(let indexRow): + return Observable.just(.unFoldCellEvent(indexRow)) } } @@ -60,6 +64,8 @@ class CommunityReactor: Reactor { newState.serverMessage = message case .reportUser(let message): newState.serverMessage = message + case .unFoldCellEvent(let row): + newState.friendCommunityList?[row].isFolded = false } return newState } diff --git a/Thirty/App/UI/Explore/Explore.storyboard b/Thirty/App/UI/Explore/Explore.storyboard index 65f4fea..af52e32 100644 --- a/Thirty/App/UI/Explore/Explore.storyboard +++ b/Thirty/App/UI/Explore/Explore.storyboard @@ -1,9 +1,9 @@ - + - + diff --git a/Thirty/App/UI/Explore/ExploreDetailReactor.swift b/Thirty/App/UI/Explore/ExploreDetailReactor.swift index 2118acd..5b2b613 100644 --- a/Thirty/App/UI/Explore/ExploreDetailReactor.swift +++ b/Thirty/App/UI/Explore/ExploreDetailReactor.swift @@ -25,13 +25,14 @@ class ExploreDetailReactor: Reactor { var challengeDetail: ChallengeDetail = ChallengeDetail() var category: String = "" var challengeId: Int = 0 + var challengeIsOwned: Bool = false } var challengeDetailObservable = BehaviorRelay(value: ChallengeDetail()) var initialState: State = State() - init(category: String, challengeId: Int) { - self.initialState = State(challengeDetail: ChallengeDetail(), category: category, challengeId: challengeId) + init(category: String, challengeId: Int, challengeIsOwned: Bool) { + self.initialState = State(challengeDetail: ChallengeDetail(), category: category, challengeId: challengeId, challengeIsOwned: challengeIsOwned) } func mutate(action: Action) -> Observable { @@ -49,6 +50,7 @@ class ExploreDetailReactor: Reactor { case .setChallengeDetail(let challengeDetail): newState.challengeDetail = challengeDetail case .addChallenge: + newState.challengeIsOwned = true print("response 성공여부 처리") } return newState diff --git a/Thirty/App/UI/Explore/ExploreDetailVC.swift b/Thirty/App/UI/Explore/ExploreDetailVC.swift index a65ec0e..f53ce87 100644 --- a/Thirty/App/UI/Explore/ExploreDetailVC.swift +++ b/Thirty/App/UI/Explore/ExploreDetailVC.swift @@ -22,6 +22,7 @@ class ExploreDetailVC: UIViewController, StoryboardView { var disposeBag = DisposeBag() var categoryName: String = "" var challengeId: Int = 0 + var challengeIsOwned: Bool = false @IBAction func backButtonTouchUpInside(_ sender: Any) { self.popVC(animated: false, completion: nil) @@ -29,7 +30,7 @@ class ExploreDetailVC: UIViewController, StoryboardView { override func viewDidLoad() { super.viewDidLoad() - self.reactor = ExploreDetailReactor(category: categoryName, challengeId: challengeId) + self.reactor = ExploreDetailReactor(category: categoryName, challengeId: challengeId, challengeIsOwned: challengeIsOwned) self.challengeCollectionView.delegate = self } @@ -46,9 +47,6 @@ class ExploreDetailVC: UIViewController, StoryboardView { challengeAddButton.rx.tap .subscribe(onNext: { [weak self] in reactor.action.onNext(.addChallengeButtonTapped) - self?.challengeAddButton.backgroundColor = UIColor.gray300 - self?.challengeAddButton.setTitle("추가됨", for: .normal) - self?.challengeAddButton.setImage(UIImage(named: "icon_check"), for: .normal) self?.view.showToast(message: "챌린지가 추가되었어요.") }) .disposed(by: disposeBag) @@ -86,6 +84,16 @@ class ExploreDetailVC: UIViewController, StoryboardView { self.challengeUserCountLabel.text = "\(challengeDetail.bucketCount ?? 0)명이 이 챌린지를 하고 있어요." }) .disposed(by: disposeBag) + + reactor.state + .map { $0.challengeIsOwned } + .subscribe(onNext: { [weak self] isOwned in + self?.challengeAddButton.backgroundColor = isOwned ? UIColor.gray300 : UIColor.black + self?.challengeAddButton.setTitle(isOwned ? "추가됨" : "추가하기", for: .normal) + self?.challengeAddButton.setImage(isOwned ? UIImage(named: "icon_check") : UIImage(), for: .normal) + self?.challengeAddButton.isEnabled = !isOwned + }) + .disposed(by: disposeBag) } } diff --git a/Thirty/App/UI/Explore/ExploreListReactor.swift b/Thirty/App/UI/Explore/ExploreListReactor.swift index 9030920..35a11c3 100644 --- a/Thirty/App/UI/Explore/ExploreListReactor.swift +++ b/Thirty/App/UI/Explore/ExploreListReactor.swift @@ -48,6 +48,7 @@ class ExploreListReactor: Reactor { switch mutation { case .setChallengeList(let challengeList): newState.challengeList = challengeList + newState.addChallengeMessage = "" case .addChallenge(let message): newState.addChallengeMessage = message } diff --git a/Thirty/App/UI/Explore/ExploreListVC.swift b/Thirty/App/UI/Explore/ExploreListVC.swift index 3feafd1..6719c8c 100644 --- a/Thirty/App/UI/Explore/ExploreListVC.swift +++ b/Thirty/App/UI/Explore/ExploreListVC.swift @@ -49,6 +49,7 @@ class ExploreListVC: UIViewController, StoryboardView { if let exploreDetailVC = self?.storyboard?.instantiateViewController(withIdentifier: "ExploreDetailVC") as? ExploreDetailVC { exploreDetailVC.categoryName = self?.selectedTheme?.rawValue ?? "" exploreDetailVC.challengeId = item.id ?? 0 + exploreDetailVC.challengeIsOwned = item.isUserOwned ?? false self?.navigationController?.pushViewController(exploreDetailVC, animated: true) } }) @@ -61,9 +62,8 @@ class ExploreListVC: UIViewController, StoryboardView { .bind(to: exploreCollectionView.rx.items(cellIdentifier: ExploreListCell.identifier, cellType: ExploreListCell.self)) { _, item, cell in cell.titleLabel.text = item.title cell.descriptionLabel.text = item.description - cell.addButton.isSelected = false + cell.addButton.isSelected = item.isUserOwned ?? false cell.addButtonClicked = { _ in - cell.addButton.isSelected = true reactor.action.onNext(.addChallenge(item.id ?? 0)) } @@ -77,6 +77,10 @@ class ExploreListVC: UIViewController, StoryboardView { .subscribe(onNext: { message in if !message.isEmpty { self.view.showToast(message: message) + // 목록 갱신 + if let selectedTheme = self.selectedTheme { + reactor.action.onNext(.setChallengeByTheme(selectedTheme.rawValue)) + } } }).disposed(by: disposeBag) } diff --git a/Thirty/App/UI/My/FindPwdVC.swift b/Thirty/App/UI/My/FindPwdVC.swift index b5ce07f..f1ab13e 100644 --- a/Thirty/App/UI/My/FindPwdVC.swift +++ b/Thirty/App/UI/My/FindPwdVC.swift @@ -6,23 +6,30 @@ // import UIKit +import RxSwift class FindPwdVC: UIViewController { - + @IBOutlet weak var backButton: UIButton! + @IBOutlet weak var sendEmailButton: UIButton! + @IBOutlet weak var emailTextField: UITextField! + + var disposeBag = DisposeBag() + override func viewDidLoad() { super.viewDidLoad() - - // Do any additional setup after loading the view. + setButtonActions() } - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destination. - // Pass the selected object to the new view controller. + func setButtonActions() { + backButton.rx.tap + .bind { + self.dismiss(animated: true) + }.disposed(by: disposeBag) + + sendEmailButton.rx.tap + .bind { + // API 연결 + self.performSegue(withIdentifier: "sendEmailPopup", sender: self) + }.disposed(by: disposeBag) } - */ - } diff --git a/Thirty/App/UI/My/LoginVC.swift b/Thirty/App/UI/My/LoginVC.swift index 0387b82..1230d66 100644 --- a/Thirty/App/UI/My/LoginVC.swift +++ b/Thirty/App/UI/My/LoginVC.swift @@ -77,10 +77,10 @@ class LoginVC: UIViewController, StoryboardView { findPwdButton.rx.tap .bind { - guard let sendEmailPopupVC = self.storyboard?.instantiateViewController(withIdentifier: "SendEmailPopupVC") as? SendEmailPopupVC else { return } - sendEmailPopupVC.modalTransitionStyle = .crossDissolve - sendEmailPopupVC.modalPresentationStyle = .fullScreen - self.present(sendEmailPopupVC, animated: true, completion: nil) + guard let findPwdVC = self.storyboard?.instantiateViewController(withIdentifier: "FindPwdVC") as? FindPwdVC else { return } + findPwdVC.modalTransitionStyle = .crossDissolve + findPwdVC.modalPresentationStyle = .fullScreen + self.present(findPwdVC, animated: true, completion: nil) } .disposed(by: disposeBag) diff --git a/Thirty/App/UI/My/My.storyboard b/Thirty/App/UI/My/My.storyboard index da44d5b..6bb9068 100644 --- a/Thirty/App/UI/My/My.storyboard +++ b/Thirty/App/UI/My/My.storyboard @@ -1,9 +1,9 @@ - + - + @@ -1248,9 +1248,6 @@ @@ -1281,7 +1278,7 @@ - + @@ -1303,8 +1300,9 @@ - - + + + @@ -1338,7 +1336,7 @@