From 3236323d3032899b6fb984ababf434ab55c572f3 Mon Sep 17 00:00:00 2001 From: yeonwoo Date: Thu, 1 Jun 2023 14:13:32 +0900 Subject: [PATCH 1/7] =?UTF-8?q?[Fix]=20editmode=20=EC=A2=85=EB=A3=8C?= =?UTF-8?q?=EC=8B=9C=20reload()=20=ED=95=A0=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/CourseListView/PrivateCourseListView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift index 08256ebd..86d1de70 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift @@ -119,7 +119,7 @@ extension PrivateCourseListView { extension PrivateCourseListView { @objc func editButtonDidTap() { isEditMode.toggle() - + self.courseListCollectionView.reloadData() self.delegate?.courseListEditButtonTapped() } From f19d48371a7170895e1319760915c564692bf39d Mon Sep 17 00:00:00 2001 From: yeonwoo Date: Thu, 1 Jun 2023 14:51:08 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[Fix]=20=EC=97=85=EB=A1=9C=EB=93=9C?= =?UTF-8?q?=ED=95=9C=20=EC=BD=94=EC=8A=A4=20=ED=8E=B8=EC=A7=91=20=EC=B7=A8?= =?UTF-8?q?=EC=86=8C=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrivateCourseListView.swift | 1 - .../VC/InfoVC/UploadedCourseInfoVC.swift | 38 +++++++++---------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift index 86d1de70..9ace1d60 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift @@ -228,7 +228,6 @@ extension PrivateCourseListView: UICollectionViewDelegate, UICollectionViewDataS if isEditMode { cell.selectCell(didSelect: false) } - delegate?.selectCellDidTapped() } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift index b713da69..b3fc1398 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift @@ -127,10 +127,15 @@ extension UploadedCourseInfoVC { self.editButton.addTarget(self, action: #selector(editButtonDidTap), for: .touchUpInside) } + private func deselectAllItems() { + guard let selectedItems = UploadedCourseInfoCollectionView.indexPathsForSelectedItems else { return } + for indexPath in selectedItems { UploadedCourseInfoCollectionView.deselectItem(at: indexPath, animated: false) } + } private func setDeleteButton() { deleteCourseButton.addTarget(self, action: #selector(deleteCourseButtonDidTap), for: .touchUpInside) } + } // MARK: - @objc Function @@ -160,18 +165,19 @@ extension UploadedCourseInfoVC { self.editButton.setTitle("편집", for: .normal) self.deleteCourseButton.isEnabled = false self.deleteCourseButton.setTitle(title: "삭제하기") - self.courseListCollectionView.reloadData() - isEditMode = false + self.deselectAllItems() self.deleteCourseButton.isHidden = true + self.UploadedCourseInfoCollectionView.reloadData() + isEditMode.toggle() } else { self.totalNumOfRecordlabel.text = "기록 선택" self.editButton.setTitle("취소", for: .normal) - self.deleteCourseButton.isHidden = false - self.courseListCollectionView.reloadData() - isEditMode = true + self.UploadedCourseInfoCollectionView.reloadData() + isEditMode.toggle() } } + } extension UploadedCourseInfoVC { @@ -257,7 +263,7 @@ extension UploadedCourseInfoVC: UICollectionViewDelegateFlowLayout { // MARK: - UICollectionViewDataSource -extension UploadedCourseInfoVC: UICollectionViewDataSource { +extension UploadedCourseInfoVC: UICollectionViewDelegate,UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return uploadedCourseList.count } @@ -266,23 +272,15 @@ extension UploadedCourseInfoVC: UICollectionViewDataSource { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CourseListCVC.className, for: indexPath) as? CourseListCVC else { return UICollectionViewCell() } cell.setCellType(type: .title) + if let selectedCells = collectionView.indexPathsForSelectedItems, selectedCells.contains(indexPath) { + cell.selectCell(didSelect: true) + } else { + cell.selectCell(didSelect: false) + } + let model = uploadedCourseList[indexPath.item] let cellTitle = "\(model.departure.region) \(model.departure.city)" cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil) - - if isEditMode { - // selectCell 표시 - if let selectedCells = collectionView.indexPathsForSelectedItems, selectedCells.contains(indexPath) { - cell.selectCell(didSelect: false) - } else { cell.selectCell(didSelect: true) - } - } else { - cell.setCellType(type: .title) - guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CourseListCVC.className, - for: indexPath) - as? CourseListCVC else { return UICollectionViewCell() } - cell.setCellType(type: .title) - } return cell } From f694b8ba6d0411fffd7fb080468dc8ef0fe6d09c Mon Sep 17 00:00:00 2001 From: yeonwoo Date: Thu, 1 Jun 2023 15:46:32 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[Feat]=20#163=20-=20=EC=85=80=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=EB=B0=95=EC=8A=A4=20UI=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/ImageLiterals.swift | 3 ++ .../ic_check.imageset/Contents.json | 23 ++++++++++++++++ .../ic_check.imageset/Group 9499.png | Bin 0 -> 543 bytes .../ic_check.imageset/Group 9499@2x.png | Bin 0 -> 1037 bytes .../ic_check.imageset/Group 9499@3x.png | Bin 0 -> 1414 bytes .../ic_check_fill.imageset/Contents.json | 23 ++++++++++++++++ .../ic_check_fill.imageset/Group 9515.png | Bin 0 -> 582 bytes .../ic_check_fill.imageset/Group 9515@2x.png | Bin 0 -> 1041 bytes .../ic_check_fill.imageset/Group 9515@3x.png | Bin 0 -> 1396 bytes .../Views/VC/CourseDiscoveryVC.swift | 2 +- .../Views/VC/CourseSearchVC.swift | 2 +- .../Views/VC/MyCourseSelectVC.swift | 2 +- .../Views/CVC/CourseListCVC.swift | 26 ++++++++++++++++-- .../PrivateCourseListView.swift | 2 +- .../CourseListView/ScrapCourseListView.swift | 2 +- .../VC/InfoVC/UploadedCourseInfoVC.swift | 2 +- 16 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Contents.json create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Group 9499.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Group 9499@2x.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Group 9499@3x.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Contents.json create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515@2x.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515@3x.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift index 20cc7de1..41d4c285 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift @@ -44,6 +44,9 @@ enum ImageLiterals { static var icLogoCircle: UIImage { .load(named: "ic_logo_circle") } static var icMore: UIImage { .load(named: "ic_more") } static var icPlus: UIImage { .load(named: "ic_plus") } + static var icCheck: UIImage { .load(named: "ic_check") } + static var icCheckFill: UIImage { .load(named: "ic_check_fill") } + // img static var imgBackground: UIImage { .load(named: "img_background") } diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Contents.json new file mode 100644 index 00000000..112b03c2 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Group 9499.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 9499@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 9499@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Group 9499.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Group 9499.png new file mode 100644 index 0000000000000000000000000000000000000000..8bf3ea8fde96f3e1304276397ad8b70c1c79cf53 GIT binary patch literal 543 zcmV+)0^t3LP)uA@p#j+ECCC}B?3$+rNm;fcrTaBuX`ZetR)hOc0QlK7@Jy1im;-U zFz%kf;w^x?kjY?2dVvU3OwzDo1wlgszj^Gp03vOEOuW8a*A-#K`i8o+umcO-Fjg*? zOWiEkC``PV;VydG*ZB!+(9stU=V`2N!}s51PZijUBZwlwlK1q9LUe=sag( z3=zGeA%NArdA|nBdTg-1S&~e8FY%dP1o03VcZQ1I9qu>&vw&b+0Z+IBBz}v#X@x6b h2v=>4JBbO-E!B_xFngjXJ@3lf4viL6Mu zC{dE0f0&bwTsPPOC;la8Ccb1o{xhDLGgvgIDwT@IMSf*v<#aNcPjsfW6OO^m-UCDA# zQ?CuCnykoRacs)C0I23Xy)Mgy43=ODh&&=IGV&K6fJh6e)9FxFgk%e1(|+6hQN3aa=kY1zajnrX(;Lkj4yG>00000NkvXX Hu0mjf%Nf%8 literal 0 HcmV?d00001 diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Group 9499@3x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check.imageset/Group 9499@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..170a6a4dfd29c12b4f815215c723fa64266a201d GIT binary patch literal 1414 zcmV;11$p|3P)il;gwg>+AdU{QNx6*T{3NqFyGG z@%UVRe0<#JbCHkI;^JbNx}XeoP=M_3?_XuO91dzj{1S@%0{-yj4#RuYA$0_pL33=y zAMHX$$-r+ic#+yvTfp@|hlhu0XlN)nxGW6}3{;hQczB@u`+H&_y1l)nySqEOxw(n@ zFTJOyr*#J3p%&E=FoU9AZiRsYGMmlP=;$apjzg`8q3G)Bipu43C_Gzy+gRMACe<|X z-rn9SKhOrfG(f%pHa^s9@4~$lzz+`({j*Yut^KVL7q1J9`pVWT zkm^5sWz{I5fjc`pql=3RoedXXtOs2aI1Cn`larGa2f@Vwt_0}MwFWIUO~fvY=HHbx zTsSVU5MDl>Nl6S8sYu}6-QAzM&fmCtMHs8=`i!A3#{0TV6%E4$l^ylM9_S}Q7zm*niZD9V_XA+_ zCR|A;$(3!vwP9_@wsHWh-$YWaD*|kkm3?5e%=%L=$<`H(jg1A@#>#%bDi&Uno2Uax zwyp?Pwmxk9e%UcMze;YL2N=ytvoPZqoHH;rx6c3M#@yUoP~npF z=OqI!kQP`d#I17x&PfUrZE2ImgkiH&W#P0*1LNz@;eS3zMv{h+jmiR^cesyoC1Y@K zkkTfrP0GTguB6h?|Jt&c-1PZy9lZmmT>$nZVNGtQLKc$;;9w3HL$S08E0ZEDygNL; z+?Nb2Ri;hahF>;LssU%w&*0tO@U<-f|^d(jXELPW(DmyAb2eegvJm@z8x2_Q&7F*fY zMIf8LUj?kK3>_aIC(5<)te)ouX`ap5wxjl(kUv@>^Fbl8QArV8S$!RO47_QVc?FEt z3=wXUhHG1OB9^klm`s$OXO|0|0N{do{)1nVjtKpWjVhH&l_%oaqe2pE&3J5(`jSF@ zjw3W+kB*LlG`sOW!>&b@j|9eG1d(l|zNP>jC-=s)Xjpoww@bDDrlrtBti56l`K{KW zx)ypUGSI(CExcjA*LB^VPu^o}08i6%Rd8c0dN;C9qN#Xk2G2A2s?L+3ux^7#SXCOR zwMKuZ=>Ty==`l27CS0B0EpULMYdk+c_ao(%%BJhdH}iWfZvo)b27@o#_hbve$jC^` zbsUiRc(1Vq0GmEmda?yT3xRAVw#yB>FPl7Y#>ynDAGXN@fS7xdBWeuaiQO&l+j!cM zarGqx$#iI=7N(x^o!q6?QD7|-7lm#N)<@iR)~rRlR#A@+%(#@yRy?GO-P(%xA2$!r Uxqw+3Q2+n{07*qoM6N<$g163(>Hq)$ literal 0 HcmV?d00001 diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Contents.json new file mode 100644 index 00000000..34531054 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Group 9515.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 9515@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 9515@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515.png new file mode 100644 index 0000000000000000000000000000000000000000..a21fffbe36373efeae5dce2170121196ae04f382 GIT binary patch literal 582 zcmV-M0=fN(P)uIjpVQqoG_n zIQA4X6)`2t@@h@pUCuK&yyg!7UReEqbdf$Hje^OaQN|#gjth9!FsP7LY18HxE zCz9zUw^JhgT|YQxrzyQk7Q)~kDH8E@miLlA2&KK90GTXBzv4Cam8v zP`A;#nOAlHMqd=lm=Ten8n)5p5Z0h>ws1`dQhhtT#$xwjsnFZh8&tt`Y&BZ*8|QL^ zlCEtMt70Cdi&;_sM4go1`L~<#_$3U)O7A{7T0W?z@XSKmVE%ew?bVxpzHg2@1xGQ% Ugj2x+Y5)KL07*qoM6N<$f(e5El>h($ literal 0 HcmV?d00001 diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515@2x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2c1cbdc5fa5adbd1aa2c20e039bebafc83224cdd GIT binary patch literal 1041 zcmV+s1n&EZP)Dkz5FjNG696J1zu#aCv^SbZg9<=1jqe6F-7elVDgW@3tc(c~h^TQqoQ-Pj z38S4136fYnZ<--7umC906Rd8?<4D5(VA0*msqj(b)rGDO^y)4S1;1b#V-9PNW+SP zb%Wi=fIL)>R6cn_JQDaeCODgiY9jd5!g^~cdzup*3VijVaIVTb@j`V;?K4Mb_Ib<= zF>+_{9LN#w2F_=)Cn|y}dfd4Q=Li|aW{RSUpo*T2_y=lXbfN(~ZH|&{T>MDQznLLM z=mnb?9CyLvr;RXhzfMV(LI6(ECmWJkiCxbg$qkOx=gwV?x(k_`GA72jJri=FTyl%U ztGQpgebO?WtKk4Xz5Af&WOTv>4f1YZ&i#h%tu$C6_k8k){9RnPpUf!(41sm%HR^v* z2R*kgz%`!}o`suqA8ae-2n6hwg2JoU=*#D$+_9&PnUXw>+%axeF3*d-{{u_&`=%u= zkjn@fX|)vDGbL$}oPyB?$4En?l2*z|QcS)nh6IgBS}aE|Ny2fxW4ccsTs7M1Q~a;$ z+I7>Z&T0DTxqSgV?F{aWSSLpa5FZ>jE>E|~l)K+d$6}IKx}28E5%L9DWWs@QsDQ%Z zwpxy$4Zm7MM*PX|m2N8s$6PQVCv#d?KgN&L@@0jb9HGQQtfjMt4mpUhd=6)z0#qdB z4+-w=3a|=9(CAamgLSMX1gFGGIf5z=^r-|RnfyNt=L9N^WXmGCm86zAf<`Cpvjr2` z=n*+Vieg&UN}$RJkp38B?^ve?$BO`?9AymBQtL00000 LNkvXXu0mjfK)ug^ literal 0 HcmV?d00001 diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515@3x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_check_fill.imageset/Group 9515@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..e2c3ae3dbfc41408043aa7541cd79649bc55f274 GIT binary patch literal 1396 zcmV-)1&jKLP)!{(FD zR`|daj?6kj^dewR9qt68Y|$GLZ2(d?$Rp8~5Mb@W-sY;+lZO~Uh!B=+lO2`(op4DwZNJ0t6E?SOl2xsb^_0cK> zB#`ik`811^Sxiv02t-_xcsLs*)CKrttpE9>kePpKCCd=eILgf0*jLZS!6%+eShu>e zV_JRP&yXSn;QXH(SEszb-;*%Qw$S?)lIVprg1AX|_^p=^uPS_6U)NL!XCd9#B#s8E zNmmrEBiS?T17Y;7T31{rH9Le>#*LskynjaUuh#&7Sig1KGOiQOsDP*mQYl}qvq}~ zNcamH2t&|7;h>|qgbC)L!O(-70?vg;)X1knLb({#=jTz~+0%;>F8L?Y%IAF<=pSl< z?(2rE@5=8Mj^(s=%+noUB2N#KtgpEc?F!}aKo-}luQI}kP1WVas& z_)Z72P3k|&`I*V%%fW989a@&TnalWUExizntOC`7fSMA*5B;3P*TFMch9C1Ez@;7q zami{3b3!eFWc{48^R)a6qmqtQ7P!+zouX{5rwadW9>IgfgR1-%IO()i-jU$QE!2O$FZlEr`HP1QLmB=a7^mtQx-CpQcj`mTIPmxL^%O836H z2^%7$Qc3p@HkTbwN|xdL5z%ZI7DSAjbSX*7GJDXpDVEf<2O(GxG1a7#mgPK=^C=!x zo7W)*+@uqiWu$z_cY4?p_pC?vbpeBST6I0%{_hwz{(h^alSD1M^zgFF`8aRn*6teC zFmEGPR5&lMcMb5vi>@WoEHo%afm_jJM`M;U+RGbPd(NH}4;~t^lm!)K_!J4Rs8zN& zE>X3D6WErmuA;2H^5G#KO{h4JC6hH-(B^Et(xYX<+;lr6>prxJoJ&&^FP#9mf07%q z0QJkl%A;#bm%ZRRqHuD5{Fe&535e%@dunrr#8Gfj1R=CzDSZw3mNU-<;H9h(#1lhI$MgbX Date: Fri, 2 Jun 2023 11:48:50 +0900 Subject: [PATCH 4/7] =?UTF-8?q?[Fix]=20#=20163=20-=20=EC=85=80=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=EB=B0=95=EC=8A=A4=20=EC=97=90=EB=9F=AC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/VC/CourseDiscoveryVC.swift | 2 +- .../Views/VC/CourseSearchVC.swift | 2 +- .../Views/VC/MyCourseSelectVC.swift | 2 +- .../Views/CVC/CourseListCVC.swift | 27 ++++++++----------- .../PrivateCourseListView.swift | 13 +++++++-- .../CourseListView/ScrapCourseListView.swift | 2 +- .../VC/InfoVC/UploadedCourseInfoVC.swift | 4 +-- 7 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift index d3b87aca..087eaf69 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift @@ -194,7 +194,7 @@ extension CourseDiscoveryVC: UICollectionViewDelegate, UICollectionViewDataSourc cell.delegate = self let model = self.courseList[indexPath.item] let location = "\(model.departure.region) \(model.departure.city)" - cell.setData(imageURL: model.image, title: model.title, location: location, didLike: model.scrap, didCheck: nil, indexPath: indexPath.item) + cell.setData(imageURL: model.image, title: model.title, location: location, didLike: model.scrap, indexPath: indexPath.item) return cell } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift index 866f9d71..1e5f66b9 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift @@ -151,7 +151,7 @@ extension CourseSearchVC: UICollectionViewDelegate, UICollectionViewDataSource { cell.delegate = self let model = self.courseList[indexPath.item] let location = "\(model.departure.region) \(model.departure.city)" - cell.setData(imageURL: model.image, title: model.title, location: location, didLike: model.scrap, didCheck: nil, indexPath: indexPath.item) + cell.setData(imageURL: model.image, title: model.title, location: location, didLike: model.scrap, indexPath: indexPath.item) return cell } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/MyCourseSelectVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/MyCourseSelectVC.swift index d6aa9ebd..127d8e9b 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/MyCourseSelectVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/MyCourseSelectVC.swift @@ -191,7 +191,7 @@ extension MyCourseSelectVC: UICollectionViewDelegate, UICollectionViewDataSource title += " \(town)" } - cell.setData(imageURL: model.image, title: title, location: nil, didLike: nil, didCheck: nil) + cell.setData(imageURL: model.image, title: title, location: nil, didLike: nil) return cell } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift index 3bda3666..aaa8a66e 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift @@ -76,10 +76,11 @@ final class CourseListCVC: UICollectionViewCell { $0.backgroundColor = .w1 } - private let checkMark = UIButton(type: .custom).then { + private let selectIdicatorButton = UIButton(type: .custom).then { $0.setImage(ImageLiterals.icCheckFill, for: .selected) $0.setImage(ImageLiterals.icCheck, for: .normal) - $0.backgroundColor = .clear + $0.isSelected = false + $0.isHidden = true } // MARK: - initialization @@ -89,6 +90,7 @@ final class CourseListCVC: UICollectionViewCell { self.setUI() self.setLayout() self.setAddTarget() + } required init?(coder: NSCoder) { @@ -103,22 +105,17 @@ extension CourseListCVC { likeButton.addTarget(self, action: #selector(likeButtonDidTap), for: .touchUpInside) } - func setData(imageURL: String, title: String, location: String?, didLike: Bool?, didCheck: Bool?, indexPath: Int? = nil) { + func setData(imageURL: String, title: String, location: String?, didLike: Bool?, indexPath: Int? = nil, isEditMode: Bool = false) { self.courseImageView.setImage(with: imageURL) self.titleLabel.text = title self.indexPath = indexPath - if let location = location { self.locationLabel.text = location } - if let didLike = didLike { self.likeButton.isSelected = didLike } - - if let didCheck = didCheck { - self.checkMark.isSelected = didCheck - } + self.selectIdicatorButton.isHidden = !isEditMode } func selectCell(didSelect: Bool) { @@ -126,11 +123,12 @@ extension CourseListCVC { courseImageView.layer.borderColor = UIColor.m1.cgColor courseImageView.layer.borderWidth = 2 imageCoverView.isHidden = false - checkMark.isSelected.toggle() + selectIdicatorButton.isSelected = true } else { courseImageView.layer.borderColor = UIColor.clear.cgColor imageCoverView.isHidden = true - checkMark.isSelected.toggle() + selectIdicatorButton.isSelected = false + } } } @@ -155,7 +153,7 @@ extension CourseListCVC { } private func setLayout() { - self.contentView.addSubviews(courseImageView, imageCoverView, labelStackView, likeButton, checkMark) + self.contentView.addSubviews(courseImageView, imageCoverView, labelStackView, likeButton, selectIdicatorButton) courseImageView.snp.makeConstraints { make in make.leading.top.trailing.equalToSuperview() @@ -174,7 +172,7 @@ extension CourseListCVC { make.height.equalTo(20) } - checkMark.snp.makeConstraints { make in + selectIdicatorButton.snp.makeConstraints { make in make.top.equalTo(courseImageView.snp.top).offset(8) make.leading.equalToSuperview().offset(8) make.width.equalTo(20) @@ -193,15 +191,12 @@ extension CourseListCVC { case .title: self.locationLabel.isHidden = true self.likeButton.isHidden = true - self.checkMark.isHidden = true case .titleWithLocation: self.locationLabel.isHidden = false self.likeButton.isHidden = true - self.checkMark.isHidden = true case .all: self.locationLabel.isHidden = false self.likeButton.isHidden = false - self.checkMark.isHidden = true } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift index b5db07a2..a68eccbc 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift @@ -32,6 +32,7 @@ final class PrivateCourseListView: UIView { isEditMode ? startEditMode() : finishEditMode() } } + final let collectionViewInset = UIEdgeInsets(top: 28, left: 16, bottom: 28, right: 16) final let itemSpacing: CGFloat = 10 @@ -119,11 +120,12 @@ extension PrivateCourseListView { extension PrivateCourseListView { @objc func editButtonDidTap() { isEditMode.toggle() - self.courseListCollectionView.reloadData() self.delegate?.courseListEditButtonTapped() + self.courseListCollectionView.reloadData() } private func startEditMode() { + self.setEditModeCell() self.totalNumOfRecordlabel.text = "코스 선택" self.editButton.setTitle("취소", for: .normal) } @@ -138,6 +140,12 @@ extension PrivateCourseListView { guard let selectedItems = courseListCollectionView.indexPathsForSelectedItems else { return } for indexPath in selectedItems { courseListCollectionView.deselectItem(at: indexPath, animated: false) } } + private func setEditModeCell() { + let cell = courseListCollectionView.indexPathsForVisibleItems + for indexPath in cell { + courseListCollectionView.cellForItem(at: indexPath) + } + } } // MARK: - UI & Layout @@ -203,7 +211,7 @@ extension PrivateCourseListView: UICollectionViewDelegate, UICollectionViewDataS let model = courseList[indexPath.item] let cellTitle = "\(model.departure.region) \(model.departure.city)" - cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil, didCheck: nil) + cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil, isEditMode: isEditMode) return cell } @@ -214,6 +222,7 @@ extension PrivateCourseListView: UICollectionViewDelegate, UICollectionViewDataS delegate?.selectCellDidTapped() } else { collectionView.deselectItem(at: indexPath, animated: true) + cell.selectCell(didSelect: false) cellDidTapped.send(indexPath.item) } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/ScrapCourseListView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/ScrapCourseListView.swift index 89c2fa3a..5424cbf5 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/ScrapCourseListView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/ScrapCourseListView.swift @@ -120,7 +120,7 @@ extension ScrapCourseListView: UICollectionViewDelegate, UICollectionViewDataSou let location = "\(model.departure.region) \(model.departure.city)" - cell.setData(imageURL: model.image, title: model.title, location: location, didLike: true, didCheck: nil, indexPath: indexPath.item) + cell.setData(imageURL: model.image, title: model.title, location: location, didLike: true, indexPath: indexPath.item) return cell } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift index 580f5732..e10ed4c6 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift @@ -263,7 +263,7 @@ extension UploadedCourseInfoVC: UICollectionViewDelegateFlowLayout { // MARK: - UICollectionViewDataSource -extension UploadedCourseInfoVC: UICollectionViewDelegate,UICollectionViewDataSource { +extension UploadedCourseInfoVC: UICollectionViewDelegate, UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return uploadedCourseList.count } @@ -280,7 +280,7 @@ extension UploadedCourseInfoVC: UICollectionViewDelegate,UICollectionViewDataSou let model = uploadedCourseList[indexPath.item] let cellTitle = "\(model.departure.region) \(model.departure.city)" - cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil, didCheck: nil) + cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil) return cell } From 3341b128c562b426cebfb219187cc06495b74c25 Mon Sep 17 00:00:00 2001 From: yeonwoo Date: Fri, 2 Jun 2023 13:27:33 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[Fix]=20#163=20-=20=EC=97=85=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=ED=95=9C=20=EC=BD=94=EC=8A=A4=EC=97=90=EB=8F=84=20?= =?UTF-8?q?=EC=85=80=EC=B2=B4=ED=81=AC=EB=B0=95=EC=8A=A4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=ED=8E=B8=EC=A7=91=EC=B7=A8=EC=86=8C=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/ImageLiterals.swift | 1 - .../CourseStorage/VC/CourseStorageVC.swift | 1 - .../PrivateCourseListView.swift | 13 --- .../VC/InfoVC/UploadedCourseInfoVC.swift | 79 ++++++++++--------- 4 files changed, 40 insertions(+), 54 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift index 41d4c285..f0823805 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift @@ -47,7 +47,6 @@ enum ImageLiterals { static var icCheck: UIImage { .load(named: "ic_check") } static var icCheckFill: UIImage { .load(named: "ic_check_fill") } - // img static var imgBackground: UIImage { .load(named: "img_background") } static var imgLogo: UIImage { .load(named: "img_logo") } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift index d7d44348..6aa3809d 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift @@ -86,7 +86,6 @@ extension CourseStorageVC { private func bindUI() { viewPager.$selectedTabIndex.sink { [weak self] selectedTabIndex in guard let self = self else { return } - print(selectedTabIndex) self.deleteCourseButton.isHidden = (selectedTabIndex != 0) }.store(in: cancelBag) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift index a68eccbc..7106bb88 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift @@ -33,7 +33,6 @@ final class PrivateCourseListView: UIView { } } - final let collectionViewInset = UIEdgeInsets(top: 28, left: 16, bottom: 28, right: 16) final let itemSpacing: CGFloat = 10 final let lineSpacing: CGFloat = 20 @@ -125,7 +124,6 @@ extension PrivateCourseListView { } private func startEditMode() { - self.setEditModeCell() self.totalNumOfRecordlabel.text = "코스 선택" self.editButton.setTitle("취소", for: .normal) } @@ -140,12 +138,6 @@ extension PrivateCourseListView { guard let selectedItems = courseListCollectionView.indexPathsForSelectedItems else { return } for indexPath in selectedItems { courseListCollectionView.deselectItem(at: indexPath, animated: false) } } - private func setEditModeCell() { - let cell = courseListCollectionView.indexPathsForVisibleItems - for indexPath in cell { - courseListCollectionView.cellForItem(at: indexPath) - } - } } // MARK: - UI & Layout @@ -222,16 +214,11 @@ extension PrivateCourseListView: UICollectionViewDelegate, UICollectionViewDataS delegate?.selectCellDidTapped() } else { collectionView.deselectItem(at: indexPath, animated: true) - cell.selectCell(didSelect: false) cellDidTapped.send(indexPath.item) } } func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) { - guard let selectedCells = collectionView.indexPathsForSelectedItems else { - return - } - guard let cell = collectionView.cellForItem(at: indexPath) as? CourseListCVC else { return } if isEditMode { diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift index e10ed4c6..d0ff650c 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift @@ -19,7 +19,11 @@ final class UploadedCourseInfoVC: UIViewController { private var uploadedCourseList = [PublicCourse]() - var isEditMode: Bool = false + var isEditMode: Bool = false { + didSet { + isEditMode ? startEditMode() : finishEditMode() + } + } private var deleteToCourseId = [Int]() @@ -104,7 +108,7 @@ final class UploadedCourseInfoVC: UIViewController { extension UploadedCourseInfoVC { private func setData(courseList: [PublicCourse]) { self.uploadedCourseList = courseList - UploadedCourseInfoCollectionView.reloadData() + self.UploadedCourseInfoCollectionView.reloadData() self.emptyView.isHidden = !courseList.isEmpty self.deleteCourseButton.isHidden = true self.beforeEditTopView.isHidden = courseList.isEmpty @@ -127,6 +131,21 @@ extension UploadedCourseInfoVC { self.editButton.addTarget(self, action: #selector(editButtonDidTap), for: .touchUpInside) } + private func startEditMode() { + self.totalNumOfRecordlabel.text = "코스 선택" + self.editButton.setTitle("취소", for: .normal) + self.deleteCourseButton.isHidden = false + } + + private func finishEditMode() { + self.totalNumOfRecordlabel.text = "총 코스 \(self.uploadedCourseList.count)개" + self.editButton.setTitle("편집", for: .normal) + self.deleteCourseButton.isEnabled = false + self.deleteCourseButton.setTitle(title: "삭제하기") + self.deleteCourseButton.isHidden = true + self.deselectAllItems() + } + private func deselectAllItems() { guard let selectedItems = UploadedCourseInfoCollectionView.indexPathsForSelectedItems else { return } for indexPath in selectedItems { UploadedCourseInfoCollectionView.deselectItem(at: indexPath, animated: false) } @@ -160,24 +179,9 @@ extension UploadedCourseInfoVC { } @objc func editButtonDidTap() { - if isEditMode { - self.totalNumOfRecordlabel.text = "총 코스 \(self.uploadedCourseList.count)개" - self.editButton.setTitle("편집", for: .normal) - self.deleteCourseButton.isEnabled = false - self.deleteCourseButton.setTitle(title: "삭제하기") - self.deselectAllItems() - self.deleteCourseButton.isHidden = true - self.UploadedCourseInfoCollectionView.reloadData() - isEditMode.toggle() - } else { - self.totalNumOfRecordlabel.text = "기록 선택" - self.editButton.setTitle("취소", for: .normal) - self.deleteCourseButton.isHidden = false - self.UploadedCourseInfoCollectionView.reloadData() - isEditMode.toggle() - } + self.UploadedCourseInfoCollectionView.reloadData() + isEditMode.toggle() } - } extension UploadedCourseInfoVC { @@ -280,49 +284,45 @@ extension UploadedCourseInfoVC: UICollectionViewDelegate, UICollectionViewDataSo let model = uploadedCourseList[indexPath.item] let cellTitle = "\(model.departure.region) \(model.departure.city)" - cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil) + cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil, isEditMode: isEditMode) return cell } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - guard collectionView.cellForItem(at: indexPath) is CourseListCVC else { return } - guard let selectedCells = collectionView.indexPathsForSelectedItems else { return } guard let cell = collectionView.cellForItem(at: indexPath) as? CourseListCVC else { return } let publicCourseModel = uploadedCourseList[indexPath.item] if isEditMode { self.deleteCourseButton.isEnabled = true - let countSelectCells = selectedCells.count - self.deleteCourseButton.setTitle(title: "삭제하기(\(countSelectCells))") cell.selectCell(didSelect: true) + guard let selectedCells = collectionView.indexPathsForSelectedItems else { return } + + let countSelectCells = selectedCells.count + + if isEditMode { + self.deleteCourseButton.setTitle(title: "삭제하기(\(countSelectCells))") + } + self.deleteCourseButton.setEnabled(countSelectCells != 0) } else { collectionView.deselectItem(at: indexPath, animated: true) - self.deleteCourseButton.setTitle(title: "삭제하기") - self.deleteCourseButton.setEnabled(true) let courseDetailVC = CourseDetailVC() courseDetailVC.setCourseId(courseId: publicCourseModel.courseId, publicCourseId: publicCourseModel.id) courseDetailVC.hidesBottomBarWhenPushed = true self.navigationController?.pushViewController(courseDetailVC, animated: true) - cell.selectCell(didSelect: false) } } func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) { - guard collectionView.cellForItem(at: indexPath) is CourseListCVC else { return } - guard let selectedCells = collectionView.indexPathsForSelectedItems else { - self.deleteCourseButton.isEnabled = false - self.deleteCourseButton.setTitle(title: "삭제하기") - return } + guard let selectedCells = collectionView.indexPathsForSelectedItems else { return } guard let cell = collectionView.cellForItem(at: indexPath) as? CourseListCVC else { return } cell.selectCell(didSelect: false) if isEditMode { - self.deleteCourseButton.isEnabled = true - let countSelectCells = selectedCells.count - self.deleteCourseButton.setTitle(title: "삭제하기(\(countSelectCells))") - cell.selectCell(didSelect: false) - } else { - collectionView.deselectItem(at: indexPath, animated: true) - self.deleteCourseButton.setTitle(title: "삭제하기") cell.selectCell(didSelect: false) } + + let countSelectCells = selectedCells.count + if isEditMode { + self.deleteCourseButton.setTitle(title: "삭제하기(\(countSelectCells))") + } + self.deleteCourseButton.setEnabled(countSelectCells != 0) } } @@ -368,6 +368,7 @@ extension UploadedCourseInfoVC { if 200..<300 ~= status { print("삭제 성공") self.getUploadedCourseInfo() + self.isEditMode.toggle() } if status >= 400 { print("400 error") From ab4f796509a7bd997107050e2516ba6a1fcee9c4 Mon Sep 17 00:00:00 2001 From: yeonwoo Date: Fri, 2 Jun 2023 13:33:37 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[Fix]=20#163=20-=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/CourseStorage/Views/CVC/CourseListCVC.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift index aaa8a66e..ee7c8918 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift @@ -173,7 +173,7 @@ extension CourseListCVC { } selectIdicatorButton.snp.makeConstraints { make in - make.top.equalTo(courseImageView.snp.top).offset(8) + make.top.leading.equalToSuperview().inset(8) make.leading.equalToSuperview().offset(8) make.width.equalTo(20) make.height.equalTo(20) From 61993096a908a12840b56b9b1cf49fff473eb609 Mon Sep 17 00:00:00 2001 From: yeonwoo Date: Fri, 2 Jun 2023 13:59:03 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[Fix]=20#163=20-=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseStorage/Views/CVC/CourseListCVC.swift | 12 ++++++------ .../MyPage/VC/InfoVC/UploadedCourseInfoVC.swift | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift index ee7c8918..4dbca07b 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift @@ -76,7 +76,7 @@ final class CourseListCVC: UICollectionViewCell { $0.backgroundColor = .w1 } - private let selectIdicatorButton = UIButton(type: .custom).then { + private let selectIndicatorButton = UIButton(type: .custom).then { $0.setImage(ImageLiterals.icCheckFill, for: .selected) $0.setImage(ImageLiterals.icCheck, for: .normal) $0.isSelected = false @@ -115,7 +115,7 @@ extension CourseListCVC { if let didLike = didLike { self.likeButton.isSelected = didLike } - self.selectIdicatorButton.isHidden = !isEditMode + self.selectIndicatorButton.isHidden = !isEditMode } func selectCell(didSelect: Bool) { @@ -123,11 +123,11 @@ extension CourseListCVC { courseImageView.layer.borderColor = UIColor.m1.cgColor courseImageView.layer.borderWidth = 2 imageCoverView.isHidden = false - selectIdicatorButton.isSelected = true + selectIndicatorButton.isSelected = true } else { courseImageView.layer.borderColor = UIColor.clear.cgColor imageCoverView.isHidden = true - selectIdicatorButton.isSelected = false + selectIndicatorButton.isSelected = false } } @@ -153,7 +153,7 @@ extension CourseListCVC { } private func setLayout() { - self.contentView.addSubviews(courseImageView, imageCoverView, labelStackView, likeButton, selectIdicatorButton) + self.contentView.addSubviews(courseImageView, imageCoverView, labelStackView, likeButton, selectIndicatorButton) courseImageView.snp.makeConstraints { make in make.leading.top.trailing.equalToSuperview() @@ -172,7 +172,7 @@ extension CourseListCVC { make.height.equalTo(20) } - selectIdicatorButton.snp.makeConstraints { make in + selectIndicatorButton.snp.makeConstraints { make in make.top.leading.equalToSuperview().inset(8) make.leading.equalToSuperview().offset(8) make.width.equalTo(20) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift index d0ff650c..4a990933 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift @@ -179,8 +179,8 @@ extension UploadedCourseInfoVC { } @objc func editButtonDidTap() { - self.UploadedCourseInfoCollectionView.reloadData() isEditMode.toggle() + self.UploadedCourseInfoCollectionView.reloadData() } } @@ -367,8 +367,8 @@ extension UploadedCourseInfoVC { let status = result.statusCode if 200..<300 ~= status { print("삭제 성공") - self.getUploadedCourseInfo() self.isEditMode.toggle() + self.getUploadedCourseInfo() } if status >= 400 { print("400 error")