-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix [#163] 릴리즈 QA 수정사항 2차 반영 #164
Changes from all commits
66253d1
a312dc6
c8466c7
462ab68
35b9d11
91b571d
6272be6
8e335c5
cff248e
11084a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ final class HomeViewController: UIViewController { | |
var ghostReason: String = "" | ||
var hasAppearedBefore = false | ||
|
||
var transparentPopupVC = TransparentPopupViewController() | ||
var transparentReasonView = DontBePopupReasonView() | ||
var deletePostPopupVC = DeletePopupViewController(viewModel: DeletePostViewModel(networkProvider: NetworkService())) | ||
|
||
|
@@ -125,7 +124,6 @@ extension HomeViewController { | |
private func setUI() { | ||
self.view.backgroundColor = UIColor.donGray1 | ||
|
||
transparentPopupVC.modalPresentationStyle = .overFullScreen | ||
deletePostPopupVC.modalPresentationStyle = .overFullScreen | ||
} | ||
|
||
|
@@ -215,7 +213,6 @@ extension HomeViewController { | |
private func setDelegate() { | ||
homeCollectionView.dataSource = self | ||
homeCollectionView.delegate = self | ||
transparentPopupVC.transparentButtonPopupView.delegate = self | ||
transparentReasonView.delegate = self | ||
} | ||
|
||
|
@@ -555,7 +552,25 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega | |
self.alarmTriggerType = cell.alarmTriggerType | ||
self.targetMemberId = cell.targetMemberId | ||
self.alarmTriggerdId = cell.alarmTriggerdId | ||
self.present(self.transparentPopupVC, animated: false, completion: nil) | ||
|
||
if let window = UIApplication.shared.keyWindowInConnectedScenes { | ||
window.addSubviews(self.transparentReasonView) | ||
|
||
self.transparentReasonView.snp.makeConstraints { | ||
$0.edges.equalToSuperview() | ||
} | ||
|
||
let radioButtonImage = ImageLiterals.TransparencyInfo.btnRadio | ||
|
||
self.transparentReasonView.firstReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.secondReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.thirdReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fourthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fifthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.sixthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.warnLabel.isHidden = true | ||
self.ghostReason = "" | ||
} | ||
} | ||
|
||
cell.nicknameLabel.text = homeViewModel.postDatas[indexPath.row].memberNickname | ||
|
@@ -577,6 +592,15 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega | |
cell.grayView.alpha = CGFloat(Double(-alpha) / 100) | ||
} | ||
|
||
// 탈퇴한 회원 닉네임 텍스트 색상 변경, 프로필로 이동 못하도록 적용 | ||
if self.homeViewModel.postDatas[indexPath.row].isDeleted { | ||
cell.nicknameLabel.textColor = .donGray12 | ||
cell.profileImageView.isUserInteractionEnabled = false | ||
} else { | ||
cell.nicknameLabel.textColor = .donBlack | ||
cell.profileImageView.isUserInteractionEnabled = true | ||
} | ||
|
||
self.contentId = homeViewModel.postDatas[indexPath.row].contentId | ||
|
||
return cell | ||
|
@@ -586,6 +610,7 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega | |
let destinationViewController = PostDetailViewController(viewModel: PostDetailViewModel(networkProvider: NetworkService())) | ||
destinationViewController.contentId = homeViewModel.postDatas[indexPath.row].contentId | ||
destinationViewController.memberId = homeViewModel.postDatas[indexPath.row].memberId | ||
destinationViewController.userProfileURL = homeViewModel.postDatas[indexPath.row].memberProfileUrl | ||
self.navigationController?.pushViewController(destinationViewController, animated: true) | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드 패치의 코드 리뷰:
개선 제안:
|
||
|
@@ -600,35 +625,6 @@ extension HomeViewController: UICollectionViewDataSource, UICollectionViewDelega | |
} | ||
} | ||
|
||
extension HomeViewController: DontBePopupDelegate { | ||
func cancleButtonTapped() { | ||
self.dismiss(animated: false) | ||
} | ||
|
||
func confirmButtonTapped() { | ||
self.dismiss(animated: false) | ||
|
||
if let window = UIApplication.shared.keyWindowInConnectedScenes { | ||
window.addSubviews(transparentReasonView) | ||
|
||
transparentReasonView.snp.makeConstraints { | ||
$0.edges.equalToSuperview() | ||
} | ||
|
||
let radioButtonImage = ImageLiterals.TransparencyInfo.btnRadio | ||
|
||
self.transparentReasonView.firstReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.secondReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.thirdReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fourthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fifthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.sixthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.warnLabel.isHidden = true | ||
self.ghostReason = "" | ||
} | ||
} | ||
} | ||
|
||
extension HomeViewController: DontBePopupReasonDelegate { | ||
func reasonCancelButtonTapped() { | ||
transparentReasonView.removeFromSuperview() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드 리뷰 및 개선 제안:
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,6 +240,11 @@ extension MyPageContentViewController: UICollectionViewDelegate { } | |
|
||
extension MyPageContentViewController: UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { | ||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | ||
if self.contentDatas.count == 0 { | ||
firstContentButton.isHidden = false | ||
} else { | ||
firstContentButton.isHidden = true | ||
} | ||
return self.contentDatas.count | ||
} | ||
|
||
|
@@ -339,7 +344,8 @@ extension MyPageContentViewController: UICollectionViewDataSource, UICollectionV | |
|
||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | ||
let contentId = contentDatas[indexPath.row].contentId | ||
NotificationCenter.default.post(name: MyPageContentViewController.pushViewController, object: nil, userInfo: ["contentId": contentId]) | ||
let profileImageURL = contentDatas[indexPath.row].memberProfileUrl | ||
NotificationCenter.default.post(name: MyPageContentViewController.pushViewController, object: nil, userInfo: ["contentId": contentId, "profileImageURL": profileImageURL]) | ||
} | ||
|
||
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드 리뷰:
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,6 @@ final class MyPageViewController: UIViewController { | |
var deleteBottomsheet = DontBeBottomSheetView(singleButtonImage: ImageLiterals.Posting.btnDelete) | ||
var warnBottomsheet = DontBeBottomSheetView(singleButtonImage: ImageLiterals.Posting.btnWarn) | ||
|
||
var transparentPopupVC = TransparentPopupViewController() | ||
var transparentReasonView = DontBePopupReasonView() | ||
var deletePostPopupVC = DeletePopupViewController(viewModel: DeletePostViewModel(networkProvider: NetworkService())) | ||
|
||
|
@@ -187,7 +186,6 @@ extension MyPageViewController { | |
private func setUI() { | ||
self.view.backgroundColor = .donBlack | ||
|
||
transparentPopupVC.modalPresentationStyle = .overFullScreen | ||
deletePostPopupVC.modalPresentationStyle = .overFullScreen | ||
} | ||
|
||
|
@@ -207,7 +205,6 @@ extension MyPageViewController { | |
rootView.myPageScrollView.delegate = self | ||
rootView.pageViewController.delegate = self | ||
rootView.pageViewController.dataSource = self | ||
transparentPopupVC.transparentButtonPopupView.delegate = self | ||
transparentReasonView.delegate = self | ||
} | ||
|
||
|
@@ -475,7 +472,6 @@ extension MyPageViewController { | |
} else { | ||
self.rootView.myPageContentViewController.noContentLabel.text = "\(data.nickname)" + StringLiterals.MyPage.myPageNoContentLabel | ||
self.rootView.myPageCommentViewController.noCommentLabel.text = StringLiterals.MyPage.myPageNoCommentLabel | ||
self.rootView.myPageContentViewController.firstContentButton.isHidden = false | ||
|
||
saveUserData(UserInfo(isSocialLogined: true, | ||
isFirstUser: false, | ||
|
@@ -489,9 +485,10 @@ extension MyPageViewController { | |
|
||
@objc | ||
private func pushViewController(_ notification: Notification) { | ||
if let contentId = notification.userInfo?["contentId"] as? Int { | ||
if let contentId = notification.userInfo?["contentId"] as? Int, let profileImageURL = notification.userInfo?["profileImageURL"] as? String { | ||
let destinationViewController = PostDetailViewController(viewModel: PostDetailViewModel(networkProvider: NetworkService())) | ||
destinationViewController.contentId = contentId | ||
destinationViewController.userProfileURL = profileImageURL | ||
self.navigationController?.pushViewController(destinationViewController, animated: true) | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드 리뷰를 해보겠습니다.
위 리뷰를 통해 코드 개선과 잠재적인 버그 사항을 처리하여 코드 안정성을 향상시킬 수 있습니다. |
||
|
@@ -592,15 +589,51 @@ extension MyPageViewController { | |
self.alarmTriggerType = rootView.myPageContentViewController.alarmTriggerType | ||
self.targetMemberId = rootView.myPageContentViewController.targetMemberId | ||
self.alarmTriggerdId = rootView.myPageContentViewController.alarmTriggerdId | ||
self.present(self.transparentPopupVC, animated: false, completion: nil) | ||
|
||
if let window = UIApplication.shared.keyWindowInConnectedScenes { | ||
window.addSubviews(transparentReasonView) | ||
|
||
transparentReasonView.snp.makeConstraints { | ||
$0.edges.equalToSuperview() | ||
} | ||
|
||
let radioButtonImage = ImageLiterals.TransparencyInfo.btnRadio | ||
|
||
self.transparentReasonView.firstReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.secondReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.thirdReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fourthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fifthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.sixthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.warnLabel.isHidden = true | ||
self.ghostReason = "" | ||
} | ||
} | ||
|
||
@objc | ||
private func commentGhostButtonTapped() { | ||
self.alarmTriggerType = rootView.myPageCommentViewController.alarmTriggerType | ||
self.targetMemberId = rootView.myPageCommentViewController.targetMemberId | ||
self.alarmTriggerdId = rootView.myPageCommentViewController.alarmTriggerdId | ||
self.present(self.transparentPopupVC, animated: false, completion: nil) | ||
|
||
if let window = UIApplication.shared.keyWindowInConnectedScenes { | ||
window.addSubviews(transparentReasonView) | ||
|
||
transparentReasonView.snp.makeConstraints { | ||
$0.edges.equalToSuperview() | ||
} | ||
|
||
let radioButtonImage = ImageLiterals.TransparencyInfo.btnRadio | ||
|
||
self.transparentReasonView.firstReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.secondReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.thirdReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fourthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fifthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.sixthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.warnLabel.isHidden = true | ||
self.ghostReason = "" | ||
} | ||
} | ||
|
||
private func moveTop() { | ||
|
@@ -717,56 +750,29 @@ extension MyPageViewController: UICollectionViewDelegate { | |
|
||
extension MyPageViewController: DontBePopupDelegate { | ||
func cancleButtonTapped() { | ||
if self.logoutPopupView != nil { | ||
self.logoutPopupView?.removeFromSuperview() | ||
} else { | ||
self.dismiss(animated: false) | ||
} | ||
self.logoutPopupView?.removeFromSuperview() | ||
} | ||
|
||
func confirmButtonTapped() { | ||
if self.logoutPopupView != nil { | ||
self.logoutPopupView?.removeFromSuperview() | ||
self.rootView.myPageBottomsheet.handleDismiss() | ||
|
||
if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate { | ||
DispatchQueue.main.async { | ||
let rootViewController = LoginViewController(viewModel: LoginViewModel(networkProvider: NetworkService())) | ||
sceneDelegate.window?.rootViewController = UINavigationController(rootViewController: rootViewController) | ||
} | ||
} | ||
|
||
saveUserData(UserInfo(isSocialLogined: false, | ||
isFirstUser: false, | ||
isJoinedApp: true, | ||
isOnboardingFinished: true, | ||
userNickname: loadUserData()?.userNickname ?? "", | ||
memberId: loadUserData()?.memberId ?? 0, | ||
userProfileImage: loadUserData()?.userProfileImage ?? StringLiterals.Network.baseImageURL)) | ||
self.logoutPopupView?.removeFromSuperview() | ||
self.rootView.myPageBottomsheet.handleDismiss() | ||
|
||
OnboardingViewController.pushCount = 0 | ||
} else { | ||
self.dismiss(animated: false) | ||
|
||
if let window = UIApplication.shared.keyWindowInConnectedScenes { | ||
window.addSubviews(transparentReasonView) | ||
|
||
transparentReasonView.snp.makeConstraints { | ||
$0.edges.equalToSuperview() | ||
} | ||
|
||
let radioButtonImage = ImageLiterals.TransparencyInfo.btnRadio | ||
|
||
self.transparentReasonView.firstReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.secondReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.thirdReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fourthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.fifthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.sixthReasonView.radioButton.setImage(radioButtonImage, for: .normal) | ||
self.transparentReasonView.warnLabel.isHidden = true | ||
self.ghostReason = "" | ||
if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate { | ||
DispatchQueue.main.async { | ||
let rootViewController = LoginViewController(viewModel: LoginViewModel(networkProvider: NetworkService())) | ||
sceneDelegate.window?.rootViewController = UINavigationController(rootViewController: rootViewController) | ||
} | ||
} | ||
|
||
saveUserData(UserInfo(isSocialLogined: false, | ||
isFirstUser: false, | ||
isJoinedApp: true, | ||
isOnboardingFinished: true, | ||
userNickname: loadUserData()?.userNickname ?? "", | ||
memberId: loadUserData()?.memberId ?? 0, | ||
userProfileImage: loadUserData()?.userProfileImage ?? StringLiterals.Network.baseImageURL)) | ||
|
||
OnboardingViewController.pushCount = 0 | ||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드 리뷰 및 개선 제안:
코드는 보호 문제가 없어 보이나, 항상 코드 베이스를 테스트하여 예상대로 작동하는지 확인하십시오. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 코드 패치는 꽤 안정적으로 보입니다. 몇 가지 주의 사항과 개선 제안은 다음과 같습니다:
isDeleted
속성이 추가되었으나, 다른 속성들과의 일관성을 유지하기 위해PostDetailResponseDTO
의 초기화나 서드파티 생성자에서 해당 필드에 대한 처리가 필요합니다.let
상수이므로 변경할 필요가 없다면var
로 변경되어야 합니다.위 내용을 고려하여 코드를 수정하면 더 강력하고 읽기 쉬운 코드가 될 것입니다.