From 012fc739c2c53d7a2f34ceaf41e3394a41028b18 Mon Sep 17 00:00:00 2001 From: Sangwoo Byeon Date: Tue, 28 May 2024 10:28:44 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#186=20-=203=EC=B0=A8=20QA=5F=ED=88=AC?= =?UTF-8?q?=EB=AA=85=EB=8F=84=20=EB=A7=A4=EC=BB=A4=EB=8B=88=EC=A6=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewControllers/HomeViewController.swift | 9 +++++---- .../MyPageCommentViewController.swift | 8 ++++---- .../MyPageContentViewController.swift | 8 ++++---- .../PostDetailViewController.swift | 17 ++++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/DontBe-iOS/DontBe-iOS/Presentation/Home/ViewControllers/HomeViewController.swift b/DontBe-iOS/DontBe-iOS/Presentation/Home/ViewControllers/HomeViewController.swift index 26589990..96e7d636 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/Home/ViewControllers/HomeViewController.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/Home/ViewControllers/HomeViewController.swift @@ -576,11 +576,8 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega } } - var memberGhost = self.homeViewModel.postDatas[indexPath.row].memberGhost - memberGhost = adjustGhostValue(memberGhost) - cell.nicknameLabel.text = homeViewModel.postDatas[indexPath.row].memberNickname - cell.transparentLabel.text = "투명도 \(memberGhost)%" + cell.transparentLabel.text = "투명도 \(homeViewModel.postDatas[indexPath.row].memberGhost)%" cell.contentTextLabel.text = homeViewModel.postDatas[indexPath.row].contentText cell.likeNumLabel.text = "\(homeViewModel.postDatas[indexPath.row].likedNumber)" cell.commentNumLabel.text = "\(homeViewModel.postDatas[indexPath.row].commentNumber)" @@ -613,11 +610,15 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega } } + var memberGhost = self.homeViewModel.postDatas[indexPath.row].memberGhost + memberGhost = adjustGhostValue(memberGhost) + // 내가 투명도를 누른 유저인 경우 -85% 적용 if self.homeViewModel.postDatas[indexPath.row].isGhost { cell.grayView.alpha = 0.85 } else { cell.grayView.alpha = CGFloat(Double(-memberGhost) / 100) + print("cell.grayView.alpha: \(CGFloat(Double(-memberGhost) / 100))") } // 탈퇴한 회원 닉네임 텍스트 색상 변경, 프로필로 이동 못하도록 적용 diff --git a/DontBe-iOS/DontBe-iOS/Presentation/MyPage/ViewControllers/MyPageCommentViewController.swift b/DontBe-iOS/DontBe-iOS/Presentation/MyPage/ViewControllers/MyPageCommentViewController.swift index 97d5cc9e..13809649 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/MyPage/ViewControllers/MyPageCommentViewController.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/MyPage/ViewControllers/MyPageCommentViewController.swift @@ -304,11 +304,8 @@ extension MyPageCommentViewController: UICollectionViewDataSource, UICollectionV NotificationCenter.default.post(name: MyPageCommentViewController.ghostButtonTapped, object: nil) } - var memberGhost = commentDatas[indexPath.row].memberGhost - memberGhost = adjustGhostValue(memberGhost) - cell.nicknameLabel.text = commentDatas[indexPath.row].memberNickname - cell.transparentLabel.text = "투명도 \(memberGhost)%" + cell.transparentLabel.text = "투명도 \(commentDatas[indexPath.row].memberGhost)%" cell.timeLabel.text = "\(commentDatas[indexPath.row].time.formattedTime())" cell.contentTextLabel.text = commentDatas[indexPath.row].commentText cell.likeNumLabel.text = "\(commentDatas[indexPath.row].commentLikedNumber)" @@ -343,6 +340,9 @@ extension MyPageCommentViewController: UICollectionViewDataSource, UICollectionV cell.commentStackView.isHidden = true + var memberGhost = commentDatas[indexPath.row].memberGhost + memberGhost = adjustGhostValue(memberGhost) + // 내가 투명도를 누른 유저인 경우 -85% 적용 if commentDatas[indexPath.row].isGhost { cell.grayView.alpha = 0.85 diff --git a/DontBe-iOS/DontBe-iOS/Presentation/MyPage/ViewControllers/MyPageContentViewController.swift b/DontBe-iOS/DontBe-iOS/Presentation/MyPage/ViewControllers/MyPageContentViewController.swift index 9feeb442..9a3089f0 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/MyPage/ViewControllers/MyPageContentViewController.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/MyPage/ViewControllers/MyPageContentViewController.swift @@ -314,11 +314,8 @@ extension MyPageContentViewController: UICollectionViewDataSource, UICollectionV NotificationCenter.default.post(name: MyPageContentViewController.ghostButtonTapped, object: nil) } - var memberGhost = contentDatas[indexPath.row].memberGhost - memberGhost = adjustGhostValue(memberGhost) - cell.nicknameLabel.text = contentDatas[indexPath.row].memberNickname - cell.transparentLabel.text = "투명도 \(memberGhost)%" + cell.transparentLabel.text = "투명도 \(contentDatas[indexPath.row].memberGhost)%" cell.timeLabel.text = "\(contentDatas[indexPath.row].time.formattedTime())" cell.contentTextLabel.text = contentDatas[indexPath.row].contentText cell.likeNumLabel.text = "\(contentDatas[indexPath.row].likedNumber)" @@ -350,6 +347,9 @@ extension MyPageContentViewController: UICollectionViewDataSource, UICollectionV } } + var memberGhost = contentDatas[indexPath.row].memberGhost + memberGhost = adjustGhostValue(memberGhost) + // 내가 투명도를 누른 유저인 경우 -85% 적용 if contentDatas[indexPath.row].isGhost { cell.grayView.alpha = 0.85 diff --git a/DontBe-iOS/DontBe-iOS/Presentation/Post/ViewControllers/PostDetailViewController.swift b/DontBe-iOS/DontBe-iOS/Presentation/Post/ViewControllers/PostDetailViewController.swift index 65e11245..d8c9d7c9 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/Post/ViewControllers/PostDetailViewController.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/Post/ViewControllers/PostDetailViewController.swift @@ -692,11 +692,8 @@ extension PostDetailViewController { } private func bindPostData(data: PostDetailResponseDTO) { - - let memberGhost = adjustGhostValue(data.memberGhost) - self.postView.isGhost = data.isGhost - self.postView.memberGhost = memberGhost + self.postView.memberGhost = data.memberGhost self.postView.isDeleted = data.isDeleted self.collectionHeaderView?.profileImageView.load(url: data.memberProfileUrl) @@ -705,7 +702,7 @@ extension PostDetailViewController { self.postUserNickname = "\(data.memberNickname)" self.userNickName = "\(data.memberNickname)" self.postView.contentTextLabel.text = data.contentText - self.postView.transparentLabel.text = "투명도 \(memberGhost)%" + self.postView.transparentLabel.text = "투명도 \(data.memberGhost)%" self.postView.timeLabel.text = data.time.formattedTime() self.postView.likeNumLabel.text = "\(data.likedNumber)" self.postView.commentNumLabel.text = "\(data.commentNumber)" @@ -721,6 +718,8 @@ extension PostDetailViewController { self.userNickName = "\(data.memberNickname)" self.contentText = "\(data.contentText)" + let memberGhost = adjustGhostValue(data.memberGhost) + // 내가 투명도를 누른 유저인 경우 -85% 적용 if data.isGhost { self.collectionHeaderView?.grayView.alpha = 0.85 @@ -858,11 +857,8 @@ extension PostDetailViewController: UICollectionViewDataSource, UICollectionView } } - var memberGhost = viewModel.postReplyDatas[indexPath.row].memberGhost - memberGhost = adjustGhostValue(memberGhost) - cell.nicknameLabel.text = viewModel.postReplyDatas[indexPath.row].memberNickname - cell.transparentLabel.text = "투명도 \(memberGhost)%" + cell.transparentLabel.text = "투명도 \(viewModel.postReplyDatas[indexPath.row].memberGhost)%" cell.contentTextLabel.text = viewModel.postReplyDatas[indexPath.row].commentText cell.likeNumLabel.text = "\(viewModel.postReplyDatas[indexPath.row].commentLikedNumber)" cell.timeLabel.text = "\(viewModel.postReplyDatas[indexPath.row].time.formattedTime())" @@ -894,6 +890,9 @@ extension PostDetailViewController: UICollectionViewDataSource, UICollectionView } } + var memberGhost = viewModel.postReplyDatas[indexPath.row].memberGhost + memberGhost = adjustGhostValue(memberGhost) + // 내가 투명도를 누른 유저인 경우 -85% 적용 if self.viewModel.postReplyDatas[indexPath.row].isGhost { cell.grayView.alpha = 0.85