diff --git a/MEEW-Client/MEEW-Client.xcodeproj/project.pbxproj b/MEEW-Client/MEEW-Client.xcodeproj/project.pbxproj index d1ff34a..002fc4c 100644 --- a/MEEW-Client/MEEW-Client.xcodeproj/project.pbxproj +++ b/MEEW-Client/MEEW-Client.xcodeproj/project.pbxproj @@ -42,10 +42,6 @@ BD3B547828520D14003D91D3 /* InfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3B547728520D14003D91D3 /* InfoView.swift */; }; BD45C412274947B500229D35 /* SelectVC.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD45C411274947B500229D35 /* SelectVC.storyboard */; }; BD45C415274947C600229D35 /* SelectVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD45C414274947C600229D35 /* SelectVC.swift */; }; - BD45C41D2749482100229D35 /* ResultVC.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD45C41C2749482100229D35 /* ResultVC.storyboard */; }; - BD45C41F2749482800229D35 /* ResultVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD45C41E2749482800229D35 /* ResultVC.swift */; }; - BD45C424274962F300229D35 /* MEEWPopUp.xib in Resources */ = {isa = PBXBuildFile; fileRef = BD45C423274962F300229D35 /* MEEWPopUp.xib */; }; - BD45C426274962FA00229D35 /* MEEWPopUp.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD45C425274962FA00229D35 /* MEEWPopUp.swift */; }; BD45C428274968FB00229D35 /* UIApplication+.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD45C427274968FB00229D35 /* UIApplication+.swift */; }; BD45C42A27496A8700229D35 /* AppDelegate+.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD45C42927496A8700229D35 /* AppDelegate+.swift */; }; BD45C42C27496BA000229D35 /* UIView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD45C42B27496BA000229D35 /* UIView+.swift */; }; @@ -53,9 +49,25 @@ BD45C4352749937A00229D35 /* CompletePopUp.xib in Resources */ = {isa = PBXBuildFile; fileRef = BD45C4342749937A00229D35 /* CompletePopUp.xib */; }; BD45C4372749938400229D35 /* CompletePopUp.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD45C4362749938400229D35 /* CompletePopUp.swift */; }; BD4C26842853170000EFAEE5 /* ProfileEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD4C26832853170000EFAEE5 /* ProfileEditViewController.swift */; }; + BD772D5528B75C02006CBD6B /* ArchiveDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD772D5428B75C02006CBD6B /* ArchiveDetailVC.swift */; }; + BD772D5728B75C3B006CBD6B /* ArchiveDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD772D5628B75C3B006CBD6B /* ArchiveDetailView.swift */; }; + BD772D5928B75F7F006CBD6B /* ArchiveTodoTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD772D5828B75F7F006CBD6B /* ArchiveTodoTVC.swift */; }; + BD772D5C28B797E5006CBD6B /* DatePickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD772D5B28B797E5006CBD6B /* DatePickerView.swift */; }; + BD92EF9D28D3156C000C4A4F /* ArchiveService.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD92EF9C28D3156C000C4A4F /* ArchiveService.swift */; }; + BD92EFA028D316B1000C4A4F /* RecentArchiveDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD92EF9F28D316B1000C4A4F /* RecentArchiveDTO.swift */; }; + BD92EFA228D34685000C4A4F /* AllArchiveDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD92EFA128D34685000C4A4F /* AllArchiveDTO.swift */; }; + BD92EFA428D360B2000C4A4F /* SpecificArchiveDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD92EFA328D360B2000C4A4F /* SpecificArchiveDTO.swift */; }; BDABFA4728508CAB00883B32 /* NavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDABFA4628508CAB00883B32 /* NavigationBarView.swift */; }; BDABFA492850928600883B32 /* SettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDABFA482850928600883B32 /* SettingViewController.swift */; }; BDABFA4B2850930700883B32 /* SettingViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BDABFA4A2850930700883B32 /* SettingViewController.storyboard */; }; + BDC5CC8E28AD4D1600CBDE12 /* ArchiveVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC5CC8D28AD4D1600CBDE12 /* ArchiveVC.swift */; }; + BDC5CC9128AD4D8C00CBDE12 /* ArchiveTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC5CC9028AD4D8C00CBDE12 /* ArchiveTVC.swift */; }; + BDC5CC9328AD4DC900CBDE12 /* ArchiveBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC5CC9228AD4DC900CBDE12 /* ArchiveBannerView.swift */; }; + BDC5CC9528AD4DE700CBDE12 /* ArchiveAllVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC5CC9428AD4DE700CBDE12 /* ArchiveAllVC.swift */; }; + BDC5CC9728AD4E1600CBDE12 /* ArchiveHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC5CC9628AD4E1600CBDE12 /* ArchiveHeaderView.swift */; }; + BDC5CC9928AD4E2500CBDE12 /* ArchiveAllHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC5CC9828AD4E2500CBDE12 /* ArchiveAllHeaderView.swift */; }; + BDC5CC9B28AD4E8C00CBDE12 /* ArchiveEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC5CC9A28AD4E8C00CBDE12 /* ArchiveEmptyView.swift */; }; + BDC5CC9D28ADB9EE00CBDE12 /* ArchiveLevelProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC5CC9C28ADB9EE00CBDE12 /* ArchiveLevelProgressView.swift */; }; BDE6507427DB5DB2005048D3 /* ReportTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE6507227DB5DB2005048D3 /* ReportTableViewCell.swift */; }; BDE6507527DB5DB2005048D3 /* ReportTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BDE6507327DB5DB2005048D3 /* ReportTableViewCell.xib */; }; F203E64128AD5C1200F620A6 /* AlertViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F203E64028AD5C1200F620A6 /* AlertViewController.storyboard */; }; @@ -122,10 +134,6 @@ BD3B547728520D14003D91D3 /* InfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoView.swift; sourceTree = ""; }; BD45C411274947B500229D35 /* SelectVC.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = SelectVC.storyboard; sourceTree = ""; }; BD45C414274947C600229D35 /* SelectVC.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = SelectVC.swift; sourceTree = ""; tabWidth = 4; }; - BD45C41C2749482100229D35 /* ResultVC.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = ResultVC.storyboard; sourceTree = ""; }; - BD45C41E2749482800229D35 /* ResultVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultVC.swift; sourceTree = ""; }; - BD45C423274962F300229D35 /* MEEWPopUp.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MEEWPopUp.xib; path = "MEEW-Client/Screens/Result/MEEWPopUp.xib"; sourceTree = SOURCE_ROOT; }; - BD45C425274962FA00229D35 /* MEEWPopUp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MEEWPopUp.swift; path = "MEEW-Client/Screens/Result/MEEWPopUp.swift"; sourceTree = SOURCE_ROOT; }; BD45C427274968FB00229D35 /* UIApplication+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+.swift"; sourceTree = ""; }; BD45C42927496A8700229D35 /* AppDelegate+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+.swift"; sourceTree = ""; }; BD45C42B27496BA000229D35 /* UIView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+.swift"; sourceTree = ""; }; @@ -133,11 +141,25 @@ BD45C4342749937A00229D35 /* CompletePopUp.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CompletePopUp.xib; sourceTree = ""; }; BD45C4362749938400229D35 /* CompletePopUp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompletePopUp.swift; sourceTree = ""; }; BD4C26832853170000EFAEE5 /* ProfileEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileEditViewController.swift; sourceTree = ""; }; + BD772D5428B75C02006CBD6B /* ArchiveDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveDetailVC.swift; sourceTree = ""; }; + BD772D5628B75C3B006CBD6B /* ArchiveDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveDetailView.swift; sourceTree = ""; }; + BD772D5828B75F7F006CBD6B /* ArchiveTodoTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveTodoTVC.swift; sourceTree = ""; }; + BD772D5B28B797E5006CBD6B /* DatePickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatePickerView.swift; sourceTree = ""; }; + BD92EF9C28D3156C000C4A4F /* ArchiveService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveService.swift; sourceTree = ""; }; + BD92EF9F28D316B1000C4A4F /* RecentArchiveDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentArchiveDTO.swift; sourceTree = ""; }; + BD92EFA128D34685000C4A4F /* AllArchiveDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllArchiveDTO.swift; sourceTree = ""; }; + BD92EFA328D360B2000C4A4F /* SpecificArchiveDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecificArchiveDTO.swift; sourceTree = ""; }; BDABFA4628508CAB00883B32 /* NavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationBarView.swift; sourceTree = ""; }; BDABFA482850928600883B32 /* SettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = ""; }; BDABFA4A2850930700883B32 /* SettingViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = SettingViewController.storyboard; sourceTree = ""; }; - BDE6507227DB5DB2005048D3 /* ReportTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportTableViewCell.swift; sourceTree = ""; }; - BDE6507327DB5DB2005048D3 /* ReportTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ReportTableViewCell.xib; sourceTree = ""; }; + BDC5CC8D28AD4D1600CBDE12 /* ArchiveVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveVC.swift; sourceTree = ""; }; + BDC5CC9028AD4D8C00CBDE12 /* ArchiveTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveTVC.swift; sourceTree = ""; }; + BDC5CC9228AD4DC900CBDE12 /* ArchiveBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveBannerView.swift; sourceTree = ""; }; + BDC5CC9428AD4DE700CBDE12 /* ArchiveAllVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveAllVC.swift; sourceTree = ""; }; + BDC5CC9628AD4E1600CBDE12 /* ArchiveHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveHeaderView.swift; sourceTree = ""; }; + BDC5CC9828AD4E2500CBDE12 /* ArchiveAllHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveAllHeaderView.swift; sourceTree = ""; }; + BDC5CC9A28AD4E8C00CBDE12 /* ArchiveEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveEmptyView.swift; sourceTree = ""; }; + BDC5CC9C28ADB9EE00CBDE12 /* ArchiveLevelProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveLevelProgressView.swift; sourceTree = ""; }; CD5A903C280A765B3BA5AEA8 /* Pods-MEEW-Client.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MEEW-Client.release.xcconfig"; path = "Target Support Files/Pods-MEEW-Client/Pods-MEEW-Client.release.xcconfig"; sourceTree = ""; }; F203E64028AD5C1200F620A6 /* AlertViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = AlertViewController.storyboard; sourceTree = ""; }; F203E64228AD5C3000F620A6 /* AlertViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertViewController.swift; sourceTree = ""; }; @@ -241,7 +263,7 @@ BD45C40D274946BF00229D35 /* Select */, F2E1CAC4281FC3CE00E4B1FD /* Nickname */, BD45C40E2749472700229D35 /* ToDo */, - BD45C40F2749472900229D35 /* Result */, + BD45C40F2749472900229D35 /* Archive */, BDABFA4228508A5000883B32 /* Setting */, F203E63C28AD5BB900F620A6 /* Alert */, ); @@ -401,14 +423,16 @@ path = ToDo; sourceTree = ""; }; - BD45C40F2749472900229D35 /* Result */ = { + BD45C40F2749472900229D35 /* Archive */ = { isa = PBXGroup; children = ( + BD92EF9E28D316A5000C4A4F /* Model */, + BDC5CC8F28AD4D4800CBDE12 /* Cell */, BD45C421274948BA00229D35 /* Controller */, - BD45C420274948B300229D35 /* Storyboard */, + BD92EF9B28D31542000C4A4F /* Service */, BD45C42F274978C900229D35 /* View */, ); - path = Result; + path = Archive; sourceTree = ""; }; BD45C4102749476200229D35 /* Storyboard */ = { @@ -439,18 +463,12 @@ path = Controller; sourceTree = ""; }; - BD45C420274948B300229D35 /* Storyboard */ = { - isa = PBXGroup; - children = ( - BD45C41C2749482100229D35 /* ResultVC.storyboard */, - ); - path = Storyboard; - sourceTree = ""; - }; BD45C421274948BA00229D35 /* Controller */ = { isa = PBXGroup; children = ( - BD45C41E2749482800229D35 /* ResultVC.swift */, + BDC5CC8D28AD4D1600CBDE12 /* ArchiveVC.swift */, + BDC5CC9428AD4DE700CBDE12 /* ArchiveAllVC.swift */, + BD772D5428B75C02006CBD6B /* ArchiveDetailVC.swift */, ); path = Controller; sourceTree = ""; @@ -458,8 +476,6 @@ BD45C4222749629100229D35 /* Common */ = { isa = PBXGroup; children = ( - BD45C423274962F300229D35 /* MEEWPopUp.xib */, - BD45C425274962FA00229D35 /* MEEWPopUp.swift */, BD45C42D27496C4700229D35 /* PopUpVC.swift */, BD45C4342749937A00229D35 /* CompletePopUp.xib */, BD45C4362749938400229D35 /* CompletePopUp.swift */, @@ -470,12 +486,35 @@ BD45C42F274978C900229D35 /* View */ = { isa = PBXGroup; children = ( - BDE6507227DB5DB2005048D3 /* ReportTableViewCell.swift */, - BDE6507327DB5DB2005048D3 /* ReportTableViewCell.xib */, + BDC5CC9228AD4DC900CBDE12 /* ArchiveBannerView.swift */, + BDC5CC9628AD4E1600CBDE12 /* ArchiveHeaderView.swift */, + BDC5CC9828AD4E2500CBDE12 /* ArchiveAllHeaderView.swift */, + BDC5CC9A28AD4E8C00CBDE12 /* ArchiveEmptyView.swift */, + BDC5CC9C28ADB9EE00CBDE12 /* ArchiveLevelProgressView.swift */, + BD772D5628B75C3B006CBD6B /* ArchiveDetailView.swift */, + BD772D5B28B797E5006CBD6B /* DatePickerView.swift */, ); path = View; sourceTree = ""; }; + BD92EF9B28D31542000C4A4F /* Service */ = { + isa = PBXGroup; + children = ( + BD92EF9C28D3156C000C4A4F /* ArchiveService.swift */, + ); + path = Service; + sourceTree = ""; + }; + BD92EF9E28D316A5000C4A4F /* Model */ = { + isa = PBXGroup; + children = ( + BD92EF9F28D316B1000C4A4F /* RecentArchiveDTO.swift */, + BD92EFA128D34685000C4A4F /* AllArchiveDTO.swift */, + BD92EFA328D360B2000C4A4F /* SpecificArchiveDTO.swift */, + ); + path = Model; + sourceTree = ""; + }; BDABFA4228508A5000883B32 /* Setting */ = { isa = PBXGroup; children = ( @@ -514,6 +553,15 @@ path = View; sourceTree = ""; }; + BDC5CC8F28AD4D4800CBDE12 /* Cell */ = { + isa = PBXGroup; + children = ( + BDC5CC9028AD4D8C00CBDE12 /* ArchiveTVC.swift */, + BD772D5828B75F7F006CBD6B /* ArchiveTodoTVC.swift */, + ); + path = Cell; + sourceTree = ""; + }; EF375EDFD0003B058BCD97D5 /* Pods */ = { isa = PBXGroup; children = ( @@ -695,7 +743,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - BD45C424274962F300229D35 /* MEEWPopUp.xib in Resources */, BD339A1C27493B9200021E91 /* BaseVC.storyboard in Resources */, F2EC39F9274962CD00805FE3 /* Color.xcassets in Resources */, 6F3134AF27FF02A400FE1EB4 /* JoinVC.xib in Resources */, @@ -706,9 +753,7 @@ F203E64128AD5C1200F620A6 /* AlertViewController.storyboard in Resources */, F203E64528AD5FED00F620A6 /* AlertTableViewCell.xib in Resources */, BD45C4352749937A00229D35 /* CompletePopUp.xib in Resources */, - BDE6507527DB5DB2005048D3 /* ReportTableViewCell.xib in Resources */, BD339A0F27493AC300021E91 /* LaunchScreen.storyboard in Resources */, - BD45C41D2749482100229D35 /* ResultVC.storyboard in Resources */, BDABFA4B2850930700883B32 /* SettingViewController.storyboard in Resources */, F2EC39FD2749636B00805FE3 /* Spoqa Han Sans Neo Light.otf in Resources */, 6F8A3B7927FEE48E000FBABE /* Montserrat-Bold.ttf in Resources */, @@ -771,6 +816,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + BD92EF9D28D3156C000C4A4F /* ArchiveService.swift in Sources */, F2AC126A28AE2FCD00B844AC /* AlertTableViewCell.swift in Sources */, BD339A3727493F3A00021E91 /* GenericResponse.swift in Sources */, F203E64328AD5C3000F620A6 /* AlertViewController.swift in Sources */, @@ -779,6 +825,7 @@ 6F65C67B2829113B00DD017A /* FinishedModalVC.swift in Sources */, 6F65C67F2829320600DD017A /* BottomSheetVC.swift in Sources */, F2EC3A112749A47B00805FE3 /* CharacterRequestDataModel.swift in Sources */, + BD772D5928B75F7F006CBD6B /* ArchiveTodoTVC.swift in Sources */, BD45C4372749938400229D35 /* CompletePopUp.swift in Sources */, F2C6AAD8284A358A00613BF7 /* LoadingView.swift in Sources */, 6F2AB35828BCA7D00054B4BB /* TabbarViewController.swift in Sources */, @@ -786,11 +833,15 @@ 6F74466328B6205B008A3A7A /* GetTodayCharacter.swift in Sources */, BD3B547628520928003D91D3 /* SettingRow.swift in Sources */, F2EC3A0727496AA000805FE3 /* SelectCharacterCVC.swift in Sources */, + BDC5CC9B28AD4E8C00CBDE12 /* ArchiveEmptyView.swift in Sources */, + BD92EFA428D360B2000C4A4F /* SpecificArchiveDTO.swift in Sources */, F2EC3A0A27496CD200805FE3 /* SelectCharcterDataModel.swift in Sources */, 6FDCA78B2827E9F100BB0836 /* ToDoVC.swift in Sources */, F2EC3A0F2749A1D400805FE3 /* CharacterListService.swift in Sources */, BD45C42A27496A8700229D35 /* AppDelegate+.swift in Sources */, BD339A0527493ABF00021E91 /* SceneDelegate.swift in Sources */, + BDC5CC8E28AD4D1600CBDE12 /* ArchiveVC.swift in Sources */, + BD772D5728B75C3B006CBD6B /* ArchiveDetailView.swift in Sources */, BD45C428274968FB00229D35 /* UIApplication+.swift in Sources */, F2C6770A27C7DA320020B8F4 /* SelectCarouselLayout.swift in Sources */, F2E1CACA281FC63500E4B1FD /* NicknameVC.swift in Sources */, @@ -801,11 +852,16 @@ BD45C426274962FA00229D35 /* MEEWPopUp.swift in Sources */, 6F74466528B621A8008A3A7A /* TodayCharacterRequestModel.swift in Sources */, BD45C42E27496C4700229D35 /* PopUpVC.swift in Sources */, + BD772D5C28B797E5006CBD6B /* DatePickerView.swift in Sources */, + BDC5CC9128AD4D8C00CBDE12 /* ArchiveTVC.swift in Sources */, BDABFA4728508CAB00883B32 /* NavigationBarView.swift in Sources */, BD45C42C27496BA000229D35 /* UIView+.swift in Sources */, + BDC5CC9928AD4E2500CBDE12 /* ArchiveAllHeaderView.swift in Sources */, 6F3134AE27FF02A400FE1EB4 /* JoinVC.swift in Sources */, + BDC5CC9728AD4E1600CBDE12 /* ArchiveHeaderView.swift in Sources */, 6F2AB33B28BA4AC90054B4BB /* CharacterService.swift in Sources */, 6FDCA78E2828005E00BB0836 /* UIButton+.swift in Sources */, + BD92EFA028D316B1000C4A4F /* RecentArchiveDTO.swift in Sources */, BD339A2A27493C6200021E91 /* Font.swift in Sources */, BDABFA492850928600883B32 /* SettingViewController.swift in Sources */, 6F2AB33928BA49CD0054B4BB /* ChracterRequestModel.swift in Sources */, @@ -816,7 +872,15 @@ BD339A2827493C5600021E91 /* Palette.swift in Sources */, BD45C415274947C600229D35 /* SelectVC.swift in Sources */, 6F673C042837F26400B7E0D3 /* MyCell.swift in Sources */, + BD772D5528B75C02006CBD6B /* ArchiveDetailVC.swift in Sources */, + BDC5CC9D28ADB9EE00CBDE12 /* ArchiveLevelProgressView.swift in Sources */, BD339A3027493D6500021E91 /* Reusable.swift in Sources */, + BD92EFA228D34685000C4A4F /* AllArchiveDTO.swift in Sources */, + 6F257EEC2749A3E00055EE43 /* GetToDoService.swift in Sources */, + BDC5CC9528AD4DE700CBDE12 /* ArchiveAllVC.swift in Sources */, + 6F94BF57283768A600345FFA /* ContentVC.swift in Sources */, + 6F257EEE2749A54B0055EE43 /* DataModel.swift in Sources */, + BDC5CC9328AD4DC900CBDE12 /* ArchiveBannerView.swift in Sources */, BD45C41F2749482800229D35 /* ResultVC.swift in Sources */, 6F94BF57283768A600345FFA /* ContentVC.swift in Sources */, ); @@ -977,11 +1041,11 @@ INFOPLIST_FILE = "MEEW-Client/Info.plist"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = ResultVC; + INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UIUserInterfaceStyle = Light; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1011,11 +1075,11 @@ INFOPLIST_FILE = "MEEW-Client/Info.plist"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = ResultVC; + INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UIUserInterfaceStyle = Light; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/Contents.json b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/Contents.json new file mode 100644 index 0000000..dc59425 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_check_empty.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_check_empty@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_check_empty@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty.png new file mode 100644 index 0000000..8d2e5ce Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty@2x.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty@2x.png new file mode 100644 index 0000000..94a9e5e Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty@2x.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty@3x.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty@3x.png new file mode 100644 index 0000000..f4397a1 Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/ic_check_empty.imageset/ic_check_empty@3x.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/Contents.json b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/Contents.json new file mode 100644 index 0000000..6b8fbe3 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icn_down.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icn_down@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icn_down@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down.png new file mode 100644 index 0000000..abea262 Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down@2x.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down@2x.png new file mode 100644 index 0000000..2ee5c27 Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down@2x.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down@3x.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down@3x.png new file mode 100644 index 0000000..ae03014 Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/icn_down.imageset/icn_down@3x.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/Contents.json b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/Contents.json new file mode 100644 index 0000000..c6079e4 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "img_character_nothing.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "img_character_nothing@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "img_character_nothing@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing.png new file mode 100644 index 0000000..916b313 Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing@2x.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing@2x.png new file mode 100644 index 0000000..787770b Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing@2x.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing@3x.png b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing@3x.png new file mode 100644 index 0000000..6251d6f Binary files /dev/null and b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_nothing.imageset/img_character_nothing@3x.png differ diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_today.imageset/Contents.json b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_today.imageset/Contents.json index 6c42a7c..1a172a4 100644 --- a/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_today.imageset/Contents.json +++ b/MEEW-Client/MEEW-Client/Global/Resources/Images/Assets.xcassets/img_character_today.imageset/Contents.json @@ -19,5 +19,8 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "original" } } diff --git a/MEEW-Client/MEEW-Client/Global/Resources/Images/Image.swift b/MEEW-Client/MEEW-Client/Global/Resources/Images/Image.swift index ee27726..2dd2e06 100644 --- a/MEEW-Client/MEEW-Client/Global/Resources/Images/Image.swift +++ b/MEEW-Client/MEEW-Client/Global/Resources/Images/Image.swift @@ -8,16 +8,23 @@ import Foundation import UIKit -struct ImageLiterals{ - - struct checkIcon{ - static let redCheckIcon = UIImage(named: "icn_check_red")! - static let orangeCheckIcon = UIImage(named: "icn_check_orange")! - static let yellowCheckIcon = UIImage(named: "icn_check_yellow")! - static let blueCheckIcon = UIImage(named: "icn_check_blue")! - static let pinkCheckIcon = UIImage(named: "icn_check_pink")! - static let purpleCheckIcon = UIImage(named: "icn_check_purple")! - static let greenCheckIcon = UIImage(named: "icn_check_green")! - static let lightpinkCheckIcon = UIImage(named: "icn_check_lightpink")! - } +struct ImageLiterals { + + struct checkIcon { + static let redCheckIcon = UIImage(named: "icn_check_red")! + static let orangeCheckIcon = UIImage(named: "icn_check_orange")! + static let yellowCheckIcon = UIImage(named: "icn_check_yellow")! + static let blueCheckIcon = UIImage(named: "icn_check_blue")! + static let pinkCheckIcon = UIImage(named: "icn_check_pink")! + static let purpleCheckIcon = UIImage(named: "icn_check_purple")! + static let greenCheckIcon = UIImage(named: "icn_check_green")! + static let lightpinkCheckIcon = UIImage(named: "icn_check_lightpink")! + } + + static let imageCharacterNothing = UIImage(named: "img_character_nothing")! + static let imageCharacterToday = UIImage(named: "img_character_today")! + static let settingIcon = UIImage(named: "icn_setting")! + static let icnCheckEmpty = UIImage(named: "ic_check_empty")! + static let icnArrowDown = UIImage(named: "icn_down")! + static let icnClose = UIImage(named: "icClose")! } diff --git a/MEEW-Client/MEEW-Client/Global/Supports/SceneDelegate.swift b/MEEW-Client/MEEW-Client/Global/Supports/SceneDelegate.swift index c33c12d..4f895aa 100644 --- a/MEEW-Client/MEEW-Client/Global/Supports/SceneDelegate.swift +++ b/MEEW-Client/MEEW-Client/Global/Supports/SceneDelegate.swift @@ -8,18 +8,12 @@ import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { - var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } if let windowScene = scene as? UIWindowScene { - - let window = UIWindow(windowScene: scene as! UIWindowScene) window.rootViewController = TabbarViewController() self.window = window diff --git a/MEEW-Client/MEEW-Client/Info.plist b/MEEW-Client/MEEW-Client/Info.plist index 25a6974..f816636 100644 --- a/MEEW-Client/MEEW-Client/Info.plist +++ b/MEEW-Client/MEEW-Client/Info.plist @@ -2,8 +2,6 @@ - CFBundleDevelopmentRegion - ko_KR NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/MEEW-Client/MEEW-Client/Networks/APIConstants/APIConstants.swift b/MEEW-Client/MEEW-Client/Networks/APIConstants/APIConstants.swift index 1a0b446..cd434fc 100644 --- a/MEEW-Client/MEEW-Client/Networks/APIConstants/APIConstants.swift +++ b/MEEW-Client/MEEW-Client/Networks/APIConstants/APIConstants.swift @@ -24,3 +24,10 @@ enum APIConstants { //MARK: - SelectURL static let readCharacterURL = baseURL + "/personality/list" } + +extension APIConstants { + //MARK: - ArchiveURL + static let recentArchiveURL = baseURL + "/personality/recent" + static let allArchiveURL = baseURL + "/personality/all" + static let archiveForDateURL = baseURL + "/personality/date" +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Cell/ArchiveTVC.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Cell/ArchiveTVC.swift new file mode 100644 index 0000000..e26ed1f --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Cell/ArchiveTVC.swift @@ -0,0 +1,121 @@ +// +// ArchiveTVC.swift +// MEEW-Client +// +// Created by taekki on 2022/08/18. +// + +import UIKit + +import SnapKit +import Then +import Kingfisher + +final class ArchiveTVC: UITableViewCell { + + private lazy var characterImageView = UIImageView().then { + $0.contentMode = .scaleAspectFill + $0.image = ImageLiterals.imageCharacterToday + } + + private let progressView = ArchiveLevelProgressView() + + private let characterNameLabel = UILabel().then { + $0.text = "캐릭터 이름입니다." + $0.textColor = .white + $0.font = .body1 + } + + private let timeLabel = UILabel().then { + $0.text = "YYYY.MM.DD" + $0.textColor = .grey400 + $0.font = UIFont(name: "SpoqaHanSansNeo-Medium", size: 10.0)! + } + + private let lineView = UIView().then { + $0.backgroundColor = .grey500 + } + + private lazy var dateFormatter = DateFormatter().then { + $0.dateFormat = "YYYY.MM.dd" + $0.locale = Locale(identifier: "ko_KR") + $0.timeZone = TimeZone(identifier: "ko_KR") + } + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + + configureUI() + configureLayout() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + + // MARK: - Configure Functions + + func configureUI() { + backgroundColor = .clear + selectionStyle = .none + progressView.layer.cornerRadius = 8 + } + + func configureLayout() { + contentView.addSubviews([characterImageView, progressView, characterNameLabel, timeLabel, lineView]) + + characterImageView.snp.makeConstraints { + $0.width.height.equalTo(100) + $0.leading.equalToSuperview().inset(25) + $0.top.equalToSuperview().inset(10) + } + + progressView.snp.makeConstraints { + $0.leading.equalTo(characterImageView.snp.trailing).offset(10) + $0.top.equalToSuperview().inset(50) + $0.width.equalTo(88) + $0.height.equalTo(22) + } + + characterNameLabel.snp.makeConstraints { + $0.top.equalTo(progressView.snp.bottom).offset(8) + $0.leading.equalTo(progressView) + } + + timeLabel.snp.makeConstraints { + $0.top.equalToSuperview().inset(8) + $0.trailing.equalToSuperview().inset(27) + } + + lineView.snp.makeConstraints { + $0.top.equalTo(characterImageView.snp.bottom).offset(12) + $0.height.equalTo(0.5) + $0.leading.trailing.equalToSuperview().inset(20) + $0.bottom.lessThanOrEqualToSuperview() + } + } + + func configure(_ data: Recent?) { + let df = DateFormatter() + df.dateFormat = "YYYY-MM-dd'T'hh:mm:ss.sss'Z'" + guard let date = df.date(from: data?.date ?? "") else { return } + guard let imgURL = data?.imgURL else { return } + + characterNameLabel.text = data?.name + timeLabel.text = dateFormatter.string(from: date) + characterImageView.kf.setImage(with: URL(string: imgURL)) + } + + func configure(withAll data: All?) { + let df = DateFormatter() + df.dateFormat = "YYYY-MM-dd'T'hh:mm:ss.sss'Z'" + guard let date = df.date(from: data?.date ?? "") else { return } + guard let imgURL = data?.imgURL else { return } + + characterNameLabel.text = data?.name + timeLabel.text = dateFormatter.string(from: date) + characterImageView.kf.setImage(with: URL(string: imgURL)) + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Cell/ArchiveTodoTVC.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Cell/ArchiveTodoTVC.swift new file mode 100644 index 0000000..ef7d5b2 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Cell/ArchiveTodoTVC.swift @@ -0,0 +1,70 @@ +// +// ArchiveTodoTVC.swift +// MEEW-Client +// +// Created by taekki on 2022/08/25. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveTodoTVC: UITableViewCell { + + + private let checkImageView = UIImageView() + private let todoLabel = UILabel() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + + configureUI() + configureLayout() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + + // MARK: - Configure Functions + + func configureUI() { + backgroundColor = .clear + selectionStyle = .none + + checkImageView.do { + $0.image = ImageLiterals.icnCheckEmpty + $0.contentMode = .scaleAspectFill + } + + todoLabel.do { + $0.text = "평소 먹지 않은 메뉴 시키기" + $0.textColor = .white + $0.font = UIFont(name: "SpoqaHanSansNeo-Regular", size: 14.0)! + } + } + + func configureLayout() { + contentView.addSubviews([checkImageView, todoLabel]) + + checkImageView.snp.makeConstraints { + $0.leading.equalToSuperview().inset(16) + $0.size.equalTo(24) + $0.centerY.equalToSuperview() + } + + todoLabel.snp.makeConstraints { + $0.leading.equalTo(checkImageView.snp.trailing).offset(8) + $0.centerY.equalTo(checkImageView.snp.centerY) + $0.trailing.equalToSuperview().inset(16) + } + } + + func configure(_ data: SpecificTask?) { + todoLabel.text = data?.content + } +} + diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveAllVC.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveAllVC.swift new file mode 100644 index 0000000..afeec6e --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveAllVC.swift @@ -0,0 +1,141 @@ +// +// ArchiveAllVC.swift +// MEEW-Client +// +// Created by taekki on 2022/08/18. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveAllVC: BaseVC { + + // MARK: - Properties + + var data: [All] = [] { didSet { tableView.reloadData() } } + var month: [Int] = [] { didSet { tableView.reloadData() } } + + // MARK: - UI Properties + + lazy var navigationBarView = NavigationBarView().then { + $0.title = "전체 기록" + } + lazy var emptyView = ArchiveEmptyView() + let tableView = UITableView(frame: .zero, style: .grouped) + + override func viewDidLoad() { + super.viewDidLoad() + + configureUI() + configureLayout() + configureTableView() + dismissController() + requestAllArchive() + } + + private func requestAllArchive(page: Int = 1) { + ArchiveService.shared.fetchAllArchive(page: page) { response in + switch response { + case .success(let result): + guard let response = result as? AllArchiveDTO else { return } + if let data = response.data, + let all = data.all { + self.data = all + self.month = all.compactMap { + let df = DateFormatter() + df.dateFormat = "YYYY-MM-dd'T'hh:mm:ss.sss'Z'" + return df.date(from: $0.date) + }.map { + return Calendar.current.dateComponents([.month], from: $0).month! + }.reduce(into: [Int]()) { result, currentValue in + if (result.isEmpty || result.last != currentValue) { + result.append(currentValue) + } + } + } + + default: + print("Error") + return + } + } + } +} + +extension ArchiveAllVC { + + private func configureUI() { + view.backgroundColor = .grey700 + } + + private func configureLayout() { + view.addSubviews([navigationBarView, tableView]) + + navigationBarView.snp.makeConstraints { + $0.height.equalTo(48) + $0.top.equalTo(view.safeAreaLayoutGuide) + $0.leading.trailing.equalToSuperview() + } + + tableView.snp.makeConstraints { + $0.top.equalTo(navigationBarView.snp.bottom).offset(18) + $0.bottom.equalToSuperview() + $0.leading.trailing.equalToSuperview() + } + } + + private func configureTableView() { + tableView.backgroundColor = .clear + tableView.delegate = self + tableView.dataSource = self + tableView.register(ArchiveAllHeaderView.self, forHeaderFooterViewReuseIdentifier: ArchiveAllHeaderView.reuseIdentifier) + tableView.register(ArchiveTVC.self, forCellReuseIdentifier: ArchiveTVC.reuseIdentifier) + tableView.rowHeight = UITableView.automaticDimension + } + + private func dismissController() { + navigationBarView.dismissClosure = { + self.navigationController?.popViewController(animated: true) + } + } +} + +extension ArchiveAllVC: UITableViewDelegate, UITableViewDataSource { + + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + return 34 + } + + func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { + return 30 + } + + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + guard let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: ArchiveAllHeaderView.reuseIdentifier) as? ArchiveAllHeaderView else { + return UITableViewHeaderFooterView() + } + + return data.isEmpty ? nil : header + } + + func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { + return UIView() + } + + func numberOfSections(in tableView: UITableView) -> Int { + tableView.backgroundView = data.isEmpty ? emptyView : nil + return month.count + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return data.isEmpty ? 0 : data.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: ArchiveTVC.reuseIdentifier) as! ArchiveTVC + cell.configure(withAll: data[indexPath.row]) + return cell + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveDetailVC.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveDetailVC.swift new file mode 100644 index 0000000..4aba1d6 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveDetailVC.swift @@ -0,0 +1,88 @@ +// +// ArchiveDetailVC.swift +// MEEW-Client +// +// Created by taekki on 2022/08/25. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveDetailVC: BaseVC { + + let rootView = ArchiveDetailView() + lazy var datePicker = UIDatePicker() + + var data: Specific? { didSet { rootView.tableView.reloadData() } } + + override func loadView() { + self.view = rootView + } + + override func viewDidLoad() { + super.viewDidLoad() + + configureTableView() + configureTarget() + requestArchive() + } + + private func configureTableView() { + rootView.tableView.delegate = self + rootView.tableView.dataSource = self + rootView.tableView.register(ArchiveTodoTVC.self, forCellReuseIdentifier: ArchiveTodoTVC.reuseIdentifier) + rootView.tableView.rowHeight = 56 + rootView.tableView.isScrollEnabled = false + rootView.tableView.separatorStyle = .singleLine + rootView.tableView.separatorInset = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8) + rootView.tableView.separatorColor = .grey500 + } + + private func configureTarget() { + rootView.dateButton.addTarget(self, action: #selector(pickDate), for: .touchUpInside) + rootView.closeButton.addTarget(self, action: #selector(close), for: .touchUpInside) + } +} + +extension ArchiveDetailVC: UITableViewDelegate, UITableViewDataSource { + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return data?.fail?.count ?? 0 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: ArchiveTodoTVC.reuseIdentifier) as? ArchiveTodoTVC else { + return UITableViewCell() + } + cell.configure(data?.fail?[indexPath.row]) + return cell + } +} + +extension ArchiveDetailVC { + + @objc func pickDate() { + DatePickerView.shared.show() + } + + @objc func close() { + dismiss(animated: true) + } + + private func requestArchive() { + ArchiveService.shared.fetchSpecificArchive(for: "2022-09-11") { response in + switch response { + case .success(let result): + guard let response = result as? SpecificArchiveDTO else { return } + if let data = response.data { + self.data = data + } + default: + print("error") + return + } + } + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveVC.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveVC.swift new file mode 100644 index 0000000..44e5dcb --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Controller/ArchiveVC.swift @@ -0,0 +1,125 @@ +// +// ArchiveVC.swift +// MEEW-Client +// +// Created by taekki on 2022/08/18. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveVC: BaseVC { + + // MARK: - Properties + + var data: [Recent] = [] { didSet { tableView.reloadData() } } + var today: Today? { didSet { archiveBannerView.configure(today) } } + + // MARK: - UI Properties + + lazy var navigationBarView = NavigationBarView(withRightItemImage: ImageLiterals.settingIcon).then { + $0.title = "나의 기록" + } + lazy var archiveBannerView = ArchiveBannerView() + lazy var archiveHeaderView = ArchiveHeaderView() + lazy var emptyView = ArchiveEmptyView() + let progressView = ArchiveLevelProgressView() + let tableView = UITableView().then { + $0.isScrollEnabled = false + } + + override func viewDidLoad() { + super.viewDidLoad() + + configureUI() + configureLayout() + configureTableView() + archiveHeaderView.delegate = self + + requestRecentArchive() + } + + private func requestRecentArchive() { + ArchiveService.shared.fetchRecentArchive { response in + switch response { + case .success(let result): + guard let response = result as? RecentArchiveDTO else { return } + if let data = response.data, + let recent = data.recent { + self.today = data.today + self.data = recent + } + default: + return + } + } + } +} + +extension ArchiveVC { + + private func configureUI() { + view.backgroundColor = .grey700 + archiveBannerView.layer.cornerRadius = 8 + } + + private func configureLayout() { + view.addSubviews([navigationBarView, archiveBannerView, archiveHeaderView, tableView]) + + navigationBarView.snp.makeConstraints { + $0.height.equalTo(48) + $0.top.equalTo(view.safeAreaLayoutGuide) + $0.leading.trailing.equalToSuperview() + } + + archiveBannerView.snp.makeConstraints { + $0.top.equalTo(navigationBarView.snp.bottom).offset(18) + $0.leading.trailing.equalToSuperview().inset(20) + $0.height.equalTo(180) + } + + archiveHeaderView.snp.makeConstraints { + $0.top.equalTo(archiveBannerView.snp.bottom).offset(30) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(40) + } + + tableView.snp.makeConstraints { + $0.top.equalTo(archiveHeaderView.snp.bottom) + $0.leading.trailing.equalToSuperview() + $0.bottom.equalToSuperview().inset(80) + } + } + + private func configureTableView() { + tableView.backgroundColor = .clear + tableView.delegate = self + tableView.dataSource = self + tableView.register(ArchiveTVC.self, forCellReuseIdentifier: ArchiveTVC.reuseIdentifier) + tableView.rowHeight = UITableView.automaticDimension + } +} + +extension ArchiveVC: UITableViewDelegate, UITableViewDataSource { + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + tableView.backgroundView = data.isEmpty ? emptyView : nil + return data.isEmpty ? 0 : data.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: ArchiveTVC.reuseIdentifier) as! ArchiveTVC + cell.configure(data[indexPath.row]) + return cell + } +} + +extension ArchiveVC: ArchiveHeaderViewDelegate { + + func archiveButtonTapped() { + let archiveAllVC = ArchiveAllVC() + navigationController?.pushViewController(archiveAllVC, animated: true) + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Result/MEEWPopUp.swift b/MEEW-Client/MEEW-Client/Screens/Archive/MEEWPopUp.swift similarity index 100% rename from MEEW-Client/MEEW-Client/Screens/Result/MEEWPopUp.swift rename to MEEW-Client/MEEW-Client/Screens/Archive/MEEWPopUp.swift diff --git a/MEEW-Client/MEEW-Client/Screens/Result/MEEWPopUp.xib b/MEEW-Client/MEEW-Client/Screens/Archive/MEEWPopUp.xib similarity index 100% rename from MEEW-Client/MEEW-Client/Screens/Result/MEEWPopUp.xib rename to MEEW-Client/MEEW-Client/Screens/Archive/MEEWPopUp.xib diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Model/AllArchiveDTO.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Model/AllArchiveDTO.swift new file mode 100644 index 0000000..a93025b --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Model/AllArchiveDTO.swift @@ -0,0 +1,37 @@ +// +// AllArchiveDTO.swift +// MEEW-Client +// +// Created by taekki on 2022/09/15. +// + +import Foundation + +struct AllArchiveDTO: Codable { + let status: Int + let success: Bool + let message: String + let data: AllArchiveData? +} + +struct AllArchiveData: Codable { + let all: [All]? +} + +struct All: Codable { + let date: String + let recentEnum: Int + let name: String + let imgURL: String + let percent: Int + let done: Int + let fail: Int + + enum CodingKeys: String, CodingKey { + case date + case recentEnum = "enum" + case name + case imgURL = "imgUrl" + case percent, done, fail + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Model/RecentArchiveDTO.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Model/RecentArchiveDTO.swift new file mode 100644 index 0000000..1e25bc5 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Model/RecentArchiveDTO.swift @@ -0,0 +1,60 @@ +// +// RecentArchiveDTO.swift +// MEEW-Client +// +// Created by taekki on 2022/09/15. +// + + +import Foundation + +struct RecentArchiveDTO: Codable { + let status: Int + let success: Bool + let message: String + let data: RecentArchiveData? +} + +struct RecentArchiveData: Codable { + let today: Today? + let recent: [Recent]? +} + +struct Today: Codable { + let todayEnum: Int + let name: String + let desc: String + + enum CodingKeys: String, CodingKey { + case todayEnum = "enum" + case name, desc + } +} + +struct Recent: Codable { + let date: String + let recentEnum: Int + let name: String + let imgURL: String + let percent: Int + let done: [Task]? + let fail: [Task]? + + enum CodingKeys: String, CodingKey { + case date + case recentEnum = "enum" + case name + case imgURL = "imgUrl" + case percent, done, fail + } +} + +struct Task: Codable { + let taskID: Int + let content: String + + enum CodingKeys: String, CodingKey { + case taskID = "taskId" + case content + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Model/SpecificArchiveDTO.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Model/SpecificArchiveDTO.swift new file mode 100644 index 0000000..f623306 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Model/SpecificArchiveDTO.swift @@ -0,0 +1,39 @@ +// +// SpecificArchiveDTO.swift +// MEEW-Client +// +// Created by taekki on 2022/09/15. +// + +import Foundation + +struct SpecificArchiveDTO: Codable { + let status: Int + let success: Bool + let message: String + let data: Specific? +} + +struct Specific: Codable { + let recentEnum: Int + let name: String + let desc: String + let percent: Int + let done: [SpecificTask]? + let fail: [SpecificTask]? + + enum CodingKeys: String, CodingKey { + case recentEnum = "enum" + case name, desc, percent, done, fail + } +} + +struct SpecificTask: Codable { + let taskID: String + let content: String + + enum CodingKeys: String, CodingKey { + case taskID = "taskId" + case content + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/Service/ArchiveService.swift b/MEEW-Client/MEEW-Client/Screens/Archive/Service/ArchiveService.swift new file mode 100644 index 0000000..3235991 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/Service/ArchiveService.swift @@ -0,0 +1,128 @@ +// +// ArchiveService.swift +// MEEW-Client +// +// Created by taekki on 2022/09/15. +// + +import Alamofire + +protocol ArchiveServiceRepository: AnyObject { + func fetchRecentArchive(completion: @escaping (NetworkResult) -> Void) + func fetchAllArchive(page: Int, completion: @escaping (NetworkResult) -> Void) + func fetchSpecificArchive(for date: String, completion: @escaping (NetworkResult) -> Void) +} + +final class ArchiveService: ArchiveServiceRepository { + + static let shared = ArchiveService() + private init() {} + + func fetchRecentArchive(completion: @escaping (NetworkResult) -> Void) { + let URL = APIConstants.recentArchiveURL + let header: HTTPHeaders = ["Content-Type" : "application/json"] + let dataRequest = AF.request(URL, + method: .get, + encoding: JSONEncoding.default, + headers: header) + dataRequest.responseData { dataResponse in + switch dataResponse.result { + case .success: + guard let statusCode = dataResponse.response?.statusCode else { return } + guard let value = dataResponse.value else { return } + let networkResult = self.judgeStatusForRecent(by: statusCode, value) + completion(networkResult) + + case .failure: + completion(.pathErr) + } + } + } + + func fetchAllArchive(page: Int, completion: @escaping (NetworkResult) -> Void) { + let URL = APIConstants.allArchiveURL + "?page=\(page)" + let header: HTTPHeaders = ["Content-Type" : "application/json"] + let dataRequest = AF.request(URL, + method: .get, + encoding: JSONEncoding.default, + headers: header) + dataRequest.responseData { dataResponse in + switch dataResponse.result { + case .success: + guard let statusCode = dataResponse.response?.statusCode else { return } + guard let value = dataResponse.value else { return } + let networkResult = self.judgeStatusForAll(by: statusCode, value) + completion(networkResult) + + case .failure: + completion(.pathErr) + } + } + } + + func fetchSpecificArchive(for date: String, completion: @escaping (NetworkResult) -> Void) { + let URL = APIConstants.archiveForDateURL + "?date=\(date)" + let header: HTTPHeaders = ["Content-Type" : "application/json"] + let dataRequest = AF.request(URL, + method: .get, + encoding: JSONEncoding.default, + headers: header) + dataRequest.responseData { dataResponse in + switch dataResponse.result { + case .success: + guard let statusCode = dataResponse.response?.statusCode else { return } + guard let value = dataResponse.value else { return } + let networkResult = self.judgeStatusForSpecific(by: statusCode, value) + completion(networkResult) + + case .failure: + completion(.pathErr) + } + } + } + + private func judgeStatusForRecent(by statusCode: Int, _ data: Data) -> NetworkResult { + switch statusCode { + case 200: return isValidDataForRecent(data: data) + case 400: return .pathErr + case 500: return .serverErr + default: return .networkFail + } + } + + private func judgeStatusForAll(by statusCode: Int, _ data: Data) -> NetworkResult { + switch statusCode { + case 200: return isValidDataForAll(data: data) + case 400: return .pathErr + case 500: return .serverErr + default: return .networkFail + } + } + + private func judgeStatusForSpecific(by statusCode: Int, _ data: Data) -> NetworkResult { + switch statusCode { + case 200: return isValidDataForSpecific(data: data) + case 400: return .pathErr + case 500: return .serverErr + default: return .networkFail + } + } + + private func isValidDataForRecent(data: Data) -> NetworkResult { + let decoder = JSONDecoder() + guard let decodedData = try? decoder.decode(RecentArchiveDTO.self, from: data) else { return .pathErr } + return .success(decodedData) + } + + private func isValidDataForAll(data: Data) -> NetworkResult { + let decoder = JSONDecoder() + guard let decodedData = try? decoder.decode(AllArchiveDTO.self, from: data) else { return .pathErr } + return .success(decodedData) + } + + private func isValidDataForSpecific(data: Data) -> NetworkResult { + let decoder = JSONDecoder() + guard let decodedData = try? decoder.decode(SpecificArchiveDTO.self, from: data) else { return .pathErr } + return .success(decodedData) + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveAllHeaderView.swift b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveAllHeaderView.swift new file mode 100644 index 0000000..c1024c5 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveAllHeaderView.swift @@ -0,0 +1,59 @@ +// +// ArchiveAllHeaderView.swift +// MEEW-Client +// +// Created by taekki on 2022/08/18. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveAllHeaderView: UITableViewHeaderFooterView { + + static let reuseIdentifier = "ArchiveAllHeaderView" + + private let timeLabel = UILabel().then { + $0.text = "YYYY년 M월" + $0.textColor = .grey400 + $0.font = .body3 + } + + private let lineView = UIView().then { + $0.backgroundColor = .grey500 + } + + override init(reuseIdentifier: String?) { + super.init(reuseIdentifier: reuseIdentifier) + + configureUI() + configureLayout() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + super.init(coder: coder) + } +} + +extension ArchiveAllHeaderView { + + func configureUI() { + } + + private func configureLayout() { + self.addSubviews([timeLabel, lineView]) + + timeLabel.snp.makeConstraints { + $0.leading.equalToSuperview().inset(20) + $0.top.equalToSuperview().inset(8) + } + + lineView.snp.makeConstraints { + $0.top.equalTo(timeLabel.snp.bottom).offset(8) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(0.5) + } + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveBannerView.swift b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveBannerView.swift new file mode 100644 index 0000000..ed0cdce --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveBannerView.swift @@ -0,0 +1,92 @@ +// +// ArchiveBannerView.swift +// MEEW-Client +// +// Created by taekki on 2022/08/18. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveBannerView: UIView { + + private lazy var characterImageView = UIImageView().then { + $0.contentMode = .scaleAspectFill + $0.image = ImageLiterals.imageCharacterToday + } + + private let todayLabel = UILabel().then { + $0.text = "Today" + $0.textColor = .grey300 + $0.font = .body2 + } + + private let characterNameLabel = UILabel().then { + $0.text = "적극적인 태양이" + $0.textColor = .white + $0.font = .head3 + } + + private let characterDescriptionLabel = UILabel().then { + $0.text = "마음이는 늘 상대방의 마음을 먼저 생각해요. 항상 타인의 말에..." + $0.textColor = .grey300 + $0.font = .body3 + $0.numberOfLines = 0 + $0.lineBreakMode = .byCharWrapping + } + + override init(frame: CGRect) { + super.init(frame: frame) + + configureUI() + configureLayout() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + super.init(coder: coder) + } +} + +extension ArchiveBannerView { + + private func configureUI() { + self.backgroundColor = .grey600 + } + + private func configureLayout() { + self.addSubviews([characterImageView, todayLabel, characterNameLabel, characterDescriptionLabel]) + + characterImageView.snp.makeConstraints { + $0.width.height.equalTo(140) + $0.leading.equalToSuperview().inset(8) + $0.top.bottom.equalToSuperview().inset(20) + } + + todayLabel.snp.makeConstraints { + $0.leading.equalTo(characterImageView.snp.trailing).offset(6) + $0.top.equalToSuperview().inset(53) + $0.height.equalTo(18) + } + + characterNameLabel.snp.makeConstraints { + $0.leading.equalTo(todayLabel) + $0.top.equalTo(todayLabel.snp.bottom).offset(8) + $0.height.equalTo(24) + } + + characterDescriptionLabel.snp.makeConstraints { + $0.leading.equalTo(todayLabel) + $0.trailing.equalToSuperview().inset(22) + $0.top.equalTo(characterNameLabel.snp.bottom).offset(8) + $0.bottom.equalToSuperview().inset(33) + } + } + + func configure(_ data: Today?) { + characterNameLabel.text = data?.name + characterDescriptionLabel.text = data?.desc + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveDetailView.swift b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveDetailView.swift new file mode 100644 index 0000000..f448c54 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveDetailView.swift @@ -0,0 +1,135 @@ +// +// ArchiveDetailView.swift +// MEEW-Client +// +// Created by taekki on 2022/08/25. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveDetailView: UIView { + + let dateLabel = UILabel() + let dateButton = UIButton() + let closeButton = UIButton() + let containerView = UIView() + let progressView = ArchiveLevelProgressView() + let nameLabel = UILabel() + let characterImageView = UIImageView() + let tableView = UITableView(frame: .zero, style: .plain) + + override init(frame: CGRect) { + super.init(frame: frame) + + configureUI() + configureLayout() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + func configureUI() { + + backgroundColor = .grey700 + + dateLabel.do { + $0.text = "2022.02.26" + $0.textColor = .white + $0.font = .head3 + } + + dateButton.do { + $0.setImage(ImageLiterals.icnArrowDown, for: .normal) + $0.contentMode = .scaleAspectFill + } + + closeButton.do { + $0.setImage(ImageLiterals.icnClose, for: .normal) + $0.contentMode = .scaleAspectFill + } + + containerView.do { + $0.layer.borderWidth = 0.5 + $0.layer.borderColor = UIColor.grey400.cgColor + $0.layer.cornerRadius = 8 + } + + nameLabel.do { + $0.text = "즉흥적인 바람이" + $0.textColor = .white + $0.font = .head3 + } + + characterImageView.do { + $0.image = ImageLiterals.imageCharacterToday + $0.contentMode = .scaleAspectFill + } + + tableView.do { + $0.backgroundColor = .clear + } + } + + func configureLayout() { + + addSubviews([dateLabel, dateButton, closeButton, containerView]) + containerView.addSubviews([progressView, nameLabel, characterImageView, tableView]) + + dateLabel.snp.makeConstraints { + $0.top.equalTo(safeAreaLayoutGuide).inset(13) + $0.centerX.equalToSuperview() + $0.height.equalTo(24) + } + + dateButton.snp.makeConstraints { + $0.leading.equalTo(dateLabel.snp.trailing).inset(2) + $0.size.equalTo(48) + $0.centerY.equalTo(dateLabel) + } + + closeButton.snp.makeConstraints { + $0.trailing.equalToSuperview().inset(2) + $0.size.equalTo(48) + $0.centerY.equalTo(dateButton) + } + + containerView.snp.makeConstraints { + $0.top.equalTo(safeAreaLayoutGuide).inset(81) + $0.leading.trailing.equalToSuperview().inset(20) + $0.height.equalTo(506) + } + + progressView.snp.makeConstraints { + $0.top.equalToSuperview().inset(24) + $0.width.equalTo(87) + $0.height.equalTo(22) + $0.centerX.equalToSuperview() + } + + nameLabel.snp.makeConstraints { + $0.top.equalTo(progressView.snp.bottom).offset(12) + $0.centerX.equalToSuperview() + $0.height.equalTo(24) + } + + characterImageView.snp.makeConstraints { + $0.top.equalTo(nameLabel.snp.bottom).offset(24) + $0.size.equalTo(168) + $0.centerX.equalToSuperview() + } + + tableView.snp.makeConstraints { + $0.top.equalTo(characterImageView.snp.bottom).offset(8) + $0.leading.trailing.equalToSuperview() + $0.bottom.equalToSuperview().inset(16) + } + } + + func configure(_ data: Specific) { + nameLabel.text = data.name + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveEmptyView.swift b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveEmptyView.swift new file mode 100644 index 0000000..bcd3225 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveEmptyView.swift @@ -0,0 +1,54 @@ +// +// ArchiveEmptyView.swift +// MEEW-Client +// +// Created by taekki on 2022/08/18. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveEmptyView: UIView { + + lazy var imageView = UIImageView().then { + $0.contentMode = .scaleAspectFill + $0.image = ImageLiterals.imageCharacterNothing + } + + private let descriptionLabel = UILabel().then { + $0.text = "아직 기록이 없어요." + $0.textColor = .white + $0.font = .body2 + } + + override init(frame: CGRect) { + super.init(frame: frame) + + configureLayout() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + super.init(coder: coder) + } +} + +extension ArchiveEmptyView { + + func configureLayout() { + self.addSubviews([imageView, descriptionLabel]) + + imageView.snp.makeConstraints { + $0.centerX.equalToSuperview() + $0.centerY.equalToSuperview().inset(14) + $0.width.height.equalTo(100) + } + + descriptionLabel.snp.makeConstraints { + $0.top.equalTo(imageView.snp.bottom).offset(8) + $0.centerX.equalTo(imageView) + } + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveHeaderView.swift b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveHeaderView.swift new file mode 100644 index 0000000..6856288 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveHeaderView.swift @@ -0,0 +1,78 @@ +// +// ArchiveHeaderView.swift +// MEEW-Client +// +// Created by taekki on 2022/08/18. +// + +import UIKit + +import SnapKit +import Then + +protocol ArchiveHeaderViewDelegate: AnyObject { + func archiveButtonTapped() +} + +final class ArchiveHeaderView: UIView { + + private let titleLabel = UILabel().then { + $0.text = "최근기록" + $0.textColor = .white + $0.font = .title4 + } + + private lazy var archiveButton = UIButton().then { + $0.setTitle("전체보기", for: .normal) + $0.setTitleColor(.grey300, for: .normal) + $0.titleLabel?.font = .body2 + } + + private let lineView = UIView().then { + $0.backgroundColor = .grey500 + } + + weak var delegate: ArchiveHeaderViewDelegate? + + override init(frame: CGRect) { + super.init(frame: frame) + + configureLayout() + archiveButton.addTarget(self, action: #selector(archiveButtonTapped), for: .touchUpInside) + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + super.init(coder: coder) + } +} + +extension ArchiveHeaderView { + + private func configureLayout() { + self.addSubviews([titleLabel, archiveButton, lineView]) + + titleLabel.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.equalToSuperview().inset(20) + $0.height.equalTo(24) + } + + archiveButton.snp.makeConstraints { + $0.trailing.equalToSuperview().inset(20) + $0.centerY.equalTo(titleLabel) + $0.height.equalTo(18) + } + + lineView.snp.makeConstraints { + $0.top.equalTo(titleLabel.snp.bottom).offset(16) + $0.leading.trailing.equalToSuperview().inset(20) + $0.height.equalTo(0.5) + } + } + + @objc func archiveButtonTapped() { + delegate?.archiveButtonTapped() + } +} + diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveLevelProgressView.swift b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveLevelProgressView.swift new file mode 100644 index 0000000..cbe819b --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/View/ArchiveLevelProgressView.swift @@ -0,0 +1,67 @@ +// +// ArchiveLevelProgressView.swift +// MEEW-Client +// +// Created by taekki on 2022/08/18. +// + +import UIKit + +import SnapKit +import Then + +final class ArchiveLevelProgressView: UIView { + + private let levelLabel = UILabel().then { + $0.text = "Lv.1" + $0.textColor = .purple + $0.font = .body3 + } + + private lazy var progressHStackView = UIStackView().then { + $0.axis = .horizontal + $0.distribution = .fillEqually + $0.spacing = 4 + + for index in 0...3 { + let pointView = UIView() + pointView.backgroundColor = .grey700 + pointView.layer.cornerRadius = 2 + $0.addArrangedSubview(pointView) + } + } + + override init(frame: CGRect) { + super.init(frame: frame) + + configureUI() + configureLayout() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + super.init(coder: coder) + } +} + +extension ArchiveLevelProgressView { + + private func configureUI() { + self.backgroundColor = .grey600 + } + + private func configureLayout() { + addSubviews([levelLabel, progressHStackView]) + levelLabel.snp.makeConstraints { + $0.leading.equalToSuperview().inset(10) + $0.top.bottom.equalTo(2) + } + + progressHStackView.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.height.equalTo(6) + $0.leading.equalTo(levelLabel.snp.trailing).offset(8) + $0.trailing.equalToSuperview().inset(10) + } + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Archive/View/DatePickerView.swift b/MEEW-Client/MEEW-Client/Screens/Archive/View/DatePickerView.swift new file mode 100644 index 0000000..5c53a88 --- /dev/null +++ b/MEEW-Client/MEEW-Client/Screens/Archive/View/DatePickerView.swift @@ -0,0 +1,66 @@ +// +// DatePickerView.swift +// MEEW-Client +// +// Created by taekki on 2022/08/25. +// + +import UIKit + +import SnapKit +import Then + +final class DatePickerView: UIView { + + static let shared = DatePickerView() + + private lazy var datePicker = UIDatePicker().then { + $0.preferredDatePickerStyle = .inline + $0.locale = Locale(identifier: "ko-KR") + $0.layer.masksToBounds = true + $0.layer.cornerRadius = 8 + $0.overrideUserInterfaceStyle = .dark + $0.backgroundColor = .grey500 + } + + override init(frame: CGRect) { + super.init(frame: frame) + setupConstraints() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + self.hide() + } + + func setupConstraints() { + self.backgroundColor = .black.withAlphaComponent(0.5) + self.addSubview(self.datePicker) + + self.datePicker.snp.makeConstraints { + $0.center.equalTo(self.safeAreaLayoutGuide) + $0.leading.trailing.equalToSuperview().inset(20) + } + + datePicker.subviews.first?.subviews.first?.subviews.first?.tintColor = .white + } + + func show() { + let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene + guard let sceneDelegate = windowScene?.delegate as? SceneDelegate else { return } + + guard !(sceneDelegate.window?.subviews.contains(where: { $0 is DatePickerView }))! else { return } + sceneDelegate.window?.rootViewController?.view.addSubview(self) + self.snp.makeConstraints { + $0.edges.equalToSuperview() + } + self.layoutIfNeeded() + } + + func hide() { + self.removeFromSuperview() + } +} diff --git a/MEEW-Client/MEEW-Client/Screens/Result/Controller/ResultVC.swift b/MEEW-Client/MEEW-Client/Screens/Result/Controller/ResultVC.swift deleted file mode 100644 index fc00041..0000000 --- a/MEEW-Client/MEEW-Client/Screens/Result/Controller/ResultVC.swift +++ /dev/null @@ -1,72 +0,0 @@ -// -// ResultVC.swift -// MEEW-Client -// -// Created by taehy.k on 2021/11/21. -// - -import UIKit - -final class ResultVC: BaseVC { - - @IBOutlet weak var todayContainerView: UIView! - @IBOutlet weak var tableView: UITableView! - @IBOutlet weak var emptyView: UIView! - @IBOutlet weak var todayView: UIView! - @IBOutlet weak var todayEmptyView: UIView! - - private var dataSourceCount: Int = 0 { - didSet { - updateUI() - } - } - - override func viewDidLoad() { - super.viewDidLoad() - setupUI() - updateUI() - setupTableView() - } - - private func setupUI() { - todayContainerView.layer.cornerRadius = 8 - todayEmptyView.isHidden = true - } - - private func setupTableView() { - tableView.delegate = self - tableView.dataSource = self - - let nib = UINib(nibName: ReportTableViewCell.identifier, bundle: nil) - tableView.register(nib, forCellReuseIdentifier: ReportTableViewCell.identifier) - - tableView.backgroundColor = .clear - } - - private func updateUI() { - if dataSourceCount != 0 { - todayView.isHidden = false - todayEmptyView.isHidden = true - } else { - todayView.isHidden = true - todayEmptyView.isHidden = false - } - } -} - -extension ResultVC: UITableViewDelegate {} - -extension ResultVC: UITableViewDataSource { - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - emptyView.isHidden = dataSourceCount != 0 - return dataSourceCount - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell( - withIdentifier: ReportTableViewCell.identifier, - for: indexPath - ) as? ReportTableViewCell else { return UITableViewCell() } - return cell - } -} diff --git a/MEEW-Client/MEEW-Client/Screens/Result/Storyboard/ResultVC.storyboard b/MEEW-Client/MEEW-Client/Screens/Result/Storyboard/ResultVC.storyboard deleted file mode 100644 index 1fbe619..0000000 --- a/MEEW-Client/MEEW-Client/Screens/Result/Storyboard/ResultVC.storyboard +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - - - SpoqaHanSansNeo-Bold - - - SpoqaHanSansNeo-Medium - - - SpoqaHanSansNeo-Regular - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MEEW-Client/MEEW-Client/Screens/Result/View/ReportTableViewCell.swift b/MEEW-Client/MEEW-Client/Screens/Result/View/ReportTableViewCell.swift deleted file mode 100644 index cdef0a7..0000000 --- a/MEEW-Client/MEEW-Client/Screens/Result/View/ReportTableViewCell.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ReportTableViewCell.swift -// MEEW-Client -// -// Created by taehy.k on 2022/03/11. -// - -import UIKit - -class ReportTableViewCell: UITableViewCell { - - static let identifier = "ReportTableViewCell" - - @IBOutlet weak var progressContainerView: UIView! - @IBOutlet weak var progressView: UIView! - - override func awakeFromNib() { - super.awakeFromNib() - setupUI() - } - - private func setupUI() { - progressContainerView.layer.cornerRadius = progressContainerView.bounds.height / 2 - progressView.layer.cornerRadius = progressView.bounds.height / 2 - } -} diff --git a/MEEW-Client/MEEW-Client/Screens/Result/View/ReportTableViewCell.xib b/MEEW-Client/MEEW-Client/Screens/Result/View/ReportTableViewCell.xib deleted file mode 100644 index 77ece75..0000000 --- a/MEEW-Client/MEEW-Client/Screens/Result/View/ReportTableViewCell.xib +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - SpoqaHanSansNeo-Medium - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MEEW-Client/MEEW-Client/Screens/Setting/View/NavigationBarView.swift b/MEEW-Client/MEEW-Client/Screens/Setting/View/NavigationBarView.swift index 6e061af..8e3cc52 100644 --- a/MEEW-Client/MEEW-Client/Screens/Setting/View/NavigationBarView.swift +++ b/MEEW-Client/MEEW-Client/Screens/Setting/View/NavigationBarView.swift @@ -17,8 +17,7 @@ final class NavigationBarView: UIView { $0.addTarget(self, action: #selector(dismissViewController), for: .touchUpInside) } - let navigationTitleLabel = UILabel().then { - $0.text = "설정" + lazy var navigationTitleLabel = UILabel().then { $0.textColor = .white $0.font = UIFont(name: "SpoqaHanSansNeo-Bold", size: 18)! } @@ -29,6 +28,15 @@ final class NavigationBarView: UIView { $0.titleLabel?.font = UIFont.body1 } + lazy var rightItemButton = UIButton().then { + $0.isHidden = true + } + + var title: String? { + didSet { + navigationTitleLabel.text = title + } + } var dismissClosure: (() -> ())? override init(frame: CGRect) { @@ -46,8 +54,16 @@ final class NavigationBarView: UIView { doneButton.isHidden = !hasDoneButton } + convenience init(withRightItemImage: UIImage) { + self.init(frame: .zero) + navigationBackButton.isHidden = true + doneButton.isHidden = true + rightItemButton.isHidden = false + rightItemButton.setImage(withRightItemImage, for: .normal) + } + private func setStyle() { - self.addSubviews([navigationBackButton, navigationTitleLabel, doneButton]) + self.addSubviews([navigationBackButton, navigationTitleLabel, doneButton, rightItemButton]) navigationBackButton.snp.makeConstraints { $0.top.bottom.equalToSuperview() @@ -64,6 +80,12 @@ final class NavigationBarView: UIView { $0.width.equalTo(30) $0.height.equalTo(24) } + + rightItemButton.snp.makeConstraints { + $0.width.height.equalTo(48) + $0.trailing.equalToSuperview().inset(4) + $0.centerY.equalTo(navigationTitleLabel) + } } @objc