From 8cf15c414578077e5b10b7fee02216e91b79ec34 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 17 Jan 2023 18:01:34 +0900 Subject: [PATCH 001/388] [CHORE] team name button created (#275) --- .../Global/Literal/ImageLiteral.swift | 1 + .../Screen/Home/Home/HomeViewController.swift | 172 ++++++++++-------- 2 files changed, 101 insertions(+), 72 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift index 6d7f1622..f3de7f66 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift @@ -22,6 +22,7 @@ enum ImageLiterals { static var icEllipsis: UIImage { .load(systemName: "ellipsis") } static var icBottom: UIImage { .load(systemName: "chevron.down") } static var icPersonCircle: UIImage { .load(systemName: "person.crop.circle") } + static var icChevronDown: UIImage { .load(systemName: "chevron.down").withConfiguration(UIImage.SymbolConfiguration(pointSize: 13, weight: .semibold))} // MARK: - image diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 38cd09f2..805caaa8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -38,17 +38,17 @@ final class HomeViewController: BaseViewController { // MARK: - property - private let toastView: UIView = { - let view = UIView() - view.layer.cornerRadius = 10 - view.clipsToBounds = true - return view - }() - private let toastContentView: ToastContentView = { - let view = ToastContentView() - view.toastType = .complete - return view - }() +// private let toastView: UIView = { +// let view = UIView() +// view.layer.cornerRadius = 10 +// view.clipsToBounds = true +// return view +// }() +// private let toastContentView: ToastContentView = { +// let view = ToastContentView() +// view.toastType = .complete +// return view +// }() private lazy var flowLayout: KeywordCollectionViewFlowLayout = { let layout = KeywordCollectionViewFlowLayout() layout.count = keywordList.count @@ -60,21 +60,35 @@ final class HomeViewController: BaseViewController { collectionView.register(KeywordCollectionViewCell.self, forCellWithReuseIdentifier: KeywordCollectionViewCell.className) return collectionView }() + private lazy var teamButton: UIButton = { + let button = UIButton() + let action = UIAction { _ in + // FIXME: 버튼 눌렀을 때 action 추가 + } + button.addAction(action, for: .touchUpInside) + return button + }() private lazy var teamNameLabel: UILabel = { let label = UILabel() label.textColor = .black100 + label.font = .main label.numberOfLines = 0 return label }() - private let invitationCodeButton: UIButton = { - let button = UIButton() - button.setTitle(TextLiteral.mainViewControllerInvitationButtonText, for: .normal) - button.setTitleColor(UIColor.blue200, for: .normal) - button.titleLabel?.font = .caption2 - button.backgroundColor = .gray100 - button.layer.cornerRadius = 4 - return button - }() + private let arrowDownImageView: UIImageView = { + let image = UIImageView(image: ImageLiterals.icChevronDown) + image.tintColor = .black100 + return image + }() +// private let invitationCodeButton: UIButton = { +// let button = UIButton() +// button.setTitle(TextLiteral.mainViewControllerInvitationButtonText, for: .normal) +// button.setTitleColor(UIColor.blue200, for: .normal) +// button.titleLabel?.font = .caption2 +// button.backgroundColor = .gray100 +// button.layer.cornerRadius = 4 +// return button +// }() private let descriptionLabel: UILabel = { let label = UILabel() label.font = .caption1 @@ -133,6 +147,7 @@ final class HomeViewController: BaseViewController { super.viewDidLoad() setUpDelegation() render() + self.navigationController?.isNavigationBarHidden = true } override func viewWillAppear(_ animated: Bool) { @@ -146,36 +161,48 @@ final class HomeViewController: BaseViewController { override func configUI() { view.backgroundColor = .white200 - setGradientToastView() +// setGradientToastView() } override func render() { - navigationController?.view.addSubview(toastView) - toastView.snp.makeConstraints { - $0.top.equalToSuperview().inset(-60) - $0.centerX.equalToSuperview() - $0.height.equalTo(46) - } +// navigationController?.view.addSubview(toastView) +// toastView.snp.makeConstraints { +// $0.top.equalToSuperview().inset(-60) +// $0.centerX.equalToSuperview() +// $0.height.equalTo(46) +// } - toastView.addSubview(toastContentView) - toastContentView.snp.makeConstraints { - $0.edges.equalToSuperview() +// toastView.addSubview(toastContentView) +// toastContentView.snp.makeConstraints { +// $0.edges.equalToSuperview() +// } +// toastContentView.render() + + view.addSubview(teamButton) + teamButton.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) + $0.height.equalTo(SizeLiteral.minimumTouchArea) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } - toastContentView.render() - view.addSubview(teamNameLabel) + teamButton.addSubview(teamNameLabel) teamNameLabel.snp.makeConstraints { - $0.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(SizeLiteral.topPadding) - $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.centerY.leading.equalToSuperview() } - view.addSubview(invitationCodeButton) - invitationCodeButton.snp.makeConstraints { - $0.leading.equalTo(teamNameLabel.snp.trailing).offset(Size.labelButtonPadding) - $0.width.equalTo(Size.subButtonWidth) - $0.height.equalTo(Size.subButtonHeight) - $0.bottom.equalTo(teamNameLabel.snp.bottom).offset(-5) + teamButton.addSubview(arrowDownImageView) + arrowDownImageView.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalTo(teamNameLabel.snp.trailing).offset(4) +// $0.width.equalTo(14) } +// view.addSubview(invitationCodeButton) +// invitationCodeButton.snp.makeConstraints { +// $0.leading.equalTo(teamNameLabel.snp.trailing).offset(Size.labelButtonPadding) +// $0.width.equalTo(Size.subButtonWidth) +// $0.height.equalTo(Size.subButtonHeight) +// $0.bottom.equalTo(teamNameLabel.snp.bottom).offset(-5) +// } view.addSubview(descriptionLabel) descriptionLabel.snp.makeConstraints { @@ -231,41 +258,41 @@ final class HomeViewController: BaseViewController { present(viewController, animated: true) } - private func setGradientToastView() { - toastView.layoutIfNeeded() - toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) - } +// private func setGradientToastView() { +// toastView.layoutIfNeeded() +// toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) +// } private func setGradientJoinReflectionView() { joinReflectionButton.layoutIfNeeded() joinReflectionButton.setGradient(colorTop: .gradientBlueTop, colorBottom: .gradientBlueBottom) } - private func showToastPopUp(of type: ToastType) { - if !isTouched { - isTouched = true - DispatchQueue.main.async { - self.toastContentView.toastType = type - } - UIView.animate(withDuration: 0.5, delay: 0, animations: { - self.toastView.transform = CGAffineTransform(translationX: 0, y: 115) - }, completion: {_ in - UIView.animate(withDuration: 1, delay: 0.8, animations: { - self.toastView.transform = .identity - }, completion: {_ in - self.isTouched = false - }) - }) - } - } - - private func setupCopyCodeButton(code: String) { - let action = UIAction { [weak self] _ in - UIPasteboard.general.string = code - self?.showToastPopUp(of: .complete) - } - invitationCodeButton.addAction(action, for: .touchUpInside) - } +// private func showToastPopUp(of type: ToastType) { +// if !isTouched { +// isTouched = true +// DispatchQueue.main.async { +// self.toastContentView.toastType = type +// } +// UIView.animate(withDuration: 0.5, delay: 0, animations: { +// self.toastView.transform = CGAffineTransform(translationX: 0, y: 115) +// }, completion: {_ in +// UIView.animate(withDuration: 1, delay: 0.8, animations: { +// self.toastView.transform = .identity +// }, completion: {_ in +// self.isTouched = false +// }) +// }) +// } +// } + +// private func setupCopyCodeButton(code: String) { +// let action = UIAction { [weak self] _ in +// UIPasteboard.general.string = code +// self?.showToastPopUp(of: .complete) +// } +// invitationCodeButton.addAction(action, for: .touchUpInside) +// } private func presentCreateReflectionViewController() { let viewController = UINavigationController(rootViewController: CreateReflectionViewController(reflectionId: currentReflectionId)) @@ -388,8 +415,9 @@ final class HomeViewController: BaseViewController { else { return } self.isAdmin = isAdmin DispatchQueue.main.async { - self.teamNameLabel.setTitleFont(text: teamName) - self.setupCopyCodeButton(code: invitationCode) + self.teamNameLabel.text = teamName +// self.teamNameLabel.setTitleFont(text: teamName) +// self.setupCopyCodeButton(code: invitationCode) if isAdmin { self.renderPlanLabelButton() } @@ -475,7 +503,7 @@ extension HomeViewController: UICollectionViewDataSource { switch reflectionStatus { case .Before, .SettingRequired, .Done: if hasKeyword { - showToastPopUp(of: .warning) +// showToastPopUp(of: .warning) } else { didTapAddFeedbackButton() } From 76d0616891a5062a544e2a5f4cea0b4d799314d1 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 18 Jan 2023 17:10:30 +0900 Subject: [PATCH 002/388] [CHORE] minimum change for current PR completed (#275) --- .../Global/Literal/ImageLiteral.swift | 1 + .../Global/Literal/SizeLiteral.swift | 1 + .../Screen/Home/Home/HomeViewController.swift | 165 +++++------------- 3 files changed, 41 insertions(+), 126 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift index f3de7f66..c8f0e2c7 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift @@ -23,6 +23,7 @@ enum ImageLiterals { static var icBottom: UIImage { .load(systemName: "chevron.down") } static var icPersonCircle: UIImage { .load(systemName: "person.crop.circle") } static var icChevronDown: UIImage { .load(systemName: "chevron.down").withConfiguration(UIImage.SymbolConfiguration(pointSize: 13, weight: .semibold))} + static var icTeamMananage: UIImage { .load(systemName: "person.2.circle") } // MARK: - image diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift index 0c9a2201..e1883c65 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift @@ -12,6 +12,7 @@ enum SizeLiteral { // MARK: - common static let leadingTrailingPadding: CGFloat = 24 + static let buttonLeadingTrailingPadding: CGFloat = 20 static let topPadding: CGFloat = 12 static let bottomPadding: CGFloat = 2 static let bottomTabBarPadding: CGFloat = 12 diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 805caaa8..d186aed2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -18,7 +18,7 @@ final class HomeViewController: BaseViewController { private enum Size { static let keywordLabelHeight: CGFloat = 50 static let labelButtonPadding: CGFloat = 6 - static let propertyPadding: CGFloat = 40 + static let propertyPadding: CGFloat = 32 static let buttonCornerRadius: CGFloat = 27 static let mainButtonHeight: CGFloat = 54 static let subButtonWidth: CGFloat = 54 @@ -38,17 +38,6 @@ final class HomeViewController: BaseViewController { // MARK: - property -// private let toastView: UIView = { -// let view = UIView() -// view.layer.cornerRadius = 10 -// view.clipsToBounds = true -// return view -// }() -// private let toastContentView: ToastContentView = { -// let view = ToastContentView() -// view.toastType = .complete -// return view -// }() private lazy var flowLayout: KeywordCollectionViewFlowLayout = { let layout = KeywordCollectionViewFlowLayout() layout.count = keywordList.count @@ -64,6 +53,7 @@ final class HomeViewController: BaseViewController { let button = UIButton() let action = UIAction { _ in // FIXME: 버튼 눌렀을 때 action 추가 + print("touched") } button.addAction(action, for: .touchUpInside) return button @@ -80,20 +70,19 @@ final class HomeViewController: BaseViewController { image.tintColor = .black100 return image }() -// private let invitationCodeButton: UIButton = { -// let button = UIButton() -// button.setTitle(TextLiteral.mainViewControllerInvitationButtonText, for: .normal) -// button.setTitleColor(UIColor.blue200, for: .normal) -// button.titleLabel?.font = .caption2 -// button.backgroundColor = .gray100 -// button.layer.cornerRadius = 4 -// return button -// }() - private let descriptionLabel: UILabel = { - let label = UILabel() - label.font = .caption1 - label.textColor = .gray400 - return label + private lazy var teamManageButton: UIButton = { + let button = UIButton() + let action = UIAction { _ in + // FIXME: 버튼 눌렀을 때 action 추가 + print("touched") + } + button.addAction(action, for: .touchUpInside) + return button + }() + private let teamManageImageView: UIImageView = { + let image = UIImageView(image: ImageLiterals.icTeamMananage) + image.tintColor = .gray600 + return image }() private let currentReflectionLabel: UILabel = { let label = UILabel() @@ -147,6 +136,7 @@ final class HomeViewController: BaseViewController { super.viewDidLoad() setUpDelegation() render() + setGradientJoinReflectionView() self.navigationController?.isNavigationBarHidden = true } @@ -161,23 +151,9 @@ final class HomeViewController: BaseViewController { override func configUI() { view.backgroundColor = .white200 -// setGradientToastView() } override func render() { -// navigationController?.view.addSubview(toastView) -// toastView.snp.makeConstraints { -// $0.top.equalToSuperview().inset(-60) -// $0.centerX.equalToSuperview() -// $0.height.equalTo(46) -// } - -// toastView.addSubview(toastContentView) -// toastContentView.snp.makeConstraints { -// $0.edges.equalToSuperview() -// } -// toastContentView.render() - view.addSubview(teamButton) teamButton.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) @@ -194,25 +170,32 @@ final class HomeViewController: BaseViewController { arrowDownImageView.snp.makeConstraints { $0.centerY.equalToSuperview() $0.leading.equalTo(teamNameLabel.snp.trailing).offset(4) -// $0.width.equalTo(14) + $0.trailing.equalTo(teamButton) } -// view.addSubview(invitationCodeButton) -// invitationCodeButton.snp.makeConstraints { -// $0.leading.equalTo(teamNameLabel.snp.trailing).offset(Size.labelButtonPadding) -// $0.width.equalTo(Size.subButtonWidth) -// $0.height.equalTo(Size.subButtonHeight) -// $0.bottom.equalTo(teamNameLabel.snp.bottom).offset(-5) -// } - view.addSubview(descriptionLabel) - descriptionLabel.snp.makeConstraints { - $0.top.equalTo(teamNameLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) - $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + view.addSubview(teamManageButton) + teamManageButton.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) + $0.width.height.equalTo(SizeLiteral.minimumTouchArea) + $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + + teamManageButton.addSubview(teamManageImageView) + teamManageImageView.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.trailing.equalToSuperview() + $0.width.height.equalTo(30) + } + + view.addSubview(joinReflectionButton) + joinReflectionButton.snp.makeConstraints { + $0.top.equalTo(teamButton.snp.bottom).offset(7) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.buttonLeadingTrailingPadding) } view.addSubview(currentReflectionLabel) currentReflectionLabel.snp.makeConstraints { - $0.top.equalTo(descriptionLabel.snp.bottom).offset(Size.propertyPadding) + $0.top.equalTo(joinReflectionButton.snp.bottom).offset(Size.propertyPadding) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } @@ -258,42 +241,12 @@ final class HomeViewController: BaseViewController { present(viewController, animated: true) } -// private func setGradientToastView() { -// toastView.layoutIfNeeded() -// toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) -// } - private func setGradientJoinReflectionView() { joinReflectionButton.layoutIfNeeded() joinReflectionButton.setGradient(colorTop: .gradientBlueTop, colorBottom: .gradientBlueBottom) + joinReflectionButton.render() } -// private func showToastPopUp(of type: ToastType) { -// if !isTouched { -// isTouched = true -// DispatchQueue.main.async { -// self.toastContentView.toastType = type -// } -// UIView.animate(withDuration: 0.5, delay: 0, animations: { -// self.toastView.transform = CGAffineTransform(translationX: 0, y: 115) -// }, completion: {_ in -// UIView.animate(withDuration: 1, delay: 0.8, animations: { -// self.toastView.transform = .identity -// }, completion: {_ in -// self.isTouched = false -// }) -// }) -// } -// } - -// private func setupCopyCodeButton(code: String) { -// let action = UIAction { [weak self] _ in -// UIPasteboard.general.string = code -// self?.showToastPopUp(of: .complete) -// } -// invitationCodeButton.addAction(action, for: .touchUpInside) -// } - private func presentCreateReflectionViewController() { let viewController = UINavigationController(rootViewController: CreateReflectionViewController(reflectionId: currentReflectionId)) viewController.modalPresentationStyle = .fullScreen @@ -337,28 +290,6 @@ final class HomeViewController: BaseViewController { UserDefaultHandler.clearUserDefaults(of: .completedCurrentReflection) } - private func showJoinReflectionButton() { - view.addSubview(joinReflectionButton) - joinReflectionButton.snp.makeConstraints { - $0.top.equalTo(descriptionLabel.snp.bottom).offset(16) - $0.horizontalEdges.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - } - - currentReflectionLabel.snp.remakeConstraints { - $0.top.equalTo(joinReflectionButton.snp.bottom).offset(24) - $0.horizontalEdges.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - } - - keywordCollectionView.snp.remakeConstraints { - $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) - $0.horizontalEdges.equalTo(view.safeAreaLayoutGuide) - $0.bottom.equalTo(view.safeAreaLayoutGuide).offset(-SizeLiteral.bottomTabBarPadding) - } - - setGradientJoinReflectionView() - joinReflectionButton.render() - } - private func hideAddFeedbackButton() { self.addFeedbackButton.isHidden = true keywordCollectionView.snp.remakeConstraints { @@ -370,11 +301,6 @@ final class HomeViewController: BaseViewController { // 회고 상태: Done private func restoreView() { - currentReflectionLabel.snp.remakeConstraints { - $0.top.equalTo(descriptionLabel.snp.bottom).offset(Size.propertyPadding) - $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - } - if isAdmin { keywordCollectionView.snp.remakeConstraints { $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) @@ -410,14 +336,11 @@ final class HomeViewController: BaseViewController { ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { guard let isAdmin = json.detail?.admin, - let teamName = json.detail?.teamName, - let invitationCode = json.detail?.invitationCode + let teamName = json.detail?.teamName else { return } self.isAdmin = isAdmin DispatchQueue.main.async { self.teamNameLabel.text = teamName -// self.teamNameLabel.setTitleFont(text: teamName) -// self.setupCopyCodeButton(code: invitationCode) if isAdmin { self.renderPlanLabelButton() } @@ -449,19 +372,13 @@ final class HomeViewController: BaseViewController { DispatchQueue.main.async { switch reflectionStatus { case .SettingRequired, .Done: - self.descriptionLabel.text = TextLiteral.homeViewControllerEmptyDescriptionLabel self.addFeedbackButton.isHidden = false self.hideJoinReflectionButton() self.showPlanLabelButton() self.restoreView() case .Before: - let reflectionDate = reflectionDetail?.reflectionDate?.formatDateString(to: "M월 d일 a h시 m분") - self.descriptionLabel.text = "다음 회고는 \(reflectionDate ?? String(describing: Date()))입니다" self.hidePlanLabelButton() case .Progressing: - let reflectionDate = reflectionDetail?.reflectionDate?.formatDateString(to: "M월 d일 a h시 m분") - self.descriptionLabel.text = "다음 회고는 \(reflectionDate ?? String(describing: Date()))입니다" - self.showJoinReflectionButton() self.hidePlanLabelButton() self.hideAddFeedbackButton() if !self.hasSeenReflectionAlert { @@ -502,11 +419,7 @@ extension HomeViewController: UICollectionViewDataSource { UIDevice.vibrate() switch reflectionStatus { case .Before, .SettingRequired, .Done: - if hasKeyword { -// showToastPopUp(of: .warning) - } else { - didTapAddFeedbackButton() - } + didTapAddFeedbackButton() case .Progressing: guard let navigationController = self.navigationController else { return } let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: isAdmin)) From 87d9fc48f04d564114351f03a4d44448b95e36f6 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 18 Jan 2023 17:52:24 +0900 Subject: [PATCH 003/388] =?UTF-8?q?[CHORE]=20=ED=95=84=EC=9A=94=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?(#275)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index d186aed2..c3b33574 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -373,7 +373,6 @@ final class HomeViewController: BaseViewController { switch reflectionStatus { case .SettingRequired, .Done: self.addFeedbackButton.isHidden = false - self.hideJoinReflectionButton() self.showPlanLabelButton() self.restoreView() case .Before: From 371b9022496ed6384f233ad9e8def6c3b8a52fed Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 18 Jan 2023 18:45:28 +0900 Subject: [PATCH 004/388] [CHORE] joinReflectionButton status added (#277) --- .../Global/Literal/TextLiteral.swift | 6 +- .../UIComponent/JoinReflectionButton.swift | 66 ++++++++++++++----- 2 files changed, 55 insertions(+), 17 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index f0f2bb83..1780d38d 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -188,8 +188,10 @@ enum TextLiteral { // MARK: - JoinReflectionButton - static let joinReflectionButtonStatusText: String = "회고가 시작되었습니다!" - static let joinReflectionTouchToEnterLabel: String = "터치하여 회고에 참여해주세요" + static let reflectionTitleLabelSettingRequired: String = "아직 회고 일정이 정해지지 않았습니다" + static let reflectionTitleLabelProgressing: String = "회고가 시작되었습니다!" + static let reflectionDescriptionLabelSettingRequired: String = "회고 일정을 정해주세요" + static let reflectionDescriptionLabelProgressing: String = "터치하여 회고에 참여해주세요" // MARK: - MyReflectionViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift index 7dbcc9c7..c3032eee 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift @@ -11,35 +11,71 @@ import SnapKit final class JoinReflectionButton: UIView { + var reflectionStatus: ReflectionStatus + var reflectionTitle: String + var reflectionDate: Date + var buttonAction: (() -> ())? // MARK: - property private let joinButton = UIButton() - private let reflectionStatusLabel: UILabel = { + private lazy var reflectionTitleLabel: UILabel = { let label = UILabel() + switch reflectionStatus { + case .SettingRequired, .Done: + label.text = TextLiteral.reflectionTitleLabelSettingRequired + label.textColor = .gray600 + case .Before: + label.text = reflectionTitle + label.textColor = .gray600 + case .Progressing: + label.text = TextLiteral.reflectionTitleLabelProgressing + label.textColor = .white100 + } label.font = .label2 - label.text = TextLiteral.joinReflectionButtonStatusText - label.textColor = .white100 return label }() - private let touchToEnterLabel: UILabel = { + private lazy var reflectionDescriptionLabel: UILabel = { let label = UILabel() + switch reflectionStatus { + case .SettingRequired, .Done: + label.text = TextLiteral.reflectionDescriptionLabelSettingRequired + label.textColor = .gray500 + case .Before: + label.text = reflectionDate.description.formatDateString(to: "M월 d일 (EEE) HH:mm") + label.textColor = .gray500 + case .Progressing: + label.text = TextLiteral.reflectionDescriptionLabelProgressing + label.textColor = .white100 + } label.font = .caption3 - label.text = TextLiteral.joinReflectionTouchToEnterLabel - label.textColor = .white100 return label }() - private let calendarImageView = UIImageView(image: ImageLiterals.imgYellowCalendar) + private lazy var calendarImageView: UIImageView = { + let imageView = UIImageView() + switch reflectionStatus { + case .SettingRequired, .Done: + imageView.image = ImageLiterals.imgEmptyCalendar + case .Before: + imageView.image = ImageLiterals.imgCalendar + case .Progressing: + imageView.image = ImageLiterals.imgYellowCalendar + } + return imageView + }() // MARK: - life cycle - override init(frame: CGRect) { - super.init(frame: frame) + init(reflectionStatus: ReflectionStatus, title: String, date: Date) { + self.reflectionStatus = reflectionStatus + self.reflectionTitle = title + self.reflectionDate = date + super.init(frame: .zero) render() setupJoinButtonAction() } - + required init?(coder: NSCoder) { nil } func render() { @@ -48,16 +84,16 @@ final class JoinReflectionButton: UIView { $0.edges.equalToSuperview() } - joinButton.addSubview(reflectionStatusLabel) - reflectionStatusLabel.snp.makeConstraints { + joinButton.addSubview(reflectionTitleLabel) + reflectionTitleLabel.snp.makeConstraints { $0.leading.equalToSuperview().inset(18) $0.top.equalToSuperview().inset(18) } - joinButton.addSubview(touchToEnterLabel) - touchToEnterLabel.snp.makeConstraints { + joinButton.addSubview(reflectionDescriptionLabel) + reflectionDescriptionLabel.snp.makeConstraints { $0.leading.equalToSuperview().inset(18) - $0.top.equalTo(reflectionStatusLabel.snp.bottom).offset(6) + $0.top.equalTo(reflectionTitleLabel.snp.bottom).offset(6) } joinButton.addSubview(calendarImageView) From 1ed251b8f27b0bf353e6e1b9787bf62c410cc0d2 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 19 Jan 2023 14:23:04 +0900 Subject: [PATCH 005/388] [CHORE] teamButton touch feedback added / @chemi code review (#275) --- .../Global/Literal/ImageLiteral.swift | 2 +- .../Screen/Home/Home/HomeViewController.swift | 49 +++++-------------- 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift index c8f0e2c7..1e49df06 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift @@ -22,7 +22,7 @@ enum ImageLiterals { static var icEllipsis: UIImage { .load(systemName: "ellipsis") } static var icBottom: UIImage { .load(systemName: "chevron.down") } static var icPersonCircle: UIImage { .load(systemName: "person.crop.circle") } - static var icChevronDown: UIImage { .load(systemName: "chevron.down").withConfiguration(UIImage.SymbolConfiguration(pointSize: 13, weight: .semibold))} + static var icChevronDown: UIImage { .load(systemName: "chevron.down") } static var icTeamMananage: UIImage { .load(systemName: "person.2.circle") } // MARK: - image diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index c3b33574..cfe6bc40 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -50,7 +50,12 @@ final class HomeViewController: BaseViewController { return collectionView }() private lazy var teamButton: UIButton = { - let button = UIButton() + let button = UIButton(type: .system) + button.titleLabel?.font = .main + button.setImage(ImageLiterals.icChevronDown, for: .normal) + button.semanticContentAttribute = .forceRightToLeft + button.setPreferredSymbolConfiguration(UIImage.SymbolConfiguration(pointSize: 13, weight: .semibold), forImageIn: .normal) + button.tintColor = .black100 let action = UIAction { _ in // FIXME: 버튼 눌렀을 때 action 추가 print("touched") @@ -58,20 +63,12 @@ final class HomeViewController: BaseViewController { button.addAction(action, for: .touchUpInside) return button }() - private lazy var teamNameLabel: UILabel = { - let label = UILabel() - label.textColor = .black100 - label.font = .main - label.numberOfLines = 0 - return label - }() - private let arrowDownImageView: UIImageView = { - let image = UIImageView(image: ImageLiterals.icChevronDown) - image.tintColor = .black100 - return image - }() private lazy var teamManageButton: UIButton = { let button = UIButton() + button.setImage(ImageLiterals.icTeamMananage, for: .normal) + button.semanticContentAttribute = .forceRightToLeft + button.setPreferredSymbolConfiguration(UIImage.SymbolConfiguration(pointSize: 20), forImageIn: .normal) + button.tintColor = .gray600 let action = UIAction { _ in // FIXME: 버튼 눌렀을 때 action 추가 print("touched") @@ -79,11 +76,6 @@ final class HomeViewController: BaseViewController { button.addAction(action, for: .touchUpInside) return button }() - private let teamManageImageView: UIImageView = { - let image = UIImageView(image: ImageLiterals.icTeamMananage) - image.tintColor = .gray600 - return image - }() private let currentReflectionLabel: UILabel = { let label = UILabel() label.text = TextLiteral.mainViewControllerCurrentReflectionKeyword @@ -161,18 +153,6 @@ final class HomeViewController: BaseViewController { $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } - teamButton.addSubview(teamNameLabel) - teamNameLabel.snp.makeConstraints { - $0.centerY.leading.equalToSuperview() - } - - teamButton.addSubview(arrowDownImageView) - arrowDownImageView.snp.makeConstraints { - $0.centerY.equalToSuperview() - $0.leading.equalTo(teamNameLabel.snp.trailing).offset(4) - $0.trailing.equalTo(teamButton) - } - view.addSubview(teamManageButton) teamManageButton.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) @@ -180,13 +160,6 @@ final class HomeViewController: BaseViewController { $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } - teamManageButton.addSubview(teamManageImageView) - teamManageImageView.snp.makeConstraints { - $0.centerY.equalToSuperview() - $0.trailing.equalToSuperview() - $0.width.height.equalTo(30) - } - view.addSubview(joinReflectionButton) joinReflectionButton.snp.makeConstraints { $0.top.equalTo(teamButton.snp.bottom).offset(7) @@ -340,7 +313,7 @@ final class HomeViewController: BaseViewController { else { return } self.isAdmin = isAdmin DispatchQueue.main.async { - self.teamNameLabel.text = teamName + self.teamButton.setTitle(teamName, for: .normal) if isAdmin { self.renderPlanLabelButton() } From 8b872f4ab1ff352cd4132b3e34ce87234bcf5cd8 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 19 Jan 2023 14:49:14 +0900 Subject: [PATCH 006/388] [CHORE] applied joinreflectionbutton (#277) --- .../Screen/Home/Home/HomeViewController.swift | 15 +++++++++++++-- .../Home/UIComponent/JoinReflectionButton.swift | 6 +++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 38cd09f2..8ded0641 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -28,6 +28,9 @@ final class HomeViewController: BaseViewController { var currentReflectionId: Int = 0 var reflectionStatus: ReflectionStatus = .Before + var reflectionTitle: String = "" + var reflectionDate: String = "" + var hasKeyword: Bool = false var isAdmin: Bool = false var hasSeenReflectionAlert: Bool = UserDefaultStorage.hasSeenReflectionAlert { @@ -89,7 +92,11 @@ final class HomeViewController: BaseViewController { return label }() private lazy var joinReflectionButton: JoinReflectionButton = { - let joinButton = JoinReflectionButton() + let joinButton = JoinReflectionButton( + reflectionStatus: reflectionStatus, + title: reflectionTitle, + date: reflectionDate + ) joinButton.layer.cornerRadius = 10 joinButton.clipsToBounds = true joinButton.buttonAction = { [weak self] in @@ -406,11 +413,15 @@ final class HomeViewController: BaseViewController { if let json = json.value { let reflectionDetail = json.detail guard let reflectionStatus = reflectionDetail?.reflectionStatus, - let reflectionId = reflectionDetail?.currentReflectionId + let reflectionId = reflectionDetail?.currentReflectionId, + let reflectionTitle = reflectionDetail?.reflectionName, + let reflectionDate = reflectionDetail?.reflectionDate else { return } self.currentReflectionId = reflectionId self.reflectionStatus = reflectionStatus + self.reflectionTitle = reflectionTitle + self.reflectionDate = reflectionDate if let reflectionKeywordList = reflectionDetail?.reflectionKeywords { self.hasKeyword = true if reflectionKeywordList.isEmpty { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift index c3032eee..ca732df4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift @@ -13,7 +13,7 @@ final class JoinReflectionButton: UIView { var reflectionStatus: ReflectionStatus var reflectionTitle: String - var reflectionDate: Date + var reflectionDate: String var buttonAction: (() -> ())? @@ -43,7 +43,7 @@ final class JoinReflectionButton: UIView { label.text = TextLiteral.reflectionDescriptionLabelSettingRequired label.textColor = .gray500 case .Before: - label.text = reflectionDate.description.formatDateString(to: "M월 d일 (EEE) HH:mm") + label.text = reflectionDate.formatDateString(to: "M월 d일 (EEE) HH:mm") label.textColor = .gray500 case .Progressing: label.text = TextLiteral.reflectionDescriptionLabelProgressing @@ -67,7 +67,7 @@ final class JoinReflectionButton: UIView { // MARK: - life cycle - init(reflectionStatus: ReflectionStatus, title: String, date: Date) { + init(reflectionStatus: ReflectionStatus, title: String, date: String) { self.reflectionStatus = reflectionStatus self.reflectionTitle = title self.reflectionDate = date From f82aed936d798c252277e165cd1a8c46c18209b0 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 19 Jan 2023 14:51:43 +0900 Subject: [PATCH 007/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#275)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index cfe6bc40..40d7b297 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -128,8 +128,6 @@ final class HomeViewController: BaseViewController { super.viewDidLoad() setUpDelegation() render() - setGradientJoinReflectionView() - self.navigationController?.isNavigationBarHidden = true } override func viewWillAppear(_ animated: Bool) { @@ -142,6 +140,8 @@ final class HomeViewController: BaseViewController { } override func configUI() { + setGradientJoinReflectionView() + navigationController?.isNavigationBarHidden = true view.backgroundColor = .white200 } From 1a461ecb5a311fce0a5e97d88403d293f6a602ae Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sat, 21 Jan 2023 02:12:35 +0900 Subject: [PATCH 008/388] [CHORE] applied reflection status change to joinreflectionbutton (#277) --- .../Screen/Home/Home/HomeViewController.swift | 28 +++---- .../UIComponent/JoinReflectionButton.swift | 73 ++++++++----------- 2 files changed, 45 insertions(+), 56 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 52a79b39..bb28fcf8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -87,11 +87,7 @@ final class HomeViewController: BaseViewController { return label }() private lazy var joinReflectionButton: JoinReflectionButton = { - let joinButton = JoinReflectionButton( - reflectionStatus: reflectionStatus, - title: reflectionTitle, - date: reflectionDate - ) + let joinButton = JoinReflectionButton() joinButton.layer.cornerRadius = 10 joinButton.clipsToBounds = true joinButton.buttonAction = { [weak self] in @@ -147,7 +143,7 @@ final class HomeViewController: BaseViewController { } override func configUI() { - setGradientJoinReflectionView() + setJoinReflectionButtonBackground() navigationController?.isNavigationBarHidden = true view.backgroundColor = .white200 } @@ -221,10 +217,15 @@ final class HomeViewController: BaseViewController { present(viewController, animated: true) } - private func setGradientJoinReflectionView() { - joinReflectionButton.layoutIfNeeded() - joinReflectionButton.setGradient(colorTop: .gradientBlueTop, colorBottom: .gradientBlueBottom) - joinReflectionButton.render() + private func setJoinReflectionButtonBackground() { + switch reflectionStatus { + case .SettingRequired, .Before, .Done: + joinReflectionButton.backgroundColor = .white100 + case .Progressing: + joinReflectionButton.layoutIfNeeded() + joinReflectionButton.setGradient(colorTop: .gradientBlueTop, colorBottom: .gradientBlueBottom) + joinReflectionButton.render() + } } private func presentCreateReflectionViewController() { @@ -343,9 +344,10 @@ final class HomeViewController: BaseViewController { else { return } self.currentReflectionId = reflectionId - self.reflectionStatus = reflectionStatus - self.reflectionTitle = reflectionTitle - self.reflectionDate = reflectionDate +// self.reflectionStatus = reflectionStatus +// self.reflectionTitle = reflectionTitle +// self.reflectionDate = reflectionDate + self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate) if let reflectionKeywordList = reflectionDetail?.reflectionKeywords { self.hasKeyword = true if reflectionKeywordList.isEmpty { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift index ca732df4..141903d3 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift @@ -11,10 +11,6 @@ import SnapKit final class JoinReflectionButton: UIView { - var reflectionStatus: ReflectionStatus - var reflectionTitle: String - var reflectionDate: String - var buttonAction: (() -> ())? // MARK: - property @@ -22,55 +18,19 @@ final class JoinReflectionButton: UIView { private let joinButton = UIButton() private lazy var reflectionTitleLabel: UILabel = { let label = UILabel() - switch reflectionStatus { - case .SettingRequired, .Done: - label.text = TextLiteral.reflectionTitleLabelSettingRequired - label.textColor = .gray600 - case .Before: - label.text = reflectionTitle - label.textColor = .gray600 - case .Progressing: - label.text = TextLiteral.reflectionTitleLabelProgressing - label.textColor = .white100 - } label.font = .label2 return label }() - private lazy var reflectionDescriptionLabel: UILabel = { + private let reflectionDescriptionLabel: UILabel = { let label = UILabel() - switch reflectionStatus { - case .SettingRequired, .Done: - label.text = TextLiteral.reflectionDescriptionLabelSettingRequired - label.textColor = .gray500 - case .Before: - label.text = reflectionDate.formatDateString(to: "M월 d일 (EEE) HH:mm") - label.textColor = .gray500 - case .Progressing: - label.text = TextLiteral.reflectionDescriptionLabelProgressing - label.textColor = .white100 - } label.font = .caption3 return label }() - private lazy var calendarImageView: UIImageView = { - let imageView = UIImageView() - switch reflectionStatus { - case .SettingRequired, .Done: - imageView.image = ImageLiterals.imgEmptyCalendar - case .Before: - imageView.image = ImageLiterals.imgCalendar - case .Progressing: - imageView.image = ImageLiterals.imgYellowCalendar - } - return imageView - }() + private let calendarImageView = UIImageView() // MARK: - life cycle - init(reflectionStatus: ReflectionStatus, title: String, date: String) { - self.reflectionStatus = reflectionStatus - self.reflectionTitle = title - self.reflectionDate = date + init() { super.init(frame: .zero) render() setupJoinButtonAction() @@ -113,4 +73,31 @@ final class JoinReflectionButton: UIView { } joinButton.addAction(action, for: .touchUpInside) } + +// private func setJoinReflectionShadow() { +// +// } + + func setupAttribute(reflectionStatus: ReflectionStatus, title: String, date: String) { + switch reflectionStatus { + case .SettingRequired, .Done: + reflectionTitleLabel.text = TextLiteral.reflectionTitleLabelSettingRequired + reflectionTitleLabel.textColor = .gray600 + reflectionDescriptionLabel.text = TextLiteral.reflectionDescriptionLabelSettingRequired + reflectionDescriptionLabel.textColor = .gray500 + calendarImageView.image = ImageLiterals.imgEmptyCalendar + case .Before: + reflectionTitleLabel.text = title + reflectionTitleLabel.textColor = .gray600 + reflectionDescriptionLabel.text = date.formatDateString(to: "M월 d일 (EEE) HH:mm") + reflectionDescriptionLabel.textColor = .gray500 + calendarImageView.image = ImageLiterals.imgCalendar + case .Progressing: + reflectionTitleLabel.text = TextLiteral.reflectionTitleLabelProgressing + reflectionTitleLabel.textColor = .white100 + reflectionDescriptionLabel.text = TextLiteral.reflectionDescriptionLabelProgressing + reflectionDescriptionLabel.textColor = .white100 + calendarImageView.image = ImageLiterals.imgYellowCalendar + } + } } From 37ceba0b9d9dcd7b5abf1571ef4099ded807a3b8 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 17:50:15 +0900 Subject: [PATCH 009/388] =?UTF-8?q?[ADD]=20navbar=20&=20titleLabel=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Extension/UIFont+Extension.swift | 2 +- .../Global/Extension/UILabel+Extension.swift | 15 ++ .../Global/Supports/SceneDelegate.swift | 2 +- .../SetNicknameViewController.swift | 140 +++++++++--------- 4 files changed, 88 insertions(+), 71 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIFont+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIFont+Extension.swift index f94da073..44017b5a 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIFont+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIFont+Extension.swift @@ -20,7 +20,7 @@ extension UIFont { } static var title: UIFont { - return font(.bold, ofSize: 28) + return font(.bold, ofSize: 26) } static var title2: UIFont { diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UILabel+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UILabel+Extension.swift index 39be1626..ec00542e 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UILabel+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UILabel+Extension.swift @@ -47,6 +47,21 @@ extension UILabel { attributedText = attributeString } + func setLineSpacingWithColorApplied(amount amount: CGFloat, colorTo targetString: String, with color: UIColor) { + guard let text = text else { return } + let attributedString = NSMutableAttributedString(string: text) + attributedString.addAttribute(.foregroundColor, + value: color, + range: (text as NSString).range(of: targetString)) + + let style = NSMutableParagraphStyle() + style.lineSpacing = amount + attributedString.addAttribute(.paragraphStyle, + value: style, + range: NSRange(location: 0, length: attributedString.length)) + attributedText = attributedString + } + func setTitleFont(text: String) { self.text = text self.font = .title diff --git a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift index 2aa4fc54..141f3f14 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift @@ -23,7 +23,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if isLogined { rootViewController = CustomTabBarController() } else { - rootViewController = UINavigationController(rootViewController: LoginViewController()) + rootViewController = UINavigationController(rootViewController: SetNicknameViewController()) } window?.rootViewController = rootViewController window?.makeKeyAndVisible() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 1646d054..ab52012b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -8,93 +8,95 @@ import UIKit import Alamofire +import SnapKit -final class SetNicknameViewController: BaseTextFieldViewController { +final class SetNicknameViewController: BaseViewController { - override var titleText: String { - get { - return TextLiteral.setNicknameViewControllerTitleLabel - } - set { - super.titleText = newValue - } - } + var teamName = "맛쟁이사과처럼세글자" - override var placeholderText: String { - get { - return TextLiteral.setNicknameViewControllerNicknameTextFieldPlaceHolder - } - set { - super.placeholderText = newValue - } - } + // MARK: - property - override var maxLength: Int { - get { - return 6 - } - - set { - super.maxLength = newValue + private lazy var backButton: BackButton = { + let button = BackButton() + let action = UIAction { [weak self] _ in + self?.navigationController?.popViewController(animated: true) } - } + button.addAction(action, for: .touchUpInside) + return button + }() + private lazy var titleLabel: UILabel = { + let label = UILabel() + label.text = teamName + "에서\n사용할 프로필을 작성해 주세요" + label.font = .title + label.textColor = .black100 + label.numberOfLines = 0 + label.setLineSpacingWithColorApplied(amount: 4, colorTo: teamName, with: .blue200) + return label + }() - override var buttonText: String { - get { - return TextLiteral.doneButtonTitle - } - set { - super.buttonText = newValue - } - } + // MARK: - life cycle + + // override func viewDidLoad() { + // super.viewDidLoad() + // setupDoneButton() + // } - override func viewDidLoad() { - super.viewDidLoad() - setupDoneButton() + override func render() { + view.addSubview(titleLabel) + titleLabel.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide).inset(20) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } } override func setupNavigationBar() { super.setupNavigationBar() + + let button = removeBarButtonItemOffset(with: backButton, offsetX: 10) + let backButton = makeBarButtonItem(with: button) + navigationController?.navigationBar.prefersLargeTitles = false + navigationItem.largeTitleDisplayMode = .never + navigationItem.leftBarButtonItem = backButton } - override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { - return false - } + // override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { + // return false + // } // MARK: - func - override func textFieldShouldReturn(_ textField: UITextField) -> Bool { - textField.resignFirstResponder() - return true - } + // override func textFieldShouldReturn(_ textField: UITextField) -> Bool { + // textField.resignFirstResponder() + // return true + // } - private func setupDoneButton() { - let action = UIAction { [weak self] _ in - guard let nickname = self?.kigoTextField.text else { return } - self?.dispatchUserLogin(type: .dispatchLogin(LoginDTO(username: nickname))) - self?.kigoTextField.resignFirstResponder() - } - super.doneButton.addAction(action, for: .touchUpInside) - } + // private func setupDoneButton() { + // let action = UIAction { [weak self] _ in + // guard let nickname = self?.kigoTextField.text else { return } + // self?.dispatchUserLogin(type: .dispatchLogin(LoginDTO(username: nickname))) + // self?.kigoTextField.resignFirstResponder() + // } + // super.doneButton.addAction(action, for: .touchUpInside) + // } // MARK: - api - private func dispatchUserLogin(type: SetupEndPoint) { - AF.request(type.address, - method: type.method, - parameters: type.body, - encoder: JSONParameterEncoder.default, - headers: type.headers - ).responseDecodable(of: BaseModel.self) { [weak self] response in - guard let self else { return } - switch response.result { - case .success: - guard let nickname = self.kigoTextField.text else { return } - UserDefaultHandler.setNickname(nickname: nickname) - self.navigationController?.pushViewController(JoinTeamViewController(), animated: true) - case .failure: - self.makeAlert(title: TextLiteral.setNicknameViewControllerAlertTitle, message: TextLiteral.setNicknameControllerAlertMessage) - } - } - } + // private func dispatchUserLogin(type: SetupEndPoint) { + // AF.request(type.address, + // method: type.method, + // parameters: type.body, + // encoder: JSONParameterEncoder.default, + // headers: type.headers + // ).responseDecodable(of: BaseModel.self) { [weak self] response in + // guard let self else { return } + // switch response.result { + // case .success: + // guard let nickname = self.kigoTextField.text else { return } + // UserDefaultHandler.setNickname(nickname: nickname) + // self.navigationController?.pushViewController(JoinTeamViewController(), animated: true) + // case .failure: + // self.makeAlert(title: TextLiteral.setNicknameViewControllerAlertTitle, message: TextLiteral.setNicknameControllerAlertMessage) + // } + // } + // } } From 3aa300dfac0ae716db9409febf96f787eff77162 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 17:59:07 +0900 Subject: [PATCH 010/388] =?UTF-8?q?[ADD]=20profile=20none=20image=20button?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/ImageLiteral.swift | 1 + .../profileNone.imageset/Contents.json | 15 ++++++++++ .../profileNone.imageset/profileNone.pdf | Bin 0 -> 3987 bytes .../SetNicknameViewController.swift | 26 ++++++++++++++---- 4 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/profileNone.imageset/Contents.json create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/profileNone.imageset/profileNone.pdf diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift index 1e49df06..5f44c737 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift @@ -40,6 +40,7 @@ enum ImageLiterals { static var imgProgress3: UIImage { .load(name: "ProgressBar3") } static var imgProgress4: UIImage { .load(name: "ProgressBar4") } static var imgProgress5: UIImage { .load(name: "ProgressBar5") } + static var imgProfileNone: UIImage { .load(name: "profileNone") } } extension UIImage { diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/profileNone.imageset/Contents.json b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/profileNone.imageset/Contents.json new file mode 100644 index 00000000..d6cdb237 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/profileNone.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "profileNone.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/profileNone.imageset/profileNone.pdf b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/profileNone.imageset/profileNone.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2d054024a290063454004817009fcf94517af6c9 GIT binary patch literal 3987 zcmeHKO>f*b5WVwP@M0i2gv;+Cfxtj)Cq~f*aqS)g1U; zec4}0i;brfbi8Tr?`8tS@A2IrGYXzT-)6b)?v|Toz52HEet&;bb#{N=4@Td$o7)LH zZMyb;vuZjvQFb02v=8!=)JhLeUBtA7>gs2xf@Ifkn&qun95ugQubR{219^Bh|F!DG zS7El|MfIz)D({j?l(LSa*-Ru?w?eDn_yPEM(XG}ZD5E3UEGK66OZngPn>Jz2RDKC7fD12igHZvx4nm5n-4lvV{3ot;BY z#h`Oy(Yh}vuZbW4ZIMzmSrT*vt1Vj%#v4sCD{Gy_DPfhA^Vwx9jZr2U2an)eq?jE^ zFE;=DKy z6ztfBw>XhSR_iHY8i61;bB6Pot$*aT3Lztcv+!7zQcNCDi6ZLKS) zUKWjDaxyui4ytW%K5B2hX6bTDREJB+$0)(y$s4Zwj6=e9@f($u3~{-Gt0h7x!UW4m zNsT0G)dkO$Ut?Y|NDozLJW9CkgdOjV8JbCQ&bxv0C~Jp`fNjd!4Ss{)=u;8z$L?ei zArnw<)>7hHNAxpJi8@JvP*7a!!GYo#Cr1ZB_+3Cp0inIMsBmBi6}Kgq(F-zIKF44$ z$A~Nq(%YTLjs7iaG5I~`8v4T& zAw+dzWsT&Fz0dHR`Ttq0#g9TX>x=37!HTa~!B^;b*BUfd-Y~!@vcGo)`~UV8TzXkq z3|Da0CP$1hxEXgBdYbuxSV&>x@m%f1=jzcs_3v-ivHmti#ymHcyO1gw+d?rL!?xgw@nbNAhoUkePG zZ*K0cmVd2!J4im!!N4^67Ek_2-TwaQHk5747bD@Ue5Yv{3>YKy?@geEJ!LV{KWf7D z0s7YkCdnxOr~kIxYE%9y7NF;4Cl+AwQTu$G=G=`1;dL%)P6g$Hc(Y!&eJ4NhcSfbp z$?~$9fcMSC_41#7v9PB4@xvv!{o*=o*L|~wMP}O;JmC+kUZN8X(2SD|jV|zEzrVh~ zQ6+nDDz_&-Z0{j!o}9k}GSkFk;Y<~K*cFS_^TTDoylF3YWgj-pXMr2uh_UbS|1t)Q z2om`8umOJLdV&n5vL_IKW9{s+0pC84A&iQTpoF<>7s7Oi1oKlYV%$N%cA*fS2u92s z+g<%;d41Dt1c&##BLw$F*WNZS<%{c!mt%+*r)`V)a`=XPEzYigYd97NZr3k2{SX}& MQxto9Z$G^I9h|8@;Q#;t literal 0 HcmV?d00001 diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index ab52012b..c00caea4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -33,20 +33,31 @@ final class SetNicknameViewController: BaseViewController { label.setLineSpacingWithColorApplied(amount: 4, colorTo: teamName, with: .blue200) return label }() + private lazy var profileImageButton: UIButton = { + let button = UIButton() + button.setBackgroundImage(ImageLiterals.imgProfileNone, for: .normal) + let action = UIAction { [weak self] _ in + self?.didTappedProfile() + } + button.addAction(action, for: .touchUpInside) + return button + }() // MARK: - life cycle - // override func viewDidLoad() { - // super.viewDidLoad() - // setupDoneButton() - // } - override func render() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(20) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + + view.addSubview(profileImageButton) + profileImageButton.snp.makeConstraints { + $0.top.equalTo(titleLabel.snp.bottom).offset(44) + $0.centerX.equalToSuperview() + $0.width.height.equalTo(68) + } } override func setupNavigationBar() { @@ -65,6 +76,11 @@ final class SetNicknameViewController: BaseViewController { // MARK: - func + private func didTappedProfile() { + // FIXME: - 갤러리로 이동 + print("프로필 누름") + } + // override func textFieldShouldReturn(_ textField: UITextField) -> Bool { // textField.resignFirstResponder() // return true From 8ab6402bdb655cc158cbbd87728ea9ec19b73286 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 18:15:30 +0900 Subject: [PATCH 011/388] =?UTF-8?q?[ADD]=20ProfileImageButton=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EB=B0=8F=20=EB=B0=B0=EC=B9=98(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 ++++++ .../Global/Extension/UILabel+Extension.swift | 2 +- .../Global/Literal/ImageLiteral.swift | 1 + .../SetNicknameViewController.swift | 5 +-- .../UIComponent/ProfileImageButton.swift | 40 +++++++++++++++++++ 5 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 9fd63e41..e0d46d44 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -115,6 +115,7 @@ 525E722528FFCFA600EF3FCB /* FeedbackTypeButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525E722428FFCFA600EF3FCB /* FeedbackTypeButtonView.swift */; }; 52988B742921EAD50044A77F /* MyReflectionFeedbackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52988B732921EAD50044A77F /* MyReflectionFeedbackViewController.swift */; }; 52AED2DD29128532004D70B9 /* FeedbackFromMeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AED2DC29128532004D70B9 /* FeedbackFromMeModel.swift */; }; + 52CD58BC297BE24B008567E0 /* ProfileImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */; }; 52DC9091291A98CC00904739 /* MyFeedbackEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52DC9090291A98CC00904739 /* MyFeedbackEditViewController.swift */; }; 52F07B9A2912541B0015BC8B /* MyFeedbackDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F07B992912541B0015BC8B /* MyFeedbackDetailViewController.swift */; }; 52F0CB5229178C2700E39C50 /* AlertViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F0CB5129178C2700E39C50 /* AlertViewController.swift */; }; @@ -252,6 +253,7 @@ 525E722428FFCFA600EF3FCB /* FeedbackTypeButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackTypeButtonView.swift; sourceTree = ""; }; 52988B732921EAD50044A77F /* MyReflectionFeedbackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionFeedbackViewController.swift; sourceTree = ""; }; 52AED2DC29128532004D70B9 /* FeedbackFromMeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackFromMeModel.swift; sourceTree = ""; }; + 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileImageButton.swift; sourceTree = ""; }; 52DC9090291A98CC00904739 /* MyFeedbackEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackEditViewController.swift; sourceTree = ""; }; 52F07B992912541B0015BC8B /* MyFeedbackDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackDetailViewController.swift; sourceTree = ""; }; 52F0CB5129178C2700E39C50 /* AlertViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertViewController.swift; sourceTree = ""; }; @@ -850,6 +852,7 @@ 52B21E5229248DC30048964C /* SetNickname */ = { isa = PBXGroup; children = ( + 52CD58BA297BE231008567E0 /* UIComponent */, 7E2ECA0F2901136700A4D65C /* SetNicknameViewController.swift */, ); path = SetNickname; @@ -879,6 +882,14 @@ path = InvitationCode; sourceTree = ""; }; + 52CD58BA297BE231008567E0 /* UIComponent */ = { + isa = PBXGroup; + children = ( + 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */, + ); + path = UIComponent; + sourceTree = ""; + }; 52DC908F291A98B800904739 /* MyFeedbackEdit */ = { isa = PBXGroup; children = ( @@ -1062,6 +1073,7 @@ 3E557FFA2901CD4200714E46 /* KeywordCollectionViewCell.swift in Sources */, 52F0CB5229178C2700E39C50 /* AlertViewController.swift in Sources */, 395C7E0528F953D200FC2FCA /* UIViewController+Extension.swift in Sources */, + 52CD58BC297BE24B008567E0 /* ProfileImageButton.swift in Sources */, 3EB5085C2912427600FB77CB /* MyReflectionViewController.swift in Sources */, 39257DEB28F9373900201E0B /* BaseViewController.swift in Sources */, 39436C1029127BBA0083D77A /* MyFeedbackCollectionView.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UILabel+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UILabel+Extension.swift index ec00542e..17ad8733 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UILabel+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UILabel+Extension.swift @@ -47,7 +47,7 @@ extension UILabel { attributedText = attributeString } - func setLineSpacingWithColorApplied(amount amount: CGFloat, colorTo targetString: String, with color: UIColor) { + func setLineSpacingWithColorApplied(amount: CGFloat, colorTo targetString: String, with color: UIColor) { guard let text = text else { return } let attributedString = NSMutableAttributedString(string: text) attributedString.addAttribute(.foregroundColor, diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift index 5f44c737..e50c175c 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift @@ -24,6 +24,7 @@ enum ImageLiterals { static var icPersonCircle: UIImage { .load(systemName: "person.crop.circle") } static var icChevronDown: UIImage { .load(systemName: "chevron.down") } static var icTeamMananage: UIImage { .load(systemName: "person.2.circle") } + static var icPlus: UIImage { .load(systemName: "plus.circle.fill") } // MARK: - image diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index c00caea4..8178ff4b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -33,9 +33,8 @@ final class SetNicknameViewController: BaseViewController { label.setLineSpacingWithColorApplied(amount: 4, colorTo: teamName, with: .blue200) return label }() - private lazy var profileImageButton: UIButton = { - let button = UIButton() - button.setBackgroundImage(ImageLiterals.imgProfileNone, for: .normal) + private lazy var profileImageButton: ProfileImageButton = { + let button = ProfileImageButton() let action = UIAction { [weak self] _ in self?.didTappedProfile() } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift new file mode 100644 index 00000000..8d0b50d5 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift @@ -0,0 +1,40 @@ +// +// ProfileImageButton.swift +// Maddori.Apple +// +// Created by 김유나 on 2023/01/21. +// + +import UIKit + +import SnapKit + +final class ProfileImageButton: UIButton { + + // MARK: - property + + var profileImage = UIImageView(image: ImageLiterals.imgProfileNone) + let profilePlus = UIImageView(image: ImageLiterals.icPlus) + + // MARK: - life cycle + + override init(frame: CGRect) { + super.init(frame: frame) + render() + } + + required init?(coder: NSCoder) { nil } + + private func render() { + self.addSubview(profileImage) + profileImage.snp.makeConstraints { + $0.edges.equalToSuperview() + } + + self.addSubview(profilePlus) + profilePlus.snp.makeConstraints { + $0.top.trailing.equalTo(profileImage) + $0.width.height.equalTo(22) + } + } +} From af09aca12fe54d27f593f1c9b1ab90f849713457 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 18:17:41 +0900 Subject: [PATCH 012/388] =?UTF-8?q?[ADD]=20plus=20button=20=EC=97=90=20?= =?UTF-8?q?=EC=83=89=20=EC=A0=81=EC=9A=A9(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNickname/UIComponent/ProfileImageButton.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift index 8d0b50d5..a05c1877 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift @@ -14,7 +14,12 @@ final class ProfileImageButton: UIButton { // MARK: - property var profileImage = UIImageView(image: ImageLiterals.imgProfileNone) - let profilePlus = UIImageView(image: ImageLiterals.icPlus) + private let profilePlus: UIImageView = { + let imageView = UIImageView() + imageView.image = ImageLiterals.icPlus + imageView.tintColor = .blue200 + return imageView + }() // MARK: - life cycle @@ -34,7 +39,8 @@ final class ProfileImageButton: UIButton { self.addSubview(profilePlus) profilePlus.snp.makeConstraints { $0.top.trailing.equalTo(profileImage) - $0.width.height.equalTo(22) + $0.width.equalTo(20) + $0.height.equalTo(22) } } } From 65dc58ed9d67ecd37618d05f97ea1cee68dfa50b Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 19:28:34 +0900 Subject: [PATCH 013/388] =?UTF-8?q?[ADD]=20nickname=20textfield,=20label,?= =?UTF-8?q?=20textlimit=20label=20=EC=83=9D=EC=84=B1(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 8178ff4b..dd7304fb 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -13,6 +13,9 @@ import SnapKit final class SetNicknameViewController: BaseViewController { var teamName = "맛쟁이사과처럼세글자" + private let minLength: Int = 0 + var nicknameMaxLength: Int = 15 + var roleMaxLength: Int = 20 // MARK: - property @@ -41,6 +44,26 @@ final class SetNicknameViewController: BaseViewController { button.addAction(action, for: .touchUpInside) return button }() + private let nicknameLabel: UILabel = { + let label = UILabel() + label.text = "닉네임 *" + label.textColor = .black100 + label.font = .label2 + label.applyColor(to: "*", with: .red100) + return label + }() + private let nicknameTextField: CustomTextField = { + let textField = CustomTextField() + textField.placeHolderText = "ex) 진저" + return textField + }() + private lazy var nicknameTextLimitLabel: UILabel = { + let label = UILabel() + label.setTextWithLineHeight(text: "\(minLength)/\(nicknameMaxLength)", lineHeight: 22) + label.font = .body2 + label.textColor = .gray500 + return label + }() // MARK: - life cycle @@ -57,6 +80,24 @@ final class SetNicknameViewController: BaseViewController { $0.centerX.equalToSuperview() $0.width.height.equalTo(68) } + + view.addSubview(nicknameLabel) + nicknameLabel.snp.makeConstraints { + $0.top.equalTo(profileImageButton.snp.bottom).offset(40) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + + view.addSubview(nicknameTextField) + nicknameTextField.snp.makeConstraints { + $0.top.equalTo(nicknameLabel.snp.bottom).offset(10) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + + view.addSubview(nicknameTextLimitLabel) + nicknameTextLimitLabel.snp.makeConstraints { + $0.top.equalTo(nicknameTextField.snp.bottom).offset(8) + $0.trailing.equalToSuperview().inset(27) + } } override func setupNavigationBar() { From 8da36018d886a3494c651cd390b0ccc6e392e62d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 19:42:03 +0900 Subject: [PATCH 014/388] =?UTF-8?q?[ADD]=20role=20label,=20textfield,=20li?= =?UTF-8?q?mit=20text=20label=20=EC=B6=94=EA=B0=80(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 45 +++++++++++++++++-- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index dd7304fb..17c89ab8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -64,13 +64,32 @@ final class SetNicknameViewController: BaseViewController { label.textColor = .gray500 return label }() + private let roleLabel: UILabel = { + let label = UILabel() + label.text = "역할" + label.textColor = .black100 + label.font = .label2 + return label + }() + private let roleTextField: CustomTextField = { + let textField = CustomTextField() + textField.placeHolderText = "ex) iOS 개발자" + return textField + }() + private lazy var roleTextLimitLabel: UILabel = { + let label = UILabel() + label.setTextWithLineHeight(text: "\(minLength)/\(roleMaxLength)", lineHeight: 22) + label.font = .body2 + label.textColor = .gray500 + return label + }() // MARK: - life cycle override func render() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { - $0.top.equalTo(view.safeAreaLayoutGuide).inset(20) + $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } @@ -89,13 +108,31 @@ final class SetNicknameViewController: BaseViewController { view.addSubview(nicknameTextField) nicknameTextField.snp.makeConstraints { - $0.top.equalTo(nicknameLabel.snp.bottom).offset(10) - $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.top.equalTo(nicknameLabel.snp.bottom).offset(SizeLiteral.labelComponentPadding) + $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } view.addSubview(nicknameTextLimitLabel) nicknameTextLimitLabel.snp.makeConstraints { - $0.top.equalTo(nicknameTextField.snp.bottom).offset(8) + $0.top.equalTo(nicknameTextField.snp.bottom).offset(4) + $0.trailing.equalToSuperview().inset(27) + } + + view.addSubview(roleLabel) + roleLabel.snp.makeConstraints { + $0.top.equalTo(nicknameTextField.snp.bottom).offset(SizeLiteral.componentIntervalPadding) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + + view.addSubview(roleTextField) + roleTextField.snp.makeConstraints { + $0.top.equalTo(roleLabel.snp.bottom).offset(SizeLiteral.labelComponentPadding) + $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + + view.addSubview(roleTextLimitLabel) + roleTextLimitLabel.snp.makeConstraints { + $0.top.equalTo(roleTextField.snp.bottom).offset(4) $0.trailing.equalToSuperview().inset(27) } } From 6188a2d53b921f5468487224a748bc1f2a4a3e35 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 19:47:02 +0900 Subject: [PATCH 015/388] =?UTF-8?q?[ADD]=20=EC=9E=85=EB=A0=A5=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNickname/SetNicknameViewController.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 17c89ab8..0c239675 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -83,6 +83,12 @@ final class SetNicknameViewController: BaseViewController { label.textColor = .gray500 return label }() + private lazy var doneButton: MainButton = { + let button = MainButton() + button.title = "입력 완료" + button.isDisabled = true + return button + }() // MARK: - life cycle @@ -135,6 +141,12 @@ final class SetNicknameViewController: BaseViewController { $0.top.equalTo(roleTextField.snp.bottom).offset(4) $0.trailing.equalToSuperview().inset(27) } + + view.addSubview(doneButton) + doneButton.snp.makeConstraints { + $0.bottom.equalTo(view.safeAreaLayoutGuide).inset(2) + $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } } override func setupNavigationBar() { From bdeafcd2e634c13f336acf885ec1d260c2021675 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 20:43:29 +0900 Subject: [PATCH 016/388] =?UTF-8?q?[ADD]=20textfield=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 119 +++++++++++++++--- 1 file changed, 100 insertions(+), 19 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 0c239675..a616f466 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -14,8 +14,11 @@ final class SetNicknameViewController: BaseViewController { var teamName = "맛쟁이사과처럼세글자" private let minLength: Int = 0 - var nicknameMaxLength: Int = 15 - var roleMaxLength: Int = 20 + + enum maxTextLength: Int { + case nickname = 15 + case role = 20 + } // MARK: - property @@ -59,7 +62,7 @@ final class SetNicknameViewController: BaseViewController { }() private lazy var nicknameTextLimitLabel: UILabel = { let label = UILabel() - label.setTextWithLineHeight(text: "\(minLength)/\(nicknameMaxLength)", lineHeight: 22) + label.setTextWithLineHeight(text: "\(minLength)/\(maxTextLength.nickname.rawValue)", lineHeight: 22) label.font = .body2 label.textColor = .gray500 return label @@ -78,7 +81,7 @@ final class SetNicknameViewController: BaseViewController { }() private lazy var roleTextLimitLabel: UILabel = { let label = UILabel() - label.setTextWithLineHeight(text: "\(minLength)/\(roleMaxLength)", lineHeight: 22) + label.setTextWithLineHeight(text: "\(minLength)/\(maxTextLength.role.rawValue)", lineHeight: 22) label.font = .body2 label.textColor = .gray500 return label @@ -87,11 +90,27 @@ final class SetNicknameViewController: BaseViewController { let button = MainButton() button.title = "입력 완료" button.isDisabled = true + let action = UIAction { [weak self] _ in + // guard let nickname = self?.kigoTextField.text else { return } + // self?.dispatchUserLogin(type: .dispatchLogin(LoginDTO(username: nickname))) + // self?.kigoTextField.resignFirstResponder() + } + button.addAction(action, for: .touchUpInside) return button }() // MARK: - life cycle + override func viewDidLoad() { + super.viewDidLoad() + setupDelegate() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + setupNotificationCenter() + } + override func render() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { @@ -159,9 +178,9 @@ final class SetNicknameViewController: BaseViewController { navigationItem.leftBarButtonItem = backButton } - // override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { - // return false - // } + override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { + return true + } // MARK: - func @@ -170,19 +189,63 @@ final class SetNicknameViewController: BaseViewController { print("프로필 누름") } - // override func textFieldShouldReturn(_ textField: UITextField) -> Bool { - // textField.resignFirstResponder() - // return true - // } + private func setupDelegate() { + nicknameTextField.delegate = self + roleTextField.delegate = self + } - // private func setupDoneButton() { - // let action = UIAction { [weak self] _ in - // guard let nickname = self?.kigoTextField.text else { return } - // self?.dispatchUserLogin(type: .dispatchLogin(LoginDTO(username: nickname))) - // self?.kigoTextField.resignFirstResponder() - // } - // super.doneButton.addAction(action, for: .touchUpInside) - // } + private func setupNotificationCenter() { + NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: UIResponder.keyboardWillShowNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil) + } + + override func endEditingView() { + if !doneButton.isTouchInside { + view.endEditing(true) + } + } + + private func setCounter(textField: UITextField, count: Int) { + let maxLength = textField == nicknameTextField ? maxTextLength.nickname.rawValue : maxTextLength.role.rawValue + let textLimitLabel = textField == nicknameTextField ? nicknameTextLimitLabel : roleTextLimitLabel + if count <= maxLength { + textLimitLabel.text = "\(count)/\(maxLength)" + } + else { + textLimitLabel.text = "\(maxLength)/\(maxLength)" + } + } + + private func checkMaxLength(textField: UITextField) { + let maxLength = textField == nicknameTextField ? maxTextLength.nickname.rawValue : maxTextLength.role.rawValue + if let text = textField.text { + if text.count > maxLength { + let endIndex = text.index(text.startIndex, offsetBy: maxLength) + let fixedText = text[text.startIndex.. Bool { + textField.resignFirstResponder() + return true + } +} From 37a47fbd500e73128b7c19cab83290152ca41d48 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 22:13:11 +0900 Subject: [PATCH 017/388] =?UTF-8?q?[ADD]=20=ED=82=A4=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=EC=98=AC=EB=9D=BC=EC=98=B4=EC=97=90=20=EB=94=B0=EB=9D=BC=20?= =?UTF-8?q?=ED=95=84=EC=9A=94=ED=95=9C=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index a616f466..1efaa39c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -30,6 +30,13 @@ final class SetNicknameViewController: BaseViewController { button.addAction(action, for: .touchUpInside) return button }() + private let navigationTitleLabel: UILabel = { + let label = UILabel() + label.text = "프로필 생성" + label.textColor = .black100 + label.font = .label2 + return label + }() private lazy var titleLabel: UILabel = { let label = UILabel() label.text = teamName + "에서\n사용할 프로필을 작성해 주세요" @@ -116,6 +123,7 @@ final class SetNicknameViewController: BaseViewController { titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.height.equalTo(66.5) } view.addSubview(profileImageButton) @@ -176,6 +184,10 @@ final class SetNicknameViewController: BaseViewController { navigationController?.navigationBar.prefersLargeTitles = false navigationItem.largeTitleDisplayMode = .never navigationItem.leftBarButtonItem = backButton + + + navigationItem.titleView = navigationTitleLabel + navigationItem.titleView?.isHidden = true } override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { @@ -239,12 +251,37 @@ final class SetNicknameViewController: BaseViewController { self.doneButton.transform = CGAffineTransform(translationX: 0, y: -keyboardSize.height + 24) }) } + + titleLabel.snp.updateConstraints { + $0.height.equalTo(0) + } + profileImageButton.snp.updateConstraints { + $0.top.equalTo(self.titleLabel.snp.bottom).offset(-4) + } + navigationItem.titleView?.isHidden = false + + UIView.animate(withDuration: 0.3, delay: 0, options: .allowAnimatedContent, animations: { + self.view.layoutIfNeeded() + }, completion: nil) + } @objc private func keyboardWillHide(notification:NSNotification) { UIView.animate(withDuration: 0.2, animations: { self.doneButton.transform = .identity }) + + titleLabel.snp.updateConstraints { + $0.height.equalTo(66.5) + } + profileImageButton.snp.updateConstraints { + $0.top.equalTo(titleLabel.snp.bottom).offset(44) + } + navigationItem.titleView?.isHidden = true + + UIView.animate(withDuration: 0.3, delay: 0, options: .allowAnimatedContent, animations: { + self.view.layoutIfNeeded() + }, completion: nil) } // MARK: - api From a32eb9f9f2f758e1f67752f93a793fe31b4d7c67 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 23:02:03 +0900 Subject: [PATCH 018/388] =?UTF-8?q?[ADD]=20=EC=BD=94=EB=93=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/TextLiteral.swift | 7 ++ .../Global/Supports/SceneDelegate.swift | 2 +- .../SetNicknameViewController.swift | 115 ++++++++++-------- 3 files changed, 69 insertions(+), 55 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index f0f2bb83..4dc039f9 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -44,6 +44,13 @@ enum TextLiteral { static let setNicknameViewControllerNicknameTextFieldPlaceHolder = "예) 진저, 호야, 성민" static let setNicknameViewControllerAlertTitle = "특수문자를 사용할 수 없습니다." static let setNicknameControllerAlertMessage = "닉네임을 다시 입력해주세요." + static let setNicknameControllerNavigationTitleLabel = "프로필 생성" + static let setNicknameControllerTitleLabel = "에서\n사용할 프로필을 작성해 주세요" + static let setNicknameControllerNicknameLabel = "닉네임 *" + static let setNicknameControllerNicknameTextFieldPlaceHolderText = "ex) 진저" + static let setNicknameControllerRoleLabel = "역할" + static let setNicknameControllerRoleTextFieldPlaceHolderText = "ex) iOS 개발자" + static let setNicknameControllerDoneButtonText = "입력 완료" // MARK: - HomeViewController diff --git a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift index 141f3f14..2aa4fc54 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift @@ -23,7 +23,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if isLogined { rootViewController = CustomTabBarController() } else { - rootViewController = UINavigationController(rootViewController: SetNicknameViewController()) + rootViewController = UINavigationController(rootViewController: LoginViewController()) } window?.rootViewController = rootViewController window?.makeKeyAndVisible() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 1efaa39c..aa57977f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -12,13 +12,11 @@ import SnapKit final class SetNicknameViewController: BaseViewController { + // FIXME: - 합류한 팀 이름 받아오기 var teamName = "맛쟁이사과처럼세글자" private let minLength: Int = 0 - - enum maxTextLength: Int { - case nickname = 15 - case role = 20 - } + private let nicknameMaxLength: Int = 15 + private let roleMaxLength: Int = 20 // MARK: - property @@ -32,14 +30,14 @@ final class SetNicknameViewController: BaseViewController { }() private let navigationTitleLabel: UILabel = { let label = UILabel() - label.text = "프로필 생성" + label.text = TextLiteral.setNicknameControllerNavigationTitleLabel label.textColor = .black100 label.font = .label2 return label }() private lazy var titleLabel: UILabel = { let label = UILabel() - label.text = teamName + "에서\n사용할 프로필을 작성해 주세요" + label.text = teamName + TextLiteral.setNicknameControllerTitleLabel label.font = .title label.textColor = .black100 label.numberOfLines = 0 @@ -56,7 +54,7 @@ final class SetNicknameViewController: BaseViewController { }() private let nicknameLabel: UILabel = { let label = UILabel() - label.text = "닉네임 *" + label.text = TextLiteral.setNicknameControllerNicknameLabel label.textColor = .black100 label.font = .label2 label.applyColor(to: "*", with: .red100) @@ -64,43 +62,46 @@ final class SetNicknameViewController: BaseViewController { }() private let nicknameTextField: CustomTextField = { let textField = CustomTextField() - textField.placeHolderText = "ex) 진저" + textField.placeHolderText = TextLiteral.setNicknameControllerNicknameTextFieldPlaceHolderText return textField }() private lazy var nicknameTextLimitLabel: UILabel = { let label = UILabel() - label.setTextWithLineHeight(text: "\(minLength)/\(maxTextLength.nickname.rawValue)", lineHeight: 22) + label.setTextWithLineHeight(text: "\(minLength)/\(nicknameMaxLength)", lineHeight: 22) label.font = .body2 label.textColor = .gray500 return label }() private let roleLabel: UILabel = { let label = UILabel() - label.text = "역할" + label.text = TextLiteral.setNicknameControllerRoleLabel label.textColor = .black100 label.font = .label2 return label }() private let roleTextField: CustomTextField = { let textField = CustomTextField() - textField.placeHolderText = "ex) iOS 개발자" + textField.placeHolderText = TextLiteral.setNicknameControllerRoleTextFieldPlaceHolderText return textField }() private lazy var roleTextLimitLabel: UILabel = { let label = UILabel() - label.setTextWithLineHeight(text: "\(minLength)/\(maxTextLength.role.rawValue)", lineHeight: 22) + label.setTextWithLineHeight(text: "\(minLength)/\(roleMaxLength)", lineHeight: 22) label.font = .body2 label.textColor = .gray500 return label }() private lazy var doneButton: MainButton = { let button = MainButton() - button.title = "입력 완료" + button.title = TextLiteral.setNicknameControllerDoneButtonText button.isDisabled = true let action = UIAction { [weak self] _ in - // guard let nickname = self?.kigoTextField.text else { return } - // self?.dispatchUserLogin(type: .dispatchLogin(LoginDTO(username: nickname))) - // self?.kigoTextField.resignFirstResponder() + guard let nickname = self?.nicknameTextField.text else { return } + guard let role = self?.roleTextField.text else { return } + // FIXME: - 수정된 api 연결 + // self?.dispatchUserLogin(type: .dispatchLogin(LoginDTO(username: nickname))) + self?.nicknameTextField.resignFirstResponder() + self?.roleTextField.resignFirstResponder() } button.addAction(action, for: .touchUpInside) return button @@ -185,7 +186,6 @@ final class SetNicknameViewController: BaseViewController { navigationItem.largeTitleDisplayMode = .never navigationItem.leftBarButtonItem = backButton - navigationItem.titleView = navigationTitleLabel navigationItem.titleView?.isHidden = true } @@ -218,7 +218,7 @@ final class SetNicknameViewController: BaseViewController { } private func setCounter(textField: UITextField, count: Int) { - let maxLength = textField == nicknameTextField ? maxTextLength.nickname.rawValue : maxTextLength.role.rawValue + let maxLength = textField == nicknameTextField ? nicknameMaxLength : roleMaxLength let textLimitLabel = textField == nicknameTextField ? nicknameTextLimitLabel : roleTextLimitLabel if count <= maxLength { textLimitLabel.text = "\(count)/\(maxLength)" @@ -229,7 +229,7 @@ final class SetNicknameViewController: BaseViewController { } private func checkMaxLength(textField: UITextField) { - let maxLength = textField == nicknameTextField ? maxTextLength.nickname.rawValue : maxTextLength.role.rawValue + let maxLength = textField == nicknameTextField ? nicknameMaxLength : roleMaxLength if let text = textField.text { if text.count > maxLength { let endIndex = text.index(text.startIndex, offsetBy: maxLength) @@ -243,15 +243,7 @@ final class SetNicknameViewController: BaseViewController { } } - // MARK: - selector - - @objc private func keyboardWillShow(notification:NSNotification) { - if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue { - UIView.animate(withDuration: 0.2, animations: { - self.doneButton.transform = CGAffineTransform(translationX: 0, y: -keyboardSize.height + 24) - }) - } - + private func didTappedTextField() { titleLabel.snp.updateConstraints { $0.height.equalTo(0) } @@ -263,14 +255,9 @@ final class SetNicknameViewController: BaseViewController { UIView.animate(withDuration: 0.3, delay: 0, options: .allowAnimatedContent, animations: { self.view.layoutIfNeeded() }, completion: nil) - } - @objc private func keyboardWillHide(notification:NSNotification) { - UIView.animate(withDuration: 0.2, animations: { - self.doneButton.transform = .identity - }) - + private func didTappedBackground() { titleLabel.snp.updateConstraints { $0.height.equalTo(66.5) } @@ -284,26 +271,47 @@ final class SetNicknameViewController: BaseViewController { }, completion: nil) } + // MARK: - selector + + @objc private func keyboardWillShow(notification:NSNotification) { + if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue { + UIView.animate(withDuration: 0.2, animations: { + self.doneButton.transform = CGAffineTransform(translationX: 0, y: -keyboardSize.height + 24) + }) + } + + didTappedTextField() + } + + @objc private func keyboardWillHide(notification:NSNotification) { + UIView.animate(withDuration: 0.2, animations: { + self.doneButton.transform = .identity + }) + + didTappedBackground() + } + // MARK: - api - // private func dispatchUserLogin(type: SetupEndPoint) { - // AF.request(type.address, - // method: type.method, - // parameters: type.body, - // encoder: JSONParameterEncoder.default, - // headers: type.headers - // ).responseDecodable(of: BaseModel.self) { [weak self] response in - // guard let self else { return } - // switch response.result { - // case .success: - // guard let nickname = self.kigoTextField.text else { return } - // UserDefaultHandler.setNickname(nickname: nickname) - // self.navigationController?.pushViewController(JoinTeamViewController(), animated: true) - // case .failure: - // self.makeAlert(title: TextLiteral.setNicknameViewControllerAlertTitle, message: TextLiteral.setNicknameControllerAlertMessage) - // } - // } - // } + // FIXME: - 수정 필요 + private func dispatchUserLogin(type: SetupEndPoint) { +// AF.request(type.address, +// method: type.method, +// parameters: type.body, +// encoder: JSONParameterEncoder.default, +// headers: type.headers +// ).responseDecodable(of: BaseModel.self) { [weak self] response in +// guard let self else { return } +// switch response.result { +// case .success: +// guard let nickname = self.kigoTextField.text else { return } +// UserDefaultHandler.setNickname(nickname: nickname) +// self.navigationController?.pushViewController(JoinTeamViewController(), animated: true) +// case .failure: +// self.makeAlert(title: TextLiteral.setNicknameViewControllerAlertTitle, message: TextLiteral.setNicknameControllerAlertMessage) +// } +// } + } } // MARK: - Extension @@ -315,7 +323,6 @@ extension SetNicknameViewController: UITextFieldDelegate { let hasText = textField.hasText doneButton.isDisabled = !hasText - } func textFieldShouldReturn(_ textField: UITextField) -> Bool { From 5b364aab92ae0faa1c92c763500a0e299dbb1f7d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 23:07:26 +0900 Subject: [PATCH 019/388] =?UTF-8?q?[CHORE]=20=EB=8B=89=EB=84=A4=EC=9E=84?= =?UTF-8?q?=20=EC=B5=9C=EB=8C=80=20=EA=B8=80=EC=9E=90=20=EC=88=98=EC=A0=95?= =?UTF-8?q?(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index aa57977f..1fb79c5f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -15,7 +15,7 @@ final class SetNicknameViewController: BaseViewController { // FIXME: - 합류한 팀 이름 받아오기 var teamName = "맛쟁이사과처럼세글자" private let minLength: Int = 0 - private let nicknameMaxLength: Int = 15 + private let nicknameMaxLength: Int = 6 private let roleMaxLength: Int = 20 // MARK: - property @@ -98,8 +98,7 @@ final class SetNicknameViewController: BaseViewController { let action = UIAction { [weak self] _ in guard let nickname = self?.nicknameTextField.text else { return } guard let role = self?.roleTextField.text else { return } - // FIXME: - 수정된 api 연결 - // self?.dispatchUserLogin(type: .dispatchLogin(LoginDTO(username: nickname))) + // FIXME: - 수정된 api 연결 (userJoinTeam) self?.nicknameTextField.resignFirstResponder() self?.roleTextField.resignFirstResponder() } @@ -290,29 +289,6 @@ final class SetNicknameViewController: BaseViewController { didTappedBackground() } - - // MARK: - api - - // FIXME: - 수정 필요 - private func dispatchUserLogin(type: SetupEndPoint) { -// AF.request(type.address, -// method: type.method, -// parameters: type.body, -// encoder: JSONParameterEncoder.default, -// headers: type.headers -// ).responseDecodable(of: BaseModel.self) { [weak self] response in -// guard let self else { return } -// switch response.result { -// case .success: -// guard let nickname = self.kigoTextField.text else { return } -// UserDefaultHandler.setNickname(nickname: nickname) -// self.navigationController?.pushViewController(JoinTeamViewController(), animated: true) -// case .failure: -// self.makeAlert(title: TextLiteral.setNicknameViewControllerAlertTitle, message: TextLiteral.setNicknameControllerAlertMessage) -// } -// } - } -} // MARK: - Extension From 8a3538222d672474c0f40579cf4a2f4b49510f37 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 21 Jan 2023 23:20:38 +0900 Subject: [PATCH 020/388] =?UTF-8?q?[CHORE]=20=EB=B9=8C=EB=93=9C=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EB=82=9C=20=EC=BD=94=EB=93=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 1fb79c5f..595592c8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -289,7 +289,8 @@ final class SetNicknameViewController: BaseViewController { didTappedBackground() } - +} + // MARK: - Extension extension SetNicknameViewController: UITextFieldDelegate { From fa0aa00a4612a64ecb7503a511df772a0fa9fa92 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 22 Jan 2023 22:55:04 +0900 Subject: [PATCH 021/388] [CHORE] new button ui in progress (#277) --- .../Screen/Home/Home/HomeViewController.swift | 92 +++++++------------ .../UIComponent/JoinReflectionButton.swift | 40 ++++++-- 2 files changed, 64 insertions(+), 68 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index bb28fcf8..1e42c1b9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -88,27 +88,11 @@ final class HomeViewController: BaseViewController { }() private lazy var joinReflectionButton: JoinReflectionButton = { let joinButton = JoinReflectionButton() - joinButton.layer.cornerRadius = 10 - joinButton.clipsToBounds = true joinButton.buttonAction = { [weak self] in self?.presentSelectReflectionMemberViewController() } return joinButton }() - private lazy var planLabelButtonView: LabelButtonView = { - let labelButton = LabelButtonView() - labelButton.buttonAction = { [weak self] in - self?.presentCreateReflectionViewController() - } - labelButton.subText = TextLiteral.mainViewControllerPlanLabelButtonSubText - labelButton.subButtonText = TextLiteral.mainViewControllerPlanLabelButtonSubButtonText - return labelButton - }() - private let planLabelButtonBackgroundView: UIView = { - let view = UIView() - view.backgroundColor = .backgroundWhite - return view - }() private lazy var addFeedbackButton: UIButton = { let button = UIButton() button.backgroundColor = .white100 @@ -197,20 +181,6 @@ final class HomeViewController: BaseViewController { keywordCollectionView.dataSource = self } - private func renderPlanLabelButton() { - view.addSubview(planLabelButtonBackgroundView) - planLabelButtonBackgroundView.snp.makeConstraints { - $0.horizontalEdges.equalToSuperview() - $0.bottom.equalTo(addFeedbackButton.snp.top) - $0.height.equalTo(SizeLiteral.minimumTouchArea) - } - - planLabelButtonBackgroundView.addSubview(planLabelButtonView) - planLabelButtonView.snp.makeConstraints { - $0.top.bottom.centerX.equalToSuperview() - } - } - private func didTapAddFeedbackButton() { let viewController = UINavigationController(rootViewController: AddFeedbackDetailViewController(feedbackContent: FeedbackContent(toNickName: nil, toUserId: nil, feedbackType: nil, reflectionId: currentReflectionId))) viewController.modalPresentationStyle = .fullScreen @@ -220,7 +190,7 @@ final class HomeViewController: BaseViewController { private func setJoinReflectionButtonBackground() { switch reflectionStatus { case .SettingRequired, .Before, .Done: - joinReflectionButton.backgroundColor = .white100 + joinReflectionButton.joinButton.backgroundColor = .blue100 case .Progressing: joinReflectionButton.layoutIfNeeded() joinReflectionButton.setGradient(colorTop: .gradientBlueTop, colorBottom: .gradientBlueBottom) @@ -228,6 +198,29 @@ final class HomeViewController: BaseViewController { } } + private func setupJoinReflectionButtonAction(status: ReflectionStatus) { + switch status { + case .SettingRequired, .Done: + let action = UIAction { [weak self] _ in +// self?.presentCreateReflectionViewController() + print("Setting required state") + } + joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) + case .Before: + // FIXME: action 추가 + let action = UIAction { [weak self] _ in + print("before state") + } + joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) + case .Progressing: + let action = UIAction { [weak self] _ in +// self?.presentSelectReflectionMemberViewController() + print("progressing state") + } + joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) + } + } + private func presentCreateReflectionViewController() { let viewController = UINavigationController(rootViewController: CreateReflectionViewController(reflectionId: currentReflectionId)) viewController.modalPresentationStyle = .fullScreen @@ -240,25 +233,6 @@ final class HomeViewController: BaseViewController { present(viewController, animated: true) } - - // 회고 상태: Setting Required - private func showPlanLabelButton() { - planLabelButtonView.isHidden = false - planLabelButtonBackgroundView.isHidden = false - } - - // 회고 상태: Before - private func hidePlanLabelButton() { - planLabelButtonView.isHidden = true - planLabelButtonBackgroundView.isHidden = true - - keywordCollectionView.snp.remakeConstraints { - $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) - $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) - $0.bottom.equalTo(addFeedbackButton.snp.top).offset(-10) - } - } - // 회고 상태: Progressing private func showStartReflectionView() { guard let navigationController = self.navigationController else { return } @@ -286,7 +260,7 @@ final class HomeViewController: BaseViewController { keywordCollectionView.snp.remakeConstraints { $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) - $0.bottom.equalTo(planLabelButtonBackgroundView.snp.top).offset(-10) + $0.bottom.equalTo(addFeedbackButton.snp.top).offset(-10) } } } @@ -322,9 +296,6 @@ final class HomeViewController: BaseViewController { self.isAdmin = isAdmin DispatchQueue.main.async { self.teamButton.setTitle(teamName, for: .normal) - if isAdmin { - self.renderPlanLabelButton() - } } } } @@ -337,17 +308,18 @@ final class HomeViewController: BaseViewController { ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { let reflectionDetail = json.detail + dump(reflectionDetail) guard let reflectionStatus = reflectionDetail?.reflectionStatus, let reflectionId = reflectionDetail?.currentReflectionId, let reflectionTitle = reflectionDetail?.reflectionName, let reflectionDate = reflectionDetail?.reflectionDate else { return } - self.currentReflectionId = reflectionId -// self.reflectionStatus = reflectionStatus -// self.reflectionTitle = reflectionTitle -// self.reflectionDate = reflectionDate + self.reflectionStatus = reflectionStatus + self.reflectionTitle = reflectionTitle + self.reflectionDate = reflectionDate self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate) +// self.setupJoinReflectionButtonAction(status: reflectionStatus) if let reflectionKeywordList = reflectionDetail?.reflectionKeywords { self.hasKeyword = true if reflectionKeywordList.isEmpty { @@ -359,12 +331,10 @@ final class HomeViewController: BaseViewController { switch reflectionStatus { case .SettingRequired, .Done: self.addFeedbackButton.isHidden = false - self.showPlanLabelButton() self.restoreView() case .Before: - self.hidePlanLabelButton() + print("") case .Progressing: - self.hidePlanLabelButton() self.hideAddFeedbackButton() if !self.hasSeenReflectionAlert { self.showStartReflectionView() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift index 141903d3..596c3012 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift @@ -15,7 +15,20 @@ final class JoinReflectionButton: UIView { // MARK: - property - private let joinButton = UIButton() + private let shadowView: UIView = { + let view = UIView() + view.layer.shadowColor = UIColor.black100.cgColor + view.layer.shadowOffset = .zero + view.layer.shadowRadius = 5 + view.layer.shadowOpacity = 0.1 + return view + }() + let joinButton: UIButton = { + let button = UIButton() + button.layer.cornerRadius = 10 + button.clipsToBounds = true + return button + }() private lazy var reflectionTitleLabel: UILabel = { let label = UILabel() label.font = .label2 @@ -26,19 +39,32 @@ final class JoinReflectionButton: UIView { label.font = .caption3 return label }() - private let calendarImageView = UIImageView() + private let calendarImageView: UIImageView = { + let imageView = UIImageView() + imageView.layer.shadowColor = UIColor.black100.cgColor + imageView.layer.shadowOffset = .zero + imageView.layer.shadowRadius = 5 + imageView.layer.shadowOpacity = 0.1 + return imageView + }() // MARK: - life cycle init() { super.init(frame: .zero) render() - setupJoinButtonAction() + configUI() +// makeShadow(color: .black100, opacity: 0.2, offset: .zero, radius: 3) } required init?(coder: NSCoder) { nil } func render() { + self.addSubview(shadowView) + shadowView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + self.addSubview(joinButton) joinButton.snp.makeConstraints { $0.edges.equalToSuperview() @@ -67,6 +93,10 @@ final class JoinReflectionButton: UIView { // MARK: - func + private func configUI() { + shadowView.makeShadow(color: .black100, opacity: 0.2, offset: .zero, radius: 3) + } + private func setupJoinButtonAction() { let action = UIAction { [weak self] _ in self?.buttonAction?() @@ -74,10 +104,6 @@ final class JoinReflectionButton: UIView { joinButton.addAction(action, for: .touchUpInside) } -// private func setJoinReflectionShadow() { -// -// } - func setupAttribute(reflectionStatus: ReflectionStatus, title: String, date: String) { switch reflectionStatus { case .SettingRequired, .Done: From c91061b9d070b97dcbace29551314e343412581b Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Mon, 23 Jan 2023 15:17:49 +0900 Subject: [PATCH 022/388] [CHORE] new join reflection button action in progress (#277) --- .../Global/Extension/UIView+Extension.swift | 10 +++++ .../Screen/Home/Home/HomeViewController.swift | 42 ++++++++++--------- .../UIComponent/JoinReflectionButton.swift | 11 +++-- 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIView+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIView+Extension.swift index f1e90b0b..878a48ba 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIView+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIView+Extension.swift @@ -10,6 +10,7 @@ import UIKit extension UIView { func setGradient(colorTop: UIColor, colorBottom: UIColor) { let gradient: CAGradientLayer = CAGradientLayer() + gradient.name = "gradientLayer" gradient.colors = [colorTop.cgColor, colorBottom.cgColor] gradient.locations = [0.0, 1,0] gradient.startPoint = CGPoint(x: 0.0, y: 0.0) @@ -18,6 +19,15 @@ extension UIView { layer.addSublayer(gradient) } + func removeGradient() { + guard let sublayers = self.layer.sublayers else { return } + for sublayer in sublayers { + if sublayer.name == "gradientLayer" { + sublayer.removeFromSuperlayer() + } + } + } + @discardableResult func makeShadow(color: UIColor, opacity: Float, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 1e42c1b9..ad450f2c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -28,8 +28,8 @@ final class HomeViewController: BaseViewController { var currentReflectionId: Int = 0 var reflectionStatus: ReflectionStatus = .Before - var reflectionTitle: String = "" - var reflectionDate: String = "" +// var reflectionTitle: String = "" +// var reflectionDate: String = "" var hasKeyword: Bool = false var isAdmin: Bool = false @@ -88,9 +88,6 @@ final class HomeViewController: BaseViewController { }() private lazy var joinReflectionButton: JoinReflectionButton = { let joinButton = JoinReflectionButton() - joinButton.buttonAction = { [weak self] in - self?.presentSelectReflectionMemberViewController() - } return joinButton }() private lazy var addFeedbackButton: UIButton = { @@ -127,7 +124,6 @@ final class HomeViewController: BaseViewController { } override func configUI() { - setJoinReflectionButtonBackground() navigationController?.isNavigationBarHidden = true view.backgroundColor = .white200 } @@ -187,13 +183,14 @@ final class HomeViewController: BaseViewController { present(viewController, animated: true) } - private func setJoinReflectionButtonBackground() { - switch reflectionStatus { + private func setJoinReflectionButtonBackground(status: ReflectionStatus) { + switch status { case .SettingRequired, .Before, .Done: - joinReflectionButton.joinButton.backgroundColor = .blue100 + joinReflectionButton.joinButton.removeGradient() + joinReflectionButton.joinButton.backgroundColor = .white100 case .Progressing: joinReflectionButton.layoutIfNeeded() - joinReflectionButton.setGradient(colorTop: .gradientBlueTop, colorBottom: .gradientBlueBottom) + joinReflectionButton.joinButton.setGradient(colorTop: .gradientBlueTop, colorBottom: .gradientBlueBottom) joinReflectionButton.render() } } @@ -202,7 +199,7 @@ final class HomeViewController: BaseViewController { switch status { case .SettingRequired, .Done: let action = UIAction { [weak self] _ in -// self?.presentCreateReflectionViewController() + self?.presentCreateReflectionViewController() print("Setting required state") } joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) @@ -214,7 +211,7 @@ final class HomeViewController: BaseViewController { joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) case .Progressing: let action = UIAction { [weak self] _ in -// self?.presentSelectReflectionMemberViewController() + self?.presentSelectReflectionMemberViewController() print("progressing state") } joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) @@ -308,18 +305,23 @@ final class HomeViewController: BaseViewController { ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { let reflectionDetail = json.detail - dump(reflectionDetail) guard let reflectionStatus = reflectionDetail?.reflectionStatus, - let reflectionId = reflectionDetail?.currentReflectionId, - let reflectionTitle = reflectionDetail?.reflectionName, - let reflectionDate = reflectionDetail?.reflectionDate + let reflectionId = reflectionDetail?.currentReflectionId else { return } - self.currentReflectionId = reflectionId + self.reflectionStatus = reflectionStatus - self.reflectionTitle = reflectionTitle - self.reflectionDate = reflectionDate + let reflectionTitle = reflectionDetail?.reflectionName ?? "" + let reflectionDate = reflectionDetail?.reflectionDate ?? "" + + self.currentReflectionId = reflectionId self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate) -// self.setupJoinReflectionButtonAction(status: reflectionStatus) + + + self.setupJoinReflectionButtonAction(status: self.reflectionStatus) + + + self.setJoinReflectionButtonBackground(status: reflectionStatus) + if let reflectionKeywordList = reflectionDetail?.reflectionKeywords { self.hasKeyword = true if reflectionKeywordList.isEmpty { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift index 596c3012..c8022408 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift @@ -15,12 +15,12 @@ final class JoinReflectionButton: UIView { // MARK: - property - private let shadowView: UIView = { + let shadowView: UIView = { let view = UIView() view.layer.shadowColor = UIColor.black100.cgColor view.layer.shadowOffset = .zero - view.layer.shadowRadius = 5 - view.layer.shadowOpacity = 0.1 + view.layer.shadowRadius = 2 + view.layer.shadowOpacity = 0.05 return view }() let joinButton: UIButton = { @@ -43,7 +43,7 @@ final class JoinReflectionButton: UIView { let imageView = UIImageView() imageView.layer.shadowColor = UIColor.black100.cgColor imageView.layer.shadowOffset = .zero - imageView.layer.shadowRadius = 5 + imageView.layer.shadowRadius = 2 imageView.layer.shadowOpacity = 0.1 return imageView }() @@ -54,7 +54,6 @@ final class JoinReflectionButton: UIView { super.init(frame: .zero) render() configUI() -// makeShadow(color: .black100, opacity: 0.2, offset: .zero, radius: 3) } required init?(coder: NSCoder) { nil } @@ -65,7 +64,7 @@ final class JoinReflectionButton: UIView { $0.edges.equalToSuperview() } - self.addSubview(joinButton) + shadowView.addSubview(joinButton) joinButton.snp.makeConstraints { $0.edges.equalToSuperview() } From 8cab050023c111eae5cc40a5b65c7f5036ca18e6 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Mon, 23 Jan 2023 16:47:42 +0900 Subject: [PATCH 023/388] [CHORE] joinreflection action almost completed..! (#277) --- .../Maddori.Apple.xcodeproj/project.pbxproj | 2 +- .../Screen/Home/Home/HomeViewController.swift | 106 +++++++----------- 2 files changed, 44 insertions(+), 64 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 9fd63e41..14f0f655 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1318,7 +1318,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = HF8GHZB58X; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index ad450f2c..650b750c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -12,9 +12,6 @@ import SnapKit final class HomeViewController: BaseViewController { - var keywordList: [String] = TextLiteral.homeViewControllerEmptyCollectionViewList - var isTouched = false - private enum Size { static let keywordLabelHeight: CGFloat = 50 static let labelButtonPadding: CGFloat = 6 @@ -26,12 +23,14 @@ final class HomeViewController: BaseViewController { static let planReflectionViewHeight: CGFloat = 40 } + var keywordList: [String] = TextLiteral.homeViewControllerEmptyCollectionViewList + var isTouched = false + + private var joinReflectionButtonActionIdentifier: UIAction.Identifier = UIAction.Identifier(rawValue: "") + var currentReflectionId: Int = 0 var reflectionStatus: ReflectionStatus = .Before -// var reflectionTitle: String = "" -// var reflectionDate: String = "" - var hasKeyword: Bool = false var isAdmin: Bool = false var hasSeenReflectionAlert: Bool = UserDefaultStorage.hasSeenReflectionAlert { willSet { @@ -110,14 +109,14 @@ final class HomeViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - setUpDelegation() + setupDelegation() render() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if reflectionStatus == .Progressing && !hasSeenReflectionAlert { - showStartReflectionView() + presentStartReflectionView() } fetchCertainTeamDetail(type: .fetchCertainTeamDetail) fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) @@ -172,21 +171,15 @@ final class HomeViewController: BaseViewController { // MARK: - func - private func setUpDelegation() { + private func setupDelegation() { keywordCollectionView.delegate = self keywordCollectionView.dataSource = self } - private func didTapAddFeedbackButton() { - let viewController = UINavigationController(rootViewController: AddFeedbackDetailViewController(feedbackContent: FeedbackContent(toNickName: nil, toUserId: nil, feedbackType: nil, reflectionId: currentReflectionId))) - viewController.modalPresentationStyle = .fullScreen - present(viewController, animated: true) - } - - private func setJoinReflectionButtonBackground(status: ReflectionStatus) { + private func setupJoinReflectionButtonBackground(status: ReflectionStatus) { + joinReflectionButton.joinButton.removeGradient() switch status { case .SettingRequired, .Before, .Done: - joinReflectionButton.joinButton.removeGradient() joinReflectionButton.joinButton.backgroundColor = .white100 case .Progressing: joinReflectionButton.layoutIfNeeded() @@ -196,26 +189,28 @@ final class HomeViewController: BaseViewController { } private func setupJoinReflectionButtonAction(status: ReflectionStatus) { - switch status { - case .SettingRequired, .Done: - let action = UIAction { [weak self] _ in + joinReflectionButton.joinButton.removeAction(identifiedBy: joinReflectionButtonActionIdentifier, for: .touchUpInside) + let action = UIAction { [weak self] _ in + switch status { + case .SettingRequired, .Done: self?.presentCreateReflectionViewController() print("Setting required state") - } - joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) - case .Before: - // FIXME: action 추가 - let action = UIAction { [weak self] _ in - print("before state") - } - joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) - case .Progressing: - let action = UIAction { [weak self] _ in + case .Before: + // FIXME: toast popup + print("Before state") + case .Progressing: self?.presentSelectReflectionMemberViewController() print("progressing state") } - joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) } + joinReflectionButtonActionIdentifier = action.identifier + joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) + } + + private func didTapAddFeedbackButton() { + let viewController = UINavigationController(rootViewController: AddFeedbackDetailViewController(feedbackContent: FeedbackContent(toNickName: nil, toUserId: nil, feedbackType: nil, reflectionId: currentReflectionId))) + viewController.modalPresentationStyle = .fullScreen + present(viewController, animated: true) } private func presentCreateReflectionViewController() { @@ -230,8 +225,8 @@ final class HomeViewController: BaseViewController { present(viewController, animated: true) } - // 회고 상태: Progressing - private func showStartReflectionView() { + + private func presentStartReflectionView() { guard let navigationController = self.navigationController else { return } let viewController = StartReflectionViewController(reflectionId: currentReflectionId, navigationViewController: navigationController, isAdmin: self.isAdmin) viewController.modalPresentationStyle = .overFullScreen @@ -242,30 +237,24 @@ final class HomeViewController: BaseViewController { UserDefaultHandler.clearUserDefaults(of: .completedCurrentReflection) } - private func hideAddFeedbackButton() { - self.addFeedbackButton.isHidden = true + private func showAddFeedbackButton() { + addFeedbackButton.isHidden = false keywordCollectionView.snp.remakeConstraints { $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) - $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(SizeLiteral.bottomTabBarPadding) + $0.bottom.equalTo(addFeedbackButton.snp.top).offset(-10) } } - // 회고 상태: Done - private func restoreView() { - if isAdmin { - keywordCollectionView.snp.remakeConstraints { - $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) - $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) - $0.bottom.equalTo(addFeedbackButton.snp.top).offset(-10) - } + private func hideAddFeedbackButton() { + addFeedbackButton.isHidden = true + keywordCollectionView.snp.remakeConstraints { + $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(SizeLiteral.bottomTabBarPadding) } } - private func hideJoinReflectionButton() { - joinReflectionButton.removeFromSuperview() - } - private func convertFetchedKeywordList(of list: [String]) { if !list.isEmpty { keywordList = [] @@ -308,38 +297,29 @@ final class HomeViewController: BaseViewController { guard let reflectionStatus = reflectionDetail?.reflectionStatus, let reflectionId = reflectionDetail?.currentReflectionId else { return } - - self.reflectionStatus = reflectionStatus let reflectionTitle = reflectionDetail?.reflectionName ?? "" let reflectionDate = reflectionDetail?.reflectionDate ?? "" + self.reflectionStatus = reflectionStatus self.currentReflectionId = reflectionId self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate) - - self.setupJoinReflectionButtonAction(status: self.reflectionStatus) - - - self.setJoinReflectionButtonBackground(status: reflectionStatus) + self.setupJoinReflectionButtonAction(status: reflectionStatus) + self.setupJoinReflectionButtonBackground(status: reflectionStatus) if let reflectionKeywordList = reflectionDetail?.reflectionKeywords { - self.hasKeyword = true if reflectionKeywordList.isEmpty { self.resetKeywordList() - self.hasKeyword = false } self.convertFetchedKeywordList(of: reflectionKeywordList) DispatchQueue.main.async { switch reflectionStatus { - case .SettingRequired, .Done: - self.addFeedbackButton.isHidden = false - self.restoreView() - case .Before: - print("") + case .SettingRequired, .Before, .Done: + self.showAddFeedbackButton() case .Progressing: self.hideAddFeedbackButton() if !self.hasSeenReflectionAlert { - self.showStartReflectionView() + self.presentStartReflectionView() } } self.flowLayout.count = reflectionKeywordList.count From e297ffb8a9eafe1da95c704b61e540def0b4e153 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Mon, 23 Jan 2023 17:05:52 +0900 Subject: [PATCH 024/388] [CHORE] toast popup added (#277) --- .../Screen/Home/Home/HomeViewController.swift | 51 +++++++++++++++++-- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 650b750c..9c8db39a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -40,6 +40,17 @@ final class HomeViewController: BaseViewController { // MARK: - property + private let toastView: UIView = { + let view = UIView() + view.layer.cornerRadius = 10 + view.clipsToBounds = true + return view + }() + private let toastContentView: ToastContentView = { + let view = ToastContentView() + view.toastType = .warning + return view + }() private lazy var flowLayout: KeywordCollectionViewFlowLayout = { let layout = KeywordCollectionViewFlowLayout() layout.count = keywordList.count @@ -125,9 +136,23 @@ final class HomeViewController: BaseViewController { override func configUI() { navigationController?.isNavigationBarHidden = true view.backgroundColor = .white200 + setupGradientToastView() } override func render() { + view.addSubview(toastView) + toastView.snp.makeConstraints { + $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.top).offset(-60) + $0.centerX.equalToSuperview() + $0.height.equalTo(46) + } + + toastView.addSubview(toastContentView) + toastContentView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + toastContentView.render() + view.addSubview(teamButton) teamButton.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) @@ -194,19 +219,21 @@ final class HomeViewController: BaseViewController { switch status { case .SettingRequired, .Done: self?.presentCreateReflectionViewController() - print("Setting required state") case .Before: - // FIXME: toast popup - print("Before state") + self?.popToastView() case .Progressing: self?.presentSelectReflectionMemberViewController() - print("progressing state") } } joinReflectionButtonActionIdentifier = action.identifier joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) } + private func setupGradientToastView() { + toastView.layoutIfNeeded() + toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) + } + private func didTapAddFeedbackButton() { let viewController = UINavigationController(rootViewController: AddFeedbackDetailViewController(feedbackContent: FeedbackContent(toNickName: nil, toUserId: nil, feedbackType: nil, reflectionId: currentReflectionId))) viewController.modalPresentationStyle = .fullScreen @@ -225,7 +252,6 @@ final class HomeViewController: BaseViewController { present(viewController, animated: true) } - private func presentStartReflectionView() { guard let navigationController = self.navigationController else { return } let viewController = StartReflectionViewController(reflectionId: currentReflectionId, navigationViewController: navigationController, isAdmin: self.isAdmin) @@ -237,6 +263,21 @@ final class HomeViewController: BaseViewController { UserDefaultHandler.clearUserDefaults(of: .completedCurrentReflection) } + private func popToastView() { + if !isTouched { + isTouched = true + UIView.animate(withDuration: 0.5, delay: 0, animations: { + self.toastView.transform = CGAffineTransform(translationX: 0, y: 115) + }, completion: {_ in + UIView.animate(withDuration: 1, delay: 0.8, animations: { + self.toastView.transform = .identity + }, completion: {_ in + self.isTouched = false + }) + }) + } + } + private func showAddFeedbackButton() { addFeedbackButton.isHidden = false keywordCollectionView.snp.remakeConstraints { From 01c3f6ddba26cd8cf1b6583e3ff6bf6fb19a3941 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 24 Jan 2023 13:52:35 +0900 Subject: [PATCH 025/388] =?UTF-8?q?[ADD]=20=EB=AA=A8=EB=8B=AC=20=EB=B7=B0?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 +++ .../Screen/Home/Home/HomeViewController.swift | 9 ++++-- .../Home/Home/TeamManageViewController.swift | 29 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 9fd63e41..e6fd00ea 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -129,6 +129,7 @@ 7EB4D58229011EF7001FC396 /* JoinTeamViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EB4D58129011EF7001FC396 /* JoinTeamViewController.swift */; }; 7EE38BAD2925DDD200FD738D /* EncodeDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */; }; 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */; }; + D702278A297F99510027EF64 /* TeamManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7022789297F99500027EF64 /* TeamManageViewController.swift */; }; D724790C28FEC8C900D67B50 /* BaseTextFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */; }; D724790E28FEEEC300D67B50 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790D28FEEEC300D67B50 /* CustomTextField.swift */; }; D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */; }; @@ -266,6 +267,7 @@ 7EB4D58129011EF7001FC396 /* JoinTeamViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinTeamViewController.swift; sourceTree = ""; }; 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncodeDTO.swift; sourceTree = ""; }; 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionEndPoint.swift; sourceTree = ""; }; + D7022789297F99500027EF64 /* TeamManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageViewController.swift; sourceTree = ""; }; D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTextFieldViewController.swift; sourceTree = ""; }; D724790D28FEEEC300D67B50 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = ""; }; D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeViewController.swift; sourceTree = ""; }; @@ -709,6 +711,7 @@ children = ( 3E5195A9292B05B000710A01 /* UIComponent */, 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */, + D7022789297F99500027EF64 /* TeamManageViewController.swift */, ); path = Home; sourceTree = ""; @@ -1131,6 +1134,7 @@ 3E557FC528FE854600714E46 /* KeywordLabel.swift in Sources */, 39F52C53292330D200B19A77 /* MemberResponse.swift in Sources */, 39F52C6A292473A800B19A77 /* ReflectionInfoResponse.swift in Sources */, + D702278A297F99510027EF64 /* TeamManageViewController.swift in Sources */, 39F52C68292472EB00B19A77 /* AllFeedBackResponse.swift in Sources */, 3975CEAF293EEDD6002D4F1A /* KeywordView.swift in Sources */, 39257DF128F93C2A00201E0B /* ImageLiteral.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 40d7b297..67ef8497 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -56,9 +56,9 @@ final class HomeViewController: BaseViewController { button.semanticContentAttribute = .forceRightToLeft button.setPreferredSymbolConfiguration(UIImage.SymbolConfiguration(pointSize: 13, weight: .semibold), forImageIn: .normal) button.tintColor = .black100 - let action = UIAction { _ in + let action = UIAction { [weak self] _ in // FIXME: 버튼 눌렀을 때 action 추가 - print("touched") + self?.setupPresentModel() } button.addAction(action, for: .touchUpInside) return button @@ -189,6 +189,11 @@ final class HomeViewController: BaseViewController { // MARK: - func + private func setupPresentModel() { + let teamViewController = TeamManageViewController() + + } + private func setUpDelegation() { keywordCollectionView.delegate = self keywordCollectionView.dataSource = self diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift new file mode 100644 index 00000000..d6668a8d --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -0,0 +1,29 @@ +// +// TeamManageViewController.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/01/24. +// + +import UIKit + +import SnapKit + +final class TeamManageViewController: BaseViewController { + + // MARK: - property + + // MARK: - life cycle + override func viewDidLoad() { + super.viewDidLoad() + } + + // MARK: - func + override func render() { + + } + override func configUI() { + super.configUI() + view.backgroundColor = .red + } +} From 010b9a83f241541b9369c8bbd298443a973e3fe6 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 24 Jan 2023 13:59:35 +0900 Subject: [PATCH 026/388] =?UTF-8?q?[FEAT]=20=ED=95=98=ED=94=84=20=EB=AA=A8?= =?UTF-8?q?=EB=8B=AC=20=EB=9D=84=EC=9A=B0=EA=B8=B0=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 67ef8497..45d40040 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -192,6 +192,19 @@ final class HomeViewController: BaseViewController { private func setupPresentModel() { let teamViewController = TeamManageViewController() + teamViewController.modalPresentationStyle = .pageSheet + + if #available(iOS 15.0, *) { + if let sheet = teamViewController.sheetPresentationController { + sheet.detents = [.medium(), .large()] + sheet.delegate = self + sheet.prefersGrabberVisible = true + } + } else { + // FIXME: 15 미만일때는 어떻게 해야할지 고민중.. + } + + present(teamViewController, animated: true) } private func setUpDelegation() { @@ -414,3 +427,6 @@ extension HomeViewController: UICollectionViewDelegateFlowLayout { } } +extension HomeViewController: UISheetPresentationControllerDelegate { + +} From 42ce1c186b13f5edf0646c8e361eb90497943d35 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 24 Jan 2023 17:46:03 +0900 Subject: [PATCH 027/388] =?UTF-8?q?[CHORE]=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EC=9C=84=EC=B9=98=20=ED=99=95=EC=9D=B8=ED=95=98=EA=B8=B0=20(#2?= =?UTF-8?q?80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index d6668a8d..4aa26f48 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -12,18 +12,62 @@ import SnapKit final class TeamManageViewController: BaseViewController { // MARK: - property + private let label = UILabel() + private let manageTableView: UITableView = { + let tableView = UITableView() + return tableView + }() // MARK: - life cycle override func viewDidLoad() { super.viewDidLoad() + setupTableViewRegisterCell() + setupTableViewDelegateDataSource() } - // MARK: - func override func render() { + label.text = "테스트느트트트" + view.addSubview(label) + label.snp.makeConstraints { + $0.top.equalToSuperview().inset(40) + $0.left.equalToSuperview().inset(40) + } + view.addSubview(manageTableView) + manageTableView.snp.makeConstraints { + $0.top.equalTo(label.snp.bottom) + $0.width.equalTo(200) + $0.height.equalTo(600) + } } + override func configUI() { super.configUI() view.backgroundColor = .red } + + // MARK: - func + private func setupTableViewRegisterCell() { + manageTableView.register(UITableViewCell.self, forCellReuseIdentifier: UITableViewCell.className) + } + + private func setupTableViewDelegateDataSource() { + manageTableView.delegate = self + manageTableView.dataSource = self + } +} + +extension TeamManageViewController: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 5 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: UITableViewCell.className, for: indexPath) as? UITableViewCell else { return UITableViewCell() } + return cell + } +} + +extension TeamManageViewController: UITableViewDelegate { + } From be02d2fd2fbae1f28137017f32aee3eef30c91a1 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 24 Jan 2023 21:35:02 +0900 Subject: [PATCH 028/388] =?UTF-8?q?[ADD]=20TeamManage=20TableView=20Cell?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++++ .../Home/Home/ParticipatingTeamCell.swift | 22 +++++++++++++++++++ .../Home/Home/TeamManageViewController.swift | 18 +++++---------- 3 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index e6fd00ea..1e331bbf 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -130,6 +130,7 @@ 7EE38BAD2925DDD200FD738D /* EncodeDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */; }; 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */; }; D702278A297F99510027EF64 /* TeamManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7022789297F99500027EF64 /* TeamManageViewController.swift */; }; + D702278C2980075C0027EF64 /* ParticipatingTeamCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */; }; D724790C28FEC8C900D67B50 /* BaseTextFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */; }; D724790E28FEEEC300D67B50 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790D28FEEEC300D67B50 /* CustomTextField.swift */; }; D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */; }; @@ -268,6 +269,7 @@ 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncodeDTO.swift; sourceTree = ""; }; 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionEndPoint.swift; sourceTree = ""; }; D7022789297F99500027EF64 /* TeamManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageViewController.swift; sourceTree = ""; }; + D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParticipatingTeamCell.swift; sourceTree = ""; }; D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTextFieldViewController.swift; sourceTree = ""; }; D724790D28FEEEC300D67B50 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = ""; }; D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeViewController.swift; sourceTree = ""; }; @@ -712,6 +714,7 @@ 3E5195A9292B05B000710A01 /* UIComponent */, 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */, D7022789297F99500027EF64 /* TeamManageViewController.swift */, + D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */, ); path = Home; sourceTree = ""; @@ -1060,6 +1063,7 @@ 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */, 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */, 39F52C7A2924CC9600B19A77 /* SetupEndPoint.swift in Sources */, + D702278C2980075C0027EF64 /* ParticipatingTeamCell.swift in Sources */, 39F52C5F2923338B00B19A77 /* CurrentMemberResponse.swift in Sources */, 397E49572924D93F004220D6 /* UrlLiteral.swift in Sources */, 3E557FFA2901CD4200714E46 /* KeywordCollectionViewCell.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift new file mode 100644 index 00000000..cc3a3758 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift @@ -0,0 +1,22 @@ +// +// ParticipatingTeamCell.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/01/24. +// + +import UIKit + +import SnapKit + +final class ParticipatingTeamCell: BaseTableViewCell { + + // MARK: - life cycle + override func render() { + + } + + override func configUI() { + backgroundColor = .yellow + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 4aa26f48..a2c97c51 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -12,7 +12,6 @@ import SnapKit final class TeamManageViewController: BaseViewController { // MARK: - property - private let label = UILabel() private let manageTableView: UITableView = { let tableView = UITableView() return tableView @@ -26,18 +25,11 @@ final class TeamManageViewController: BaseViewController { } override func render() { - label.text = "테스트느트트트" - view.addSubview(label) - label.snp.makeConstraints { - $0.top.equalToSuperview().inset(40) - $0.left.equalToSuperview().inset(40) - } - view.addSubview(manageTableView) manageTableView.snp.makeConstraints { - $0.top.equalTo(label.snp.bottom) - $0.width.equalTo(200) - $0.height.equalTo(600) + $0.top.equalTo(self.view.safeAreaLayoutGuide).inset(26) + $0.horizontalEdges.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.height.equalToSuperview() } } @@ -48,7 +40,7 @@ final class TeamManageViewController: BaseViewController { // MARK: - func private func setupTableViewRegisterCell() { - manageTableView.register(UITableViewCell.self, forCellReuseIdentifier: UITableViewCell.className) + manageTableView.register(ParticipatingTeamCell.self, forCellReuseIdentifier: ParticipatingTeamCell.className) } private func setupTableViewDelegateDataSource() { @@ -63,7 +55,7 @@ extension TeamManageViewController: UITableViewDataSource { } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell(withIdentifier: UITableViewCell.className, for: indexPath) as? UITableViewCell else { return UITableViewCell() } + guard let cell = tableView.dequeueReusableCell(withIdentifier: ParticipatingTeamCell.className, for: indexPath) as? ParticipatingTeamCell else { return UITableViewCell() } return cell } } From 36b69688f19a2412329d42c14cde28659ad0ed16 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 24 Jan 2023 21:46:46 +0900 Subject: [PATCH 029/388] =?UTF-8?q?[CHORE]=20=EC=9E=90=EC=9E=98=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD=20(#277)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 9c8db39a..40d8123c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -14,13 +14,9 @@ final class HomeViewController: BaseViewController { private enum Size { static let keywordLabelHeight: CGFloat = 50 - static let labelButtonPadding: CGFloat = 6 static let propertyPadding: CGFloat = 32 static let buttonCornerRadius: CGFloat = 27 static let mainButtonHeight: CGFloat = 54 - static let subButtonWidth: CGFloat = 54 - static let subButtonHeight: CGFloat = 20 - static let planReflectionViewHeight: CGFloat = 40 } var keywordList: [String] = TextLiteral.homeViewControllerEmptyCollectionViewList @@ -96,10 +92,7 @@ final class HomeViewController: BaseViewController { label.textColor = .black100 return label }() - private lazy var joinReflectionButton: JoinReflectionButton = { - let joinButton = JoinReflectionButton() - return joinButton - }() + private lazy var joinReflectionButton = JoinReflectionButton() private lazy var addFeedbackButton: UIButton = { let button = UIButton() button.backgroundColor = .white100 @@ -110,7 +103,7 @@ final class HomeViewController: BaseViewController { button.layer.borderColor = UIColor.blue200.cgColor button.layer.cornerRadius = Size.buttonCornerRadius let action = UIAction { [weak self] _ in - self?.didTapAddFeedbackButton() + self?.presentAddFeedbackViewController() } button.addAction(action, for: .touchUpInside) return button @@ -234,7 +227,7 @@ final class HomeViewController: BaseViewController { toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) } - private func didTapAddFeedbackButton() { + private func presentAddFeedbackViewController() { let viewController = UINavigationController(rootViewController: AddFeedbackDetailViewController(feedbackContent: FeedbackContent(toNickName: nil, toUserId: nil, feedbackType: nil, reflectionId: currentReflectionId))) viewController.modalPresentationStyle = .fullScreen present(viewController, animated: true) @@ -397,7 +390,7 @@ extension HomeViewController: UICollectionViewDataSource { UIDevice.vibrate() switch reflectionStatus { case .Before, .SettingRequired, .Done: - didTapAddFeedbackButton() + presentAddFeedbackViewController() case .Progressing: guard let navigationController = self.navigationController else { return } let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: isAdmin)) From 23c1394d86ad336dc11f3a1be31ccd02f272c18c Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 24 Jan 2023 21:52:03 +0900 Subject: [PATCH 030/388] =?UTF-8?q?[ADD]=20SettingCell=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++++ .../Home/Home/ParticipatingTeamCell.swift | 2 +- .../Screen/Home/Home/SettingCell.swift | 22 +++++++++++++++++++ .../Home/Home/TeamManageViewController.swift | 22 +++++++++++++++---- 4 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/SettingCell.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 1e331bbf..5b55c76d 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -131,6 +131,7 @@ 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */; }; D702278A297F99510027EF64 /* TeamManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7022789297F99500027EF64 /* TeamManageViewController.swift */; }; D702278C2980075C0027EF64 /* ParticipatingTeamCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */; }; + D702278E29800B240027EF64 /* SettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D702278D29800B240027EF64 /* SettingCell.swift */; }; D724790C28FEC8C900D67B50 /* BaseTextFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */; }; D724790E28FEEEC300D67B50 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790D28FEEEC300D67B50 /* CustomTextField.swift */; }; D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */; }; @@ -270,6 +271,7 @@ 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionEndPoint.swift; sourceTree = ""; }; D7022789297F99500027EF64 /* TeamManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageViewController.swift; sourceTree = ""; }; D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParticipatingTeamCell.swift; sourceTree = ""; }; + D702278D29800B240027EF64 /* SettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingCell.swift; sourceTree = ""; }; D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTextFieldViewController.swift; sourceTree = ""; }; D724790D28FEEEC300D67B50 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = ""; }; D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeViewController.swift; sourceTree = ""; }; @@ -715,6 +717,7 @@ 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */, D7022789297F99500027EF64 /* TeamManageViewController.swift */, D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */, + D702278D29800B240027EF64 /* SettingCell.swift */, ); path = Home; sourceTree = ""; @@ -1079,6 +1082,7 @@ 39436C132912877D0083D77A /* MyFeedbackHeaderView.swift in Sources */, 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */, D750511B29423CB6001BDA34 /* SelectKeywordTypeView.swift in Sources */, + D702278E29800B240027EF64 /* SettingCell.swift in Sources */, 39F52C6E2924742E00B19A77 /* ReflectionResponse.swift in Sources */, 52988B742921EAD50044A77F /* MyReflectionFeedbackViewController.swift in Sources */, 7E8753E129348BB000FBBF83 /* MyReflectionDetailViewLastCell.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift index cc3a3758..3a0009f1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift @@ -17,6 +17,6 @@ final class ParticipatingTeamCell: BaseTableViewCell { } override func configUI() { - backgroundColor = .yellow + backgroundColor = .white100 } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/SettingCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/SettingCell.swift new file mode 100644 index 00000000..2c33a955 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/SettingCell.swift @@ -0,0 +1,22 @@ +// +// SettingCell.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/01/24. +// + +import UIKit + +import SnapKit + +final class SettingCell: BaseTableViewCell { + //FIXME: 네임 변경 예정 + // MARK: - life cycle + override func render() { + + } + + override func configUI() { + backgroundColor = .yellow + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index a2c97c51..bbb6126d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -35,12 +35,12 @@ final class TeamManageViewController: BaseViewController { override func configUI() { super.configUI() - view.backgroundColor = .red } // MARK: - func private func setupTableViewRegisterCell() { manageTableView.register(ParticipatingTeamCell.self, forCellReuseIdentifier: ParticipatingTeamCell.className) + manageTableView.register(SettingCell.self, forCellReuseIdentifier: SettingCell.className) } private func setupTableViewDelegateDataSource() { @@ -55,11 +55,25 @@ extension TeamManageViewController: UITableViewDataSource { } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell(withIdentifier: ParticipatingTeamCell.className, for: indexPath) as? ParticipatingTeamCell else { return UITableViewCell() } - return cell + if indexPath.row == 0 { + guard let cell = tableView.dequeueReusableCell(withIdentifier: ParticipatingTeamCell.className, for: indexPath) as? ParticipatingTeamCell else { return UITableViewCell() } + return cell + } + else { + guard let cell = tableView.dequeueReusableCell(withIdentifier: SettingCell.className, for: indexPath) as? SettingCell else { return UITableViewCell() } + return cell + } } } extension TeamManageViewController: UITableViewDelegate { - + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + //FIXME: 첫번째 그리고 세퍼레이터 변경 예정 + if indexPath.row == 0 { + return 200 + } + else { + return 60 + } + } } From 968fe8c188c35adc2c9f6b32602745ed3844c3bf Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 25 Jan 2023 16:06:43 +0900 Subject: [PATCH 031/388] =?UTF-8?q?[ADD]=20action=20sheet=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Supports/SceneDelegate.swift | 2 +- .../Setup/SetNickname/SetNicknameViewController.swift | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift index 2aa4fc54..141f3f14 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift @@ -23,7 +23,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if isLogined { rootViewController = CustomTabBarController() } else { - rootViewController = UINavigationController(rootViewController: LoginViewController()) + rootViewController = UINavigationController(rootViewController: SetNicknameViewController()) } window?.rootViewController = rootViewController window?.makeKeyAndVisible() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 595592c8..6d917007 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -196,8 +196,15 @@ final class SetNicknameViewController: BaseViewController { // MARK: - func private func didTappedProfile() { - // FIXME: - 갤러리로 이동 - print("프로필 누름") + let actionSheet = UIAlertController(title: "프로필 사진 설정", message: nil, preferredStyle: .actionSheet) + let libraryAction = UIAlertAction(title: "앨범에서 사진 선택", style: .default) { _ in print("앨범") } + let cameraAction = UIAlertAction(title: "사진 촬영", style: .default) { _ in print("사진 촬영") } + let cancelAction = UIAlertAction(title: "취소", style: .cancel) + + actionSheet.addAction(libraryAction) + actionSheet.addAction(cameraAction) + actionSheet.addAction(cancelAction) + present(actionSheet, animated: true, completion: nil) } private func setupDelegate() { From b1de5168d17c9238d59fd739081bef6c76a63ed6 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 25 Jan 2023 16:17:04 +0900 Subject: [PATCH 032/388] =?UTF-8?q?[ADD]=20imagepicker=20delegate=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 6d917007..c97fae64 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -17,6 +17,7 @@ final class SetNicknameViewController: BaseViewController { private let minLength: Int = 0 private let nicknameMaxLength: Int = 6 private let roleMaxLength: Int = 20 + let imagePicker = UIImagePickerController() // MARK: - property @@ -197,8 +198,8 @@ final class SetNicknameViewController: BaseViewController { private func didTappedProfile() { let actionSheet = UIAlertController(title: "프로필 사진 설정", message: nil, preferredStyle: .actionSheet) - let libraryAction = UIAlertAction(title: "앨범에서 사진 선택", style: .default) { _ in print("앨범") } - let cameraAction = UIAlertAction(title: "사진 촬영", style: .default) { _ in print("사진 촬영") } + let libraryAction = UIAlertAction(title: "앨범에서 사진 선택", style: .default) { _ in self.openLibrary() } + let cameraAction = UIAlertAction(title: "사진 촬영", style: .default) { _ in self.openCamera() } let cancelAction = UIAlertAction(title: "취소", style: .cancel) actionSheet.addAction(libraryAction) @@ -210,6 +211,8 @@ final class SetNicknameViewController: BaseViewController { private func setupDelegate() { nicknameTextField.delegate = self roleTextField.delegate = self + + imagePicker.delegate = self } private func setupNotificationCenter() { @@ -277,6 +280,14 @@ final class SetNicknameViewController: BaseViewController { }, completion: nil) } + private func openLibrary() { + print("앨범 열기") + } + + private func openCamera() { + print("카메라 열기") + } + // MARK: - selector @objc private func keyboardWillShow(notification:NSNotification) { @@ -314,3 +325,7 @@ extension SetNicknameViewController: UITextFieldDelegate { return true } } + +extension SetNicknameViewController: UIImagePickerControllerDelegate & UINavigationControllerDelegate { + +} From 50fa12777e3ed1a2283d984cd18a09522f38e1ef Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 25 Jan 2023 16:22:18 +0900 Subject: [PATCH 033/388] =?UTF-8?q?[ADD]=20info=20list=20=EA=B6=8C?= =?UTF-8?q?=ED=95=9C=20=EC=B6=94=EA=B0=80(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index e0d46d44..3f472ba8 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1334,6 +1334,8 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; + INFOPLIST_KEY_NSCameraUsageDescription = ""; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -1369,6 +1371,8 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; + INFOPLIST_KEY_NSCameraUsageDescription = ""; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; From 6fc5db7d5fdadbc6d6c429008fec1ca78603824e Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 25 Jan 2023 17:01:43 +0900 Subject: [PATCH 034/388] =?UTF-8?q?[ADD]=20=EC=95=A8=EB=B2=94=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=82=AC=EC=A7=84=20=EB=B6=88=EB=9F=AC=EC=98=A4?= =?UTF-8?q?=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 -- .../SetNicknameViewController.swift | 38 +++++++++++++++---- .../UIComponent/ProfileImageButton.swift | 8 +++- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 3f472ba8..e0d46d44 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1334,8 +1334,6 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; - INFOPLIST_KEY_NSCameraUsageDescription = ""; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -1371,8 +1369,6 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; - INFOPLIST_KEY_NSCameraUsageDescription = ""; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index c97fae64..490f5495 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -6,18 +6,17 @@ // import UIKit +import PhotosUI import Alamofire import SnapKit final class SetNicknameViewController: BaseViewController { - // FIXME: - 합류한 팀 이름 받아오기 var teamName = "맛쟁이사과처럼세글자" private let minLength: Int = 0 private let nicknameMaxLength: Int = 6 private let roleMaxLength: Int = 20 - let imagePicker = UIImagePickerController() // MARK: - property @@ -211,8 +210,6 @@ final class SetNicknameViewController: BaseViewController { private func setupDelegate() { nicknameTextField.delegate = self roleTextField.delegate = self - - imagePicker.delegate = self } private func setupNotificationCenter() { @@ -281,7 +278,14 @@ final class SetNicknameViewController: BaseViewController { } private func openLibrary() { - print("앨범 열기") + var configuration = PHPickerConfiguration() + configuration.selectionLimit = 1 + configuration.filter = .any(of: [.images]) + + let picker = PHPickerViewController(configuration: configuration) + picker.delegate = self + + self.present(picker, animated: true, completion: nil) } private func openCamera() { @@ -308,7 +312,7 @@ final class SetNicknameViewController: BaseViewController { didTappedBackground() } } - + // MARK: - Extension extension SetNicknameViewController: UITextFieldDelegate { @@ -326,6 +330,24 @@ extension SetNicknameViewController: UITextFieldDelegate { } } -extension SetNicknameViewController: UIImagePickerControllerDelegate & UINavigationControllerDelegate { - +extension SetNicknameViewController: PHPickerViewControllerDelegate { + func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { + picker.dismiss(animated: true, completion: nil) + + let itemProvider = results.first?.itemProvider + + if let itemProvider = itemProvider, + itemProvider.canLoadObject(ofClass: UIImage.self){ + itemProvider.loadObject(ofClass: UIImage.self) { + (image, error) in + DispatchQueue.main.async { + self.profileImageButton.profileImage.image = image as? UIImage + + // FIXME: - 이미지 정보 가져오기 + } + } + } else { + self.makeAlert(title: "이미지를 불러올 수 없습니다.", message: "설정에서 이미지 접근 권한을 다시 확인해 주세요") + } + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift index a05c1877..ea720139 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift @@ -13,7 +13,13 @@ final class ProfileImageButton: UIButton { // MARK: - property - var profileImage = UIImageView(image: ImageLiterals.imgProfileNone) + var profileImage: UIImageView = { + let imageView = UIImageView() + imageView.image = ImageLiterals.imgProfileNone + imageView.clipsToBounds = true + imageView.layer.cornerRadius = 34 + return imageView + }() private let profilePlus: UIImageView = { let imageView = UIImageView() imageView.image = ImageLiterals.icPlus From f85525edabc14194cc0da0bc767d685ed4653c3a Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 25 Jan 2023 17:15:06 +0900 Subject: [PATCH 035/388] =?UTF-8?q?[ADD]=20=EC=82=AC=EC=A7=84=20=EC=B4=AC?= =?UTF-8?q?=EC=98=81=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84-=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=ED=95=84=EC=9A=94(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 2 ++ .../SetNicknameViewController.swift | 22 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index e0d46d44..13423cb0 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1334,6 +1334,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; + INFOPLIST_KEY_NSCameraUsageDescription = ""; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -1369,6 +1370,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; + INFOPLIST_KEY_NSCameraUsageDescription = ""; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 490f5495..013aa9bb 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -17,6 +17,7 @@ final class SetNicknameViewController: BaseViewController { private let minLength: Int = 0 private let nicknameMaxLength: Int = 6 private let roleMaxLength: Int = 20 + let cameraPicker = UIImagePickerController() // MARK: - property @@ -210,6 +211,8 @@ final class SetNicknameViewController: BaseViewController { private func setupDelegate() { nicknameTextField.delegate = self roleTextField.delegate = self + + cameraPicker.delegate = self } private func setupNotificationCenter() { @@ -289,7 +292,12 @@ final class SetNicknameViewController: BaseViewController { } private func openCamera() { - print("카메라 열기") + if(UIImagePickerController .isSourceTypeAvailable(.camera)) { + cameraPicker.sourceType = .camera + self.present(cameraPicker, animated: false, completion: nil) + } else { + self.makeAlert(title: "카메라를 실행할 수 없습니다", message: "설정에서 카메라 접근 권한을 확인해 주세요.") + } } // MARK: - selector @@ -351,3 +359,15 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { } } } + +extension SetNicknameViewController: UIImagePickerControllerDelegate & UINavigationControllerDelegate { + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { + + cameraPicker.dismiss(animated: true) + + if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { + self.profileImageButton.profileImage.image = image + print(info) + } + } +} From a11de6396db38ae1f06fcd16bd3e7f1b94f30180 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 25 Jan 2023 17:25:52 +0900 Subject: [PATCH 036/388] =?UTF-8?q?[ADD]=20text=20literal=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Literal/TextLiteral.swift | 8 ++++++++ .../SetNickname/SetNicknameViewController.swift | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 4dc039f9..1dc8df85 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -51,6 +51,14 @@ enum TextLiteral { static let setNicknameControllerRoleLabel = "역할" static let setNicknameControllerRoleTextFieldPlaceHolderText = "ex) iOS 개발자" static let setNicknameControllerDoneButtonText = "입력 완료" + static let setNicknameControllerProfileActionSheetTitle = "프로필 사진 설정" + static let setNicknameControllerProfileActionSheetLibraryTitle = "앨범에서 사진 선택" + static let setNicknameControllerProfileActionSheetCameraTitle = "사진 촬영" + static let setNicknameControllerProfileActionSheetCancelTitle = "취소" + static let setNicknameControllerCameraErrorAlertTitle = "카메라를 실행할 수 없습니다." + static let setNicknameControllerCameraErrorAlertMessage = "설정에서 카메라 접근 권한을 확인해 주세요." + static let setNicknameControllerLibraryErrorAlertTitle = "이미지를 불러올 수 없습니다." + static let setNicknameControllerLibraryErrorAlertMessage = "설정에서 이미지 접근 권한을 다시 확인해 주세요." // MARK: - HomeViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 013aa9bb..a740c5d7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -197,10 +197,10 @@ final class SetNicknameViewController: BaseViewController { // MARK: - func private func didTappedProfile() { - let actionSheet = UIAlertController(title: "프로필 사진 설정", message: nil, preferredStyle: .actionSheet) - let libraryAction = UIAlertAction(title: "앨범에서 사진 선택", style: .default) { _ in self.openLibrary() } - let cameraAction = UIAlertAction(title: "사진 촬영", style: .default) { _ in self.openCamera() } - let cancelAction = UIAlertAction(title: "취소", style: .cancel) + let actionSheet = UIAlertController(title: TextLiteral.setNicknameControllerProfileActionSheetTitle, message: nil, preferredStyle: .actionSheet) + let libraryAction = UIAlertAction(title: TextLiteral.setNicknameControllerProfileActionSheetLibraryTitle, style: .default) { _ in self.openLibrary() } + let cameraAction = UIAlertAction(title: TextLiteral.setNicknameControllerProfileActionSheetCameraTitle, style: .default) { _ in self.openCamera() } + let cancelAction = UIAlertAction(title: TextLiteral.setNicknameControllerProfileActionSheetCancelTitle, style: .cancel) actionSheet.addAction(libraryAction) actionSheet.addAction(cameraAction) @@ -296,7 +296,7 @@ final class SetNicknameViewController: BaseViewController { cameraPicker.sourceType = .camera self.present(cameraPicker, animated: false, completion: nil) } else { - self.makeAlert(title: "카메라를 실행할 수 없습니다", message: "설정에서 카메라 접근 권한을 확인해 주세요.") + self.makeAlert(title: TextLiteral.setNicknameControllerCameraErrorAlertTitle, message: TextLiteral.setNicknameControllerCameraErrorAlertMessage) } } @@ -355,7 +355,7 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { } } } else { - self.makeAlert(title: "이미지를 불러올 수 없습니다.", message: "설정에서 이미지 접근 권한을 다시 확인해 주세요") + self.makeAlert(title: TextLiteral.setNicknameControllerLibraryErrorAlertTitle, message: TextLiteral.setNicknameControllerLibraryErrorAlertMessage) } } } From 537ff1fc152072d0f898f6cec4eac7318f80b60e Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 25 Jan 2023 17:34:07 +0900 Subject: [PATCH 037/388] =?UTF-8?q?[ADD]=20TeamDetailViewController=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 ++++++++++++ .../Home/TeamDetail/TeamDetailViewController.swift | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 9fd63e41..fe046a5e 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -38,6 +38,7 @@ 395C7E2028FED7B500FC2FCA /* ReflectionNameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395C7E1F28FED7B500FC2FCA /* ReflectionNameView.swift */; }; 395C7E2228FEDB6500FC2FCA /* UITextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395C7E2128FEDB6500FC2FCA /* UITextField+Extension.swift */; }; 395C7E252900E74700FC2FCA /* StartReflectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395C7E242900E74700FC2FCA /* StartReflectionViewController.swift */; }; + 3960864129811E3C003AB4F8 /* TeamDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3960864029811E3C003AB4F8 /* TeamDetailViewController.swift */; }; 396334D7292DADBE00E74B77 /* AppleLoginDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396334D6292DADBE00E74B77 /* AppleLoginDTO.swift */; }; 396334D9292DAE0000E74B77 /* AppleLoginResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */; }; 396334DB292DAE8300E74B77 /* UserResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396334DA292DAE8300E74B77 /* UserResponse.swift */; }; @@ -175,6 +176,7 @@ 395C7E1F28FED7B500FC2FCA /* ReflectionNameView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionNameView.swift; sourceTree = ""; }; 395C7E2128FEDB6500FC2FCA /* UITextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Extension.swift"; sourceTree = ""; }; 395C7E242900E74700FC2FCA /* StartReflectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartReflectionViewController.swift; sourceTree = ""; }; + 3960864029811E3C003AB4F8 /* TeamDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailViewController.swift; sourceTree = ""; }; 396334D6292DADBE00E74B77 /* AppleLoginDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleLoginDTO.swift; sourceTree = ""; }; 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleLoginResponse.swift; sourceTree = ""; }; 396334DA292DAE8300E74B77 /* UserResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserResponse.swift; sourceTree = ""; }; @@ -497,6 +499,14 @@ path = StartReflection; sourceTree = ""; }; + 3960863F29811D86003AB4F8 /* TeamDetail */ = { + isa = PBXGroup; + children = ( + 3960864029811E3C003AB4F8 /* TeamDetailViewController.swift */, + ); + path = TeamDetail; + sourceTree = ""; + }; 3977E11F2910CECB000E9761 /* Home */ = { isa = PBXGroup; children = ( @@ -507,6 +517,7 @@ 52F2D1BF2906F157009CBF89 /* SelectReflectionMember */, 3E5580052906A79D00714E46 /* InProgress */, 391CBA17290580360044CA30 /* InProgressDetail */, + 3960863F29811D86003AB4F8 /* TeamDetail */, ); path = Home; sourceTree = ""; @@ -1157,6 +1168,7 @@ D7AFB7C32916EAB100E998B7 /* MyReflectionDetailViewController.swift in Sources */, 39F52C632923357700B19A77 /* FeedBackInfoResponse.swift in Sources */, 39F52C5D292332EA00B19A77 /* AddReflectionResponse.swift in Sources */, + 3960864129811E3C003AB4F8 /* TeamDetailViewController.swift in Sources */, D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */, 39257DF328F93D8900201E0B /* TextLiteral.swift in Sources */, 39F52C6C292473EC00B19A77 /* AllReflectionResponse.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift new file mode 100644 index 00000000..e736668c --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -0,0 +1,8 @@ +// +// TeamDetailViewController.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/01/25. +// + +import Foundation From 657077b7dd8b20f60c6f8b77511c38cfe1c99c50 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 25 Jan 2023 17:34:34 +0900 Subject: [PATCH 038/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20View=20=EC=97=B0=EA=B2=B0=20(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 9 ++++-- .../TeamDetail/TeamDetailViewController.swift | 29 ++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 40d7b297..39c518d9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -69,9 +69,9 @@ final class HomeViewController: BaseViewController { button.semanticContentAttribute = .forceRightToLeft button.setPreferredSymbolConfiguration(UIImage.SymbolConfiguration(pointSize: 20), forImageIn: .normal) button.tintColor = .gray600 - let action = UIAction { _ in + let action = UIAction { [weak self] _ in // FIXME: 버튼 눌렀을 때 action 추가 - print("touched") + self?.pushTeamDetailViewController() } button.addAction(action, for: .touchUpInside) return button @@ -300,6 +300,11 @@ final class HomeViewController: BaseViewController { keywordList = TextLiteral.homeViewControllerEmptyCollectionViewList } + private func pushTeamDetailViewController() { + let viewController = TeamDetailViewController() + self.navigationController?.pushViewController(viewController, animated: true) + } + // MARK: - api private func fetchCertainTeamDetail(type: HomeEndPoint) { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index e736668c..0bf0dff5 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -5,4 +5,31 @@ // Created by Mingwan Choi on 2023/01/25. // -import Foundation +import UIKit + +import SnapKit + +final class TeamDetailViewController: BaseViewController { + + // MARK: - property + + private lazy var backButton = BackButton(type: .system) + + override func configUI() { + super.configUI() + navigationController?.isNavigationBarHidden = false + } + + override func render() { + view.backgroundColor = .gray600 + } + + override func setupNavigationBar() { + super.setupNavigationBar() + + let button = removeBarButtonItemOffset(with: backButton, offsetX: 10) + let backButton = makeBarButtonItem(with: button) + + navigationItem.leftBarButtonItem = backButton + } +} From 830fafcc3c1d7ac1030e9337f79bcfa4dd4467bb Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 25 Jan 2023 17:40:39 +0900 Subject: [PATCH 039/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=A0=9C=EB=AA=A9?= =?UTF-8?q?=20label=20=EC=B6=94=EA=B0=80=20(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 0bf0dff5..85fd0820 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -14,6 +14,16 @@ final class TeamDetailViewController: BaseViewController { // MARK: - property private lazy var backButton = BackButton(type: .system) + private let titleLabel: UILabel = { + let label = UILabel() + label.font = .title + label.textColor = .black100 + // FIXME: - API 연결 후 삭제 + label.text = "맛쟁이 사과처럼" + return label + }() + + // MARK: - life cycle override func configUI() { super.configUI() @@ -21,7 +31,11 @@ final class TeamDetailViewController: BaseViewController { } override func render() { - view.backgroundColor = .gray600 + view.addSubview(titleLabel) + titleLabel.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide.snp.top).inset(20) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } } override func setupNavigationBar() { From ae622d2abe6cd6a4313366582e80f2194a5e9390 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 25 Jan 2023 17:57:17 +0900 Subject: [PATCH 040/388] =?UTF-8?q?[CHORE]=20uibutton=20underline=20extens?= =?UTF-8?q?ion=20=EC=B6=94=EA=B0=80=20(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Extension/UIButton+Extension.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIButton+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIButton+Extension.swift index aa0c033b..bdbaf234 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIButton+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIButton+Extension.swift @@ -19,4 +19,14 @@ extension UIButton { self.setBackgroundImage(backgroundImage, for: state) } + + func setUnderline() { + guard let title = title(for: .normal) else { return } + let attributedString = NSMutableAttributedString(string: title) + attributedString.addAttribute(.underlineStyle, + value: NSUnderlineStyle.single.rawValue, + range: NSRange(location: 0, length: title.count) + ) + setAttributedTitle(attributedString, for: .normal) + } } From f53aa339da36d10b979151a72d54d8f324463024 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 25 Jan 2023 17:58:04 +0900 Subject: [PATCH 041/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 85fd0820..3e2fd7f1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -22,9 +22,22 @@ final class TeamDetailViewController: BaseViewController { label.text = "맛쟁이 사과처럼" return label }() + private let editButton: UIButton = { + let button = UIButton() + button.setTitle("편집", for: .normal) + button.titleLabel?.font = .label2 + button.setTitleColor(.gray500, for: .normal) + button.setUnderline() + return button + }() // MARK: - life cycle + override func viewDidLoad() { + super.viewDidLoad() + setupEditButton() + } + override func configUI() { super.configUI() navigationController?.isNavigationBarHidden = false @@ -36,6 +49,13 @@ final class TeamDetailViewController: BaseViewController { $0.top.equalTo(view.safeAreaLayoutGuide.snp.top).inset(20) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + + view.addSubview(editButton) + editButton.snp.makeConstraints { + $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.centerY.equalTo(titleLabel.snp.centerY) + $0.width.height.equalTo(44) + } } override func setupNavigationBar() { @@ -46,4 +66,14 @@ final class TeamDetailViewController: BaseViewController { navigationItem.leftBarButtonItem = backButton } + + // MARK: - func + + private func setupEditButton() { + let action = UIAction { _ in + // FIXME: - 방 정보 수정 view 연결 + print("action") + } + self.editButton.addAction(action, for: .touchUpInside) + } } From 5a4ab3003b98c08d990d7422ff619f6ed6f96a3f Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 25 Jan 2023 18:21:26 +0900 Subject: [PATCH 042/388] =?UTF-8?q?[CHORE]=20tapbar=20=EA=B0=80=EB=A6=AC?= =?UTF-8?q?=EA=B8=B0=20(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 3e2fd7f1..c926cc86 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -35,12 +35,14 @@ final class TeamDetailViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() + setupBackButton() setupEditButton() } override func configUI() { super.configUI() navigationController?.isNavigationBarHidden = false + self.tabBarController?.tabBar.isHidden = true } override func render() { @@ -67,8 +69,20 @@ final class TeamDetailViewController: BaseViewController { navigationItem.leftBarButtonItem = backButton } + override func viewWillDisappear(_ animated: Bool) { + navigationController?.isNavigationBarHidden = true + self.tabBarController?.tabBar.isHidden = false + } + // MARK: - func + private func setupBackButton() { + let action = UIAction { [weak self] _ in + self?.navigationController?.popViewController(animated: true) + } + backButton.addAction(action, for: .touchUpInside) + } + private func setupEditButton() { let action = UIAction { _ in // FIXME: - 방 정보 수정 view 연결 From f21d50ea0387efdca172f4868c28d7b6c351b581 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 25 Jan 2023 18:45:03 +0900 Subject: [PATCH 043/388] =?UTF-8?q?[CHORE]=20PR=20Template=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#284)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 069974e5..36cd8738 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,6 +2,10 @@ +## 📱 Screenshot + + + ## 👩‍💻 Contents @@ -10,10 +14,6 @@ -## 📱 Screenshot - - - ## 📝 Review Note From 9c4e9a7fab0de8a1d5d08c25d1a991b3700b4165 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Wed, 25 Jan 2023 19:12:07 +0900 Subject: [PATCH 044/388] =?UTF-8?q?[CHORE]=20=ED=85=8C=EC=9D=B4=EB=B8=94?= =?UTF-8?q?=EB=B7=B0=20=EC=97=B0=EA=B2=B0(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/ParticipatingTeamCell.swift | 27 +++++++++++++++++++ .../Home/Home/TeamManageViewController.swift | 7 ++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift index 3a0009f1..2b5a6951 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift @@ -11,12 +11,39 @@ import SnapKit final class ParticipatingTeamCell: BaseTableViewCell { + // MARK: - property + private let titleLable: UILabel = { + let label = UILabel() + label.text = "참여 중인 팀" + label.font = .label2 + return label + }() + let listTableView = UITableView() + // MARK: - life cycle + override func render() { + self.addSubview(titleLable) + titleLable.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.equalTo(SizeLiteral.leadingTrailingPadding) + } + + self.addSubview(listTableView) + listTableView.snp.makeConstraints { + $0.top.equalTo(titleLable.snp.bottom).offset(10) + $0.width.equalToSuperview() + $0.height.equalToSuperview() + } } override func configUI() { backgroundColor = .white100 } + + // MARK: - func + private func setupTableViewCell() { + listTableView.register(UITableViewCell.self, forCellReuseIdentifier: UITableViewCell.className) + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index bbb6126d..9765e78c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -27,9 +27,8 @@ final class TeamManageViewController: BaseViewController { override func render() { view.addSubview(manageTableView) manageTableView.snp.makeConstraints { - $0.top.equalTo(self.view.safeAreaLayoutGuide).inset(26) - $0.horizontalEdges.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.height.equalToSuperview() + $0.top.equalTo(self.view.safeAreaLayoutGuide).inset(38) + $0.width.height.equalToSuperview() } } @@ -57,6 +56,8 @@ extension TeamManageViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if indexPath.row == 0 { guard let cell = tableView.dequeueReusableCell(withIdentifier: ParticipatingTeamCell.className, for: indexPath) as? ParticipatingTeamCell else { return UITableViewCell() } + cell.listTableView.delegate = self + cell.listTableView.dataSource = self return cell } else { From b7deb5db7165aa5d5d84ead8ac6b20419081548c Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 26 Jan 2023 00:13:57 +0900 Subject: [PATCH 045/388] =?UTF-8?q?[CHORE]=20url=20=EC=A3=BC=EC=86=8C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95(#286)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift index 244a9162..d56bc4aa 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift @@ -8,5 +8,5 @@ import Foundation enum UrlLiteral { - static let baseUrl = "http://15.165.21.115:3000/api/v1" + static let baseUrl = "http://15.165.21.115:3001/api/v1" } From 8e94902770060a73563fd36c5a377ca1159e5fd0 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 26 Jan 2023 14:18:59 +0900 Subject: [PATCH 046/388] [CHORE] removed toast popup (#277) --- .../Screen/Home/Home/HomeViewController.swift | 47 +------------------ 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 40d8123c..fa42010a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -36,17 +36,6 @@ final class HomeViewController: BaseViewController { // MARK: - property - private let toastView: UIView = { - let view = UIView() - view.layer.cornerRadius = 10 - view.clipsToBounds = true - return view - }() - private let toastContentView: ToastContentView = { - let view = ToastContentView() - view.toastType = .warning - return view - }() private lazy var flowLayout: KeywordCollectionViewFlowLayout = { let layout = KeywordCollectionViewFlowLayout() layout.count = keywordList.count @@ -129,22 +118,9 @@ final class HomeViewController: BaseViewController { override func configUI() { navigationController?.isNavigationBarHidden = true view.backgroundColor = .white200 - setupGradientToastView() } override func render() { - view.addSubview(toastView) - toastView.snp.makeConstraints { - $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.top).offset(-60) - $0.centerX.equalToSuperview() - $0.height.equalTo(46) - } - - toastView.addSubview(toastContentView) - toastContentView.snp.makeConstraints { - $0.edges.equalToSuperview() - } - toastContentView.render() view.addSubview(teamButton) teamButton.snp.makeConstraints { @@ -213,7 +189,8 @@ final class HomeViewController: BaseViewController { case .SettingRequired, .Done: self?.presentCreateReflectionViewController() case .Before: - self?.popToastView() + // FIXME: edit reflection VC + print("fixme") case .Progressing: self?.presentSelectReflectionMemberViewController() } @@ -222,11 +199,6 @@ final class HomeViewController: BaseViewController { joinReflectionButton.joinButton.addAction(action, for: .touchUpInside) } - private func setupGradientToastView() { - toastView.layoutIfNeeded() - toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) - } - private func presentAddFeedbackViewController() { let viewController = UINavigationController(rootViewController: AddFeedbackDetailViewController(feedbackContent: FeedbackContent(toNickName: nil, toUserId: nil, feedbackType: nil, reflectionId: currentReflectionId))) viewController.modalPresentationStyle = .fullScreen @@ -256,21 +228,6 @@ final class HomeViewController: BaseViewController { UserDefaultHandler.clearUserDefaults(of: .completedCurrentReflection) } - private func popToastView() { - if !isTouched { - isTouched = true - UIView.animate(withDuration: 0.5, delay: 0, animations: { - self.toastView.transform = CGAffineTransform(translationX: 0, y: 115) - }, completion: {_ in - UIView.animate(withDuration: 1, delay: 0.8, animations: { - self.toastView.transform = .identity - }, completion: {_ in - self.isTouched = false - }) - }) - } - } - private func showAddFeedbackButton() { addFeedbackButton.isHidden = false keywordCollectionView.snp.remakeConstraints { From 744cac55b432bab33c626d6367f9bff2e6de4ee6 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 26 Jan 2023 17:06:26 +0900 Subject: [PATCH 047/388] =?UTF-8?q?[CHORE]=20fixme=20=EC=A0=9C=EA=B1=B0=20?= =?UTF-8?q?(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 39c518d9..2af1dc6c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -70,7 +70,6 @@ final class HomeViewController: BaseViewController { button.setPreferredSymbolConfiguration(UIImage.SymbolConfiguration(pointSize: 20), forImageIn: .normal) button.tintColor = .gray600 let action = UIAction { [weak self] _ in - // FIXME: 버튼 눌렀을 때 action 추가 self?.pushTeamDetailViewController() } button.addAction(action, for: .touchUpInside) From c9d1e7a7da7973a4050ad27cbc933cb641f832b6 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 26 Jan 2023 17:39:47 +0900 Subject: [PATCH 048/388] =?UTF-8?q?[ADD]=20=EB=A9=A4=EB=B2=84=20=ED=83=80?= =?UTF-8?q?=EC=9D=B4=ED=8B=80=20label=20=EC=B6=94=EA=B0=80=20(#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index c926cc86..2e34dd2d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -30,6 +30,13 @@ final class TeamDetailViewController: BaseViewController { button.setUnderline() return button }() + private let memberTitleLabel: UILabel = { + let label = UILabel() + label.text = "멤버" + label.textColor = .black100 + label.font = .label2 + return label + }() // MARK: - life cycle @@ -58,6 +65,12 @@ final class TeamDetailViewController: BaseViewController { $0.centerY.equalTo(titleLabel.snp.centerY) $0.width.height.equalTo(44) } + + view.addSubview(memberTitleLabel) + memberTitleLabel.snp.makeConstraints { + $0.top.equalTo(titleLabel.snp.bottom).offset(SizeLiteral.topComponentPadding) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } } override func setupNavigationBar() { From 3bdd31a062c8af22019cc18d701b901e6512ec97 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 26 Jan 2023 17:47:06 +0900 Subject: [PATCH 049/388] =?UTF-8?q?[ADD]=20=EB=82=B4=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20imageView=20=EC=B6=94=EA=B0=80=20(#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 2e34dd2d..f264800a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -37,6 +37,12 @@ final class TeamDetailViewController: BaseViewController { label.font = .label2 return label }() + private let profileImageView: UIImageView = { + let imageView = UIImageView() + imageView.layer.cornerRadius = 23 + imageView.image = ImageLiterals.imgPersonTab + return imageView + }() // MARK: - life cycle @@ -71,6 +77,13 @@ final class TeamDetailViewController: BaseViewController { $0.top.equalTo(titleLabel.snp.bottom).offset(SizeLiteral.topComponentPadding) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + + view.addSubview(profileImageView) + profileImageView.snp.makeConstraints { + $0.top.equalTo(memberTitleLabel.snp.bottom).offset(20) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.width.height.equalTo(46) + } } override func setupNavigationBar() { From 51fa181047e3ccc483824311f2cc9d9a2e752d7f Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 26 Jan 2023 17:52:33 +0900 Subject: [PATCH 050/388] =?UTF-8?q?[ADD]=20=EB=82=B4=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EB=8B=89=EB=84=A4=EC=9E=84=20label=20=EC=B6=94=EA=B0=80=20(?= =?UTF-8?q?#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index f264800a..f985c34e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -43,6 +43,13 @@ final class TeamDetailViewController: BaseViewController { imageView.image = ImageLiterals.imgPersonTab return imageView }() + private let profileNicknameLabel: UILabel = { + let label = UILabel() + label.text = "이두" + label.font = .label2 + label.textColor = .gray600 + return label + }() // MARK: - life cycle @@ -84,6 +91,12 @@ final class TeamDetailViewController: BaseViewController { $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) $0.width.height.equalTo(46) } + + view.addSubview(profileNicknameLabel) + profileNicknameLabel.snp.makeConstraints { + $0.leading.equalTo(profileImageView.snp.trailing).offset(12) + $0.bottom.equalTo(profileImageView.snp.centerY) + } } override func setupNavigationBar() { From 778d256599d03145504389234a51fcb31a636273 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 26 Jan 2023 17:59:49 +0900 Subject: [PATCH 051/388] =?UTF-8?q?[ADD]=20=EB=82=B4=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EC=97=AD=ED=95=A0=20label=20=EC=B6=94=EA=B0=80=20(#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index f985c34e..dde0a37c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -45,11 +45,19 @@ final class TeamDetailViewController: BaseViewController { }() private let profileNicknameLabel: UILabel = { let label = UILabel() + // FIXME: - API 연결 후 삭제 label.text = "이두" label.font = .label2 label.textColor = .gray600 return label }() + private let profileRoleLabel: UILabel = { + let label = UILabel() + label.text = "디자인 리드 / 개발자" + label.font = .caption2 + label.textColor = .gray400 + return label + }() // MARK: - life cycle @@ -97,6 +105,12 @@ final class TeamDetailViewController: BaseViewController { $0.leading.equalTo(profileImageView.snp.trailing).offset(12) $0.bottom.equalTo(profileImageView.snp.centerY) } + + view.addSubview(profileRoleLabel) + profileRoleLabel.snp.makeConstraints { + $0.leading.equalTo(profileImageView.snp.trailing).offset(12) + $0.top.equalTo(profileNicknameLabel.snp.bottom).offset(4) + } } override func setupNavigationBar() { From 151dcc5b350c1ead3f1d81c3ba8d06c2963c115d Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 26 Jan 2023 18:04:32 +0900 Subject: [PATCH 052/388] =?UTF-8?q?[ADD]=20=EB=82=B4=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20divider=20=EC=B6=94=EA=B0=80=20(#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index dde0a37c..8d074456 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -58,6 +58,12 @@ final class TeamDetailViewController: BaseViewController { label.textColor = .gray400 return label }() + private let dividerView: UIView = { + let view = UIView() + view.layer.borderWidth = 0.5 + view.layer.borderColor = UIColor.gray300.cgColor + return view + }() // MARK: - life cycle @@ -111,6 +117,13 @@ final class TeamDetailViewController: BaseViewController { $0.leading.equalTo(profileImageView.snp.trailing).offset(12) $0.top.equalTo(profileNicknameLabel.snp.bottom).offset(4) } + + view.addSubview(dividerView) + dividerView.snp.makeConstraints { + $0.top.equalTo(profileImageView.snp.bottom).offset(25) + $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.height.equalTo(1) + } } override func setupNavigationBar() { From 1918b4cd7d0e1a1a13027767cca2d210342e26f3 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 26 Jan 2023 18:24:14 +0900 Subject: [PATCH 053/388] =?UTF-8?q?[CHORE]=20fixme=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?(#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 8d074456..54182440 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -53,6 +53,7 @@ final class TeamDetailViewController: BaseViewController { }() private let profileRoleLabel: UILabel = { let label = UILabel() + // FIXME: - API 연결 후 삭제 label.text = "디자인 리드 / 개발자" label.font = .caption2 label.textColor = .gray400 From 761841970d7e559aa818155b44cec1003d4bbae9 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 26 Jan 2023 22:54:59 +0900 Subject: [PATCH 054/388] =?UTF-8?q?[ADD]=20=ED=95=B8=EB=93=9C=ED=8F=B0=20?= =?UTF-8?q?=EB=B9=8C=EB=93=9C=20=ED=99=95=EC=9D=B8(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index a740c5d7..58b54306 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -367,7 +367,6 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate & UINavigat if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { self.profileImageButton.profileImage.image = image - print(info) } } } From e8cdc5f8a52a9253de6c35d34eced9543c6b27f6 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 26 Jan 2023 23:43:12 +0900 Subject: [PATCH 055/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 42 ++++++++----------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 595592c8..344c5815 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -14,9 +14,11 @@ final class SetNicknameViewController: BaseViewController { // FIXME: - 합류한 팀 이름 받아오기 var teamName = "맛쟁이사과처럼세글자" - private let minLength: Int = 0 - private let nicknameMaxLength: Int = 6 - private let roleMaxLength: Int = 20 + private enum TextLength { + static let totalMin: Int = 0 + static let nicknameMax: Int = 6 + static let roleMax: Int = 20 + } // MARK: - property @@ -67,7 +69,7 @@ final class SetNicknameViewController: BaseViewController { }() private lazy var nicknameTextLimitLabel: UILabel = { let label = UILabel() - label.setTextWithLineHeight(text: "\(minLength)/\(nicknameMaxLength)", lineHeight: 22) + label.setTextWithLineHeight(text: "\(TextLength.totalMin)/\(TextLength.nicknameMax)", lineHeight: 22) label.font = .body2 label.textColor = .gray500 return label @@ -86,7 +88,7 @@ final class SetNicknameViewController: BaseViewController { }() private lazy var roleTextLimitLabel: UILabel = { let label = UILabel() - label.setTextWithLineHeight(text: "\(minLength)/\(roleMaxLength)", lineHeight: 22) + label.setTextWithLineHeight(text: "\(TextLength.totalMin)/\(TextLength.roleMax)", lineHeight: 22) label.font = .body2 label.textColor = .gray500 return label @@ -123,7 +125,6 @@ final class SetNicknameViewController: BaseViewController { titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.height.equalTo(66.5) } view.addSubview(profileImageButton) @@ -217,18 +218,15 @@ final class SetNicknameViewController: BaseViewController { } private func setCounter(textField: UITextField, count: Int) { - let maxLength = textField == nicknameTextField ? nicknameMaxLength : roleMaxLength + let maxLength = textField == nicknameTextField ? TextLength.nicknameMax : TextLength.roleMax let textLimitLabel = textField == nicknameTextField ? nicknameTextLimitLabel : roleTextLimitLabel if count <= maxLength { textLimitLabel.text = "\(count)/\(maxLength)" } - else { - textLimitLabel.text = "\(maxLength)/\(maxLength)" - } } private func checkMaxLength(textField: UITextField) { - let maxLength = textField == nicknameTextField ? nicknameMaxLength : roleMaxLength + let maxLength = textField == nicknameTextField ? TextLength.nicknameMax : TextLength.roleMax if let text = textField.text { if text.count > maxLength { let endIndex = text.index(text.startIndex, offsetBy: maxLength) @@ -244,35 +242,29 @@ final class SetNicknameViewController: BaseViewController { private func didTappedTextField() { titleLabel.snp.updateConstraints { - $0.height.equalTo(0) - } - profileImageButton.snp.updateConstraints { - $0.top.equalTo(self.titleLabel.snp.bottom).offset(-4) + $0.top.equalTo(view.safeAreaLayoutGuide).inset(-100) } navigationItem.titleView?.isHidden = false - UIView.animate(withDuration: 0.3, delay: 0, options: .allowAnimatedContent, animations: { + UIView.animate(withDuration: 0.3, delay: 0, options: .curveEaseOut, animations: { self.view.layoutIfNeeded() }, completion: nil) } private func didTappedBackground() { titleLabel.snp.updateConstraints { - $0.height.equalTo(66.5) - } - profileImageButton.snp.updateConstraints { - $0.top.equalTo(titleLabel.snp.bottom).offset(44) + $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) } navigationItem.titleView?.isHidden = true - UIView.animate(withDuration: 0.3, delay: 0, options: .allowAnimatedContent, animations: { + UIView.animate(withDuration: 0.3, delay: 0, options: .curveEaseOut, animations: { self.view.layoutIfNeeded() }, completion: nil) } // MARK: - selector - @objc private func keyboardWillShow(notification:NSNotification) { + @objc private func keyboardWillShow(notification: NSNotification) { if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue { UIView.animate(withDuration: 0.2, animations: { self.doneButton.transform = CGAffineTransform(translationX: 0, y: -keyboardSize.height + 24) @@ -282,7 +274,7 @@ final class SetNicknameViewController: BaseViewController { didTappedTextField() } - @objc private func keyboardWillHide(notification:NSNotification) { + @objc private func keyboardWillHide(notification: NSNotification) { UIView.animate(withDuration: 0.2, animations: { self.doneButton.transform = .identity }) @@ -290,8 +282,8 @@ final class SetNicknameViewController: BaseViewController { didTappedBackground() } } - -// MARK: - Extension + +// MARK: - extension extension SetNicknameViewController: UITextFieldDelegate { func textFieldDidChangeSelection(_ textField: UITextField) { From 0ec7f8e45fc3cfec3698a1fe515525dc1052b90d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 26 Jan 2023 23:52:24 +0900 Subject: [PATCH 056/388] =?UTF-8?q?[CHORE]=20scene=20delegate=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20&=20=EB=A8=B8=EC=A7=80=20conflict=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Supports/SceneDelegate.swift | 2 +- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift index 141f3f14..2aa4fc54 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift @@ -23,7 +23,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if isLogined { rootViewController = CustomTabBarController() } else { - rootViewController = UINavigationController(rootViewController: SetNicknameViewController()) + rootViewController = UINavigationController(rootViewController: LoginViewController()) } window?.rootViewController = rootViewController window?.makeKeyAndVisible() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 744a2fd2..35c67fa7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -15,6 +15,10 @@ final class SetNicknameViewController: BaseViewController { // FIXME: - 합류한 팀 이름 받아오기 var teamName = "맛쟁이사과처럼세글자" private enum TextLength { + static let totalMin: Int = 0 + static let nicknameMax: Int = 6 + static let roleMax: Int = 20 + } let cameraPicker = UIImagePickerController() // MARK: - property From 8cb5298522ac6915ab88a1deb55e1fe4a4afb913 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 27 Jan 2023 00:19:27 +0900 Subject: [PATCH 057/388] =?UTF-8?q?[ADD]=20image=20content=20mode=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Setup/SetNickname/UIComponent/ProfileImageButton.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift index ea720139..eaf8410e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift @@ -16,6 +16,7 @@ final class ProfileImageButton: UIButton { var profileImage: UIImageView = { let imageView = UIImageView() imageView.image = ImageLiterals.imgProfileNone + imageView.contentMode = .scaleAspectFill imageView.clipsToBounds = true imageView.layer.cornerRadius = 34 return imageView From d92f7912e6be2c45e8abc2f6422491fbdceff49f Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sat, 28 Jan 2023 15:20:42 +0900 Subject: [PATCH 058/388] [CHORE] blurview not showing bugfix --- .../Screen/Home/Home/HomeViewController.swift | 12 ++---------- .../SelectReflectionMemberViewController.swift | 6 +----- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 40d7b297..21710a48 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -30,11 +30,6 @@ final class HomeViewController: BaseViewController { var reflectionStatus: ReflectionStatus = .Before var hasKeyword: Bool = false var isAdmin: Bool = false - var hasSeenReflectionAlert: Bool = UserDefaultStorage.hasSeenReflectionAlert { - willSet { - UserDefaultHandler.setHasSeenAlert(to: newValue) - } - } // MARK: - property @@ -132,9 +127,6 @@ final class HomeViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - if reflectionStatus == .Progressing && !hasSeenReflectionAlert { - showStartReflectionView() - } fetchCertainTeamDetail(type: .fetchCertainTeamDetail) fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) } @@ -257,7 +249,7 @@ final class HomeViewController: BaseViewController { let viewController = StartReflectionViewController(reflectionId: currentReflectionId, navigationViewController: navigationController, isAdmin: self.isAdmin) viewController.modalPresentationStyle = .overFullScreen present(viewController, animated: true) - hasSeenReflectionAlert = true + UserDefaultHandler.setHasSeenAlert(to: true) UserDefaultHandler.clearUserDefaults(of: .seenKeywordIdList) UserDefaultHandler.clearUserDefaults(of: .seenMemberIdList) UserDefaultHandler.clearUserDefaults(of: .completedCurrentReflection) @@ -353,7 +345,7 @@ final class HomeViewController: BaseViewController { case .Progressing: self.hidePlanLabelButton() self.hideAddFeedbackButton() - if !self.hasSeenReflectionAlert { + if !UserDefaultStorage.hasSeenReflectionAlert { self.showStartReflectionView() } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index 7246c0b1..92d219a5 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -62,7 +62,7 @@ final class SelectReflectionMemberViewController: BaseViewController { } else { self?.dismiss(animated: true) } - self?.resetHasSeenAlert() + UserDefaultHandler.setHasSeenAlert(to: false) } button.addAction(action, for: .touchUpInside) button.isDisabled = true @@ -122,10 +122,6 @@ final class SelectReflectionMemberViewController: BaseViewController { } } - private func resetHasSeenAlert() { - UserDefaultHandler.setHasSeenAlert(to: false) - } - private func didTappedMember() { memberCollectionView.didTappedMember = { [weak self] member in guard let memberCollectionView = self?.memberCollectionView else { return } From cfdba2853a5204467187f2878b3da4860f1c7336 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sat, 28 Jan 2023 18:03:26 +0900 Subject: [PATCH 059/388] [CHORE] setting title & datepicker initial value (#295) --- .../Global/Extension/String+Extension.swift | 7 ++++++ .../CreateReflectionViewController.swift | 23 ++++++++++++++++++- .../Screen/Home/Home/HomeViewController.swift | 13 +++++++++-- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift index ecdf062d..43f25cdf 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift @@ -19,4 +19,11 @@ extension String { return dateToStringFormatter.string(from: date) } + + func formatStringToDate() -> Date { + let stringToDateFormatter = DateFormatter() + stringToDateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + stringToDateFormatter.locale = Locale(identifier: "ko_KR") + return stringToDateFormatter.date(from: self) ?? Date() + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index b1ecdd82..ecc97abc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -13,12 +13,21 @@ import SnapKit final class CreateReflectionViewController: BaseViewController { var reflectionId: Int + var reflectionTitle: String? + var reflectionDate: Date? init(reflectionId: Int) { self.reflectionId = reflectionId super.init() } + init(reflectionId: Int, reflectionTitle: String?, reflectionDate: String?) { + self.reflectionId = reflectionId + self.reflectionTitle = reflectionTitle + self.reflectionDate = reflectionDate?.formatStringToDate() + super.init() + } + required init?(coder: NSCoder) { nil } // MARK: - property @@ -37,7 +46,13 @@ final class CreateReflectionViewController: BaseViewController { label.textColor = .black100 return label }() - private let reflectionNameView = ReflectionNameView() + private lazy var reflectionNameView: ReflectionNameView = { + let nameView = ReflectionNameView() + if let name = reflectionTitle { + nameView.nameTextField.text = reflectionTitle + } + return nameView + }() private let reflectionDateLabel: UILabel = { let label = UILabel() label.text = TextLiteral.createReflectionViewControllerDateLabel @@ -53,6 +68,9 @@ final class CreateReflectionViewController: BaseViewController { let hideKeyboardAction = UIAction { [weak self] _ in self?.view.endEditing(true) } + if let date = reflectionDate { + picker.date = date + } picker.datePickerMode = .date picker.locale = Locale(identifier: "ko_KR") picker.preferredDatePickerStyle = .compact @@ -71,6 +89,9 @@ final class CreateReflectionViewController: BaseViewController { let hideKeyboardAction = UIAction { [weak self] _ in self?.view.endEditing(true) } + if let time = reflectionDate { + picker.date = time + } picker.datePickerMode = .time picker.locale = Locale(identifier: "ko_KR") picker.preferredDatePickerStyle = .inline diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index fa42010a..bdb31a86 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -26,6 +26,8 @@ final class HomeViewController: BaseViewController { var currentReflectionId: Int = 0 var reflectionStatus: ReflectionStatus = .Before + var reflectionTitle: String = "" + var reflectionDate: String = "" var isAdmin: Bool = false var hasSeenReflectionAlert: Bool = UserDefaultStorage.hasSeenReflectionAlert { @@ -189,8 +191,7 @@ final class HomeViewController: BaseViewController { case .SettingRequired, .Done: self?.presentCreateReflectionViewController() case .Before: - // FIXME: edit reflection VC - print("fixme") + self?.presentEditReflectionViewController() case .Progressing: self?.presentSelectReflectionMemberViewController() } @@ -211,6 +212,12 @@ final class HomeViewController: BaseViewController { present(viewController, animated: true) } + private func presentEditReflectionViewController() { + let viewController = UINavigationController(rootViewController: CreateReflectionViewController(reflectionId: currentReflectionId, reflectionTitle: reflectionTitle, reflectionDate: reflectionDate)) + viewController.modalPresentationStyle = .fullScreen + present(viewController, animated: true) + } + private func presentSelectReflectionMemberViewController() { let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: self.isAdmin)) viewController.modalPresentationStyle = .fullScreen @@ -293,6 +300,8 @@ final class HomeViewController: BaseViewController { self.reflectionStatus = reflectionStatus self.currentReflectionId = reflectionId + self.reflectionTitle = reflectionTitle + self.reflectionDate = reflectionDate self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate) self.setupJoinReflectionButtonAction(status: reflectionStatus) From e6eca950b82a0a1e51a78ec79733181576be15ec Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 29 Jan 2023 02:25:24 +0900 Subject: [PATCH 060/388] [CHORE] detail fixed (#295) --- .../CreateReflectionViewController.swift | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index ecc97abc..6f66e627 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -102,9 +102,13 @@ final class CreateReflectionViewController: BaseViewController { picker.addAction(hideKeyboardAction, for: .editingDidBegin) return picker }() - private let mainButton: MainButton = { + private lazy var mainButton: MainButton = { let button = MainButton() - button.title = TextLiteral.createReflectionViewControllerButtonText + if reflectionTitle == nil { + button.title = TextLiteral.createReflectionViewControllerButtonText + } else { + button.title = "수정하기" + } return button }() @@ -173,13 +177,18 @@ final class CreateReflectionViewController: BaseViewController { let reflectionName = self?.reflectionNameView.nameTextField.text, let reflectionId = self?.reflectionId else { return } - self?.patchReflectionDetail(type: .patchReflectionDetail( - reflectionId: reflectionId, - AddReflectionDTO( - reflection_name: reflectionName, - reflection_date: String(describing: reflectionDate) - ) - )) + if reflectionDate >= Date() { + self?.patchReflectionDetail(type: .patchReflectionDetail( + reflectionId: reflectionId, + AddReflectionDTO( + reflection_name: reflectionName, + reflection_date: String(describing: reflectionDate) + ) + )) + } else { + // FIXME: UX writing 생각 + self?.makeAlert(title: "회고 일시 오류", message: "회고 일시를 미래로 설정해주세요") + } } mainButton.addAction(action, for: .touchUpInside) } From 6a2fbba7e2ceac461b9318fed98d934b6ee2b7a6 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 29 Jan 2023 15:09:37 +0900 Subject: [PATCH 061/388] [CHORE] editReflection UX writing edit (#295) --- .../Maddori.Apple/Global/Literal/TextLiteral.swift | 2 ++ .../CreateReflectionViewController.swift | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 1780d38d..9dbcba12 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -37,6 +37,8 @@ enum TextLiteral { static let createReflectionViewControllerTextFieldPlaceHolder = "예) 1차 스프린트" static let createReflectionViewControllerDateLabel = "회고 일시" static let createReflectionViewControllerButtonText = "추가하기" + static let editReflectionViewControllerTitle = "회고 정보를 수정해주세요" + static let editReflectionViewControllerButtonText = "수정하기" // MARK: - SetNicknameViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 6f66e627..f8a3ddbb 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -40,9 +40,13 @@ final class CreateReflectionViewController: BaseViewController { button.addAction(action, for: .touchUpInside) return button }() - private let titleLabel: UILabel = { + private lazy var titleLabel: UILabel = { let label = UILabel() - label.setTitleFont(text: TextLiteral.createReflectionViewControllerTitle) + if reflectionTitle == nil { + label.setTitleFont(text: TextLiteral.createReflectionViewControllerTitle) + } else { + label.setTitleFont(text: TextLiteral.editReflectionViewControllerTitle) + } label.textColor = .black100 return label }() @@ -107,7 +111,7 @@ final class CreateReflectionViewController: BaseViewController { if reflectionTitle == nil { button.title = TextLiteral.createReflectionViewControllerButtonText } else { - button.title = "수정하기" + button.title = TextLiteral.editReflectionViewControllerButtonText } return button }() From 84882a43d3353a302d90d4e96a270973f6c6e4bd Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Mon, 30 Jan 2023 17:25:54 +0900 Subject: [PATCH 062/388] [CHORE] edited ui for preview (#297) --- .../Global/Literal/TextLiteral.swift | 2 + .../Screen/Home/Home/HomeViewController.swift | 13 +++++- .../UIComponent/JoinReflectionButton.swift | 42 +++++++++++-------- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 1780d38d..72093dd3 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -192,6 +192,8 @@ enum TextLiteral { static let reflectionTitleLabelProgressing: String = "회고가 시작되었습니다!" static let reflectionDescriptionLabelSettingRequired: String = "회고 일정을 정해주세요" static let reflectionDescriptionLabelProgressing: String = "터치하여 회고에 참여해주세요" + static let previewTitleLabel: String = "회고 일정을 추가할 수 없습니다" + static let previewDescriptionLabel: String = "팀을 생성하거나 팀에 합류해주세요" // MARK: - MyReflectionViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index fa42010a..ff4b3388 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -274,6 +274,11 @@ final class HomeViewController: BaseViewController { DispatchQueue.main.async { self.teamButton.setTitle(teamName, for: .normal) } + } else { + DispatchQueue.main.async { + self.teamButton.setTitle("팀 없음", for: .normal) + self.teamButton.tintColor = .gray500 + } } } } @@ -293,7 +298,7 @@ final class HomeViewController: BaseViewController { self.reflectionStatus = reflectionStatus self.currentReflectionId = reflectionId - self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate) + self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate, isPreview: false) self.setupJoinReflectionButtonAction(status: reflectionStatus) self.setupJoinReflectionButtonBackground(status: reflectionStatus) @@ -317,6 +322,11 @@ final class HomeViewController: BaseViewController { self.keywordCollectionView.reloadData() } } + } else { + DispatchQueue.main.async { + self.joinReflectionButton.setupAttribute(reflectionStatus: .Before, title: "", date: "", isPreview: true) + self.setupJoinReflectionButtonBackground(status: .Before) + } } } } @@ -364,4 +374,3 @@ extension HomeViewController: UICollectionViewDelegateFlowLayout { return KeywordCollectionViewCell.fittingSize(availableHeight: size, keyword: keywordList[indexPath.item]) } } - diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift index c8022408..90602b1b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift @@ -103,26 +103,34 @@ final class JoinReflectionButton: UIView { joinButton.addAction(action, for: .touchUpInside) } - func setupAttribute(reflectionStatus: ReflectionStatus, title: String, date: String) { - switch reflectionStatus { - case .SettingRequired, .Done: - reflectionTitleLabel.text = TextLiteral.reflectionTitleLabelSettingRequired + func setupAttribute(reflectionStatus: ReflectionStatus, title: String, date: String, isPreview: Bool) { + if !isPreview { + switch reflectionStatus { + case .SettingRequired, .Done: + reflectionTitleLabel.text = TextLiteral.reflectionTitleLabelSettingRequired + reflectionTitleLabel.textColor = .gray600 + reflectionDescriptionLabel.text = TextLiteral.reflectionDescriptionLabelSettingRequired + reflectionDescriptionLabel.textColor = .gray500 + calendarImageView.image = ImageLiterals.imgEmptyCalendar + case .Before: + reflectionTitleLabel.text = title + reflectionTitleLabel.textColor = .gray600 + reflectionDescriptionLabel.text = date.formatDateString(to: "M월 d일 (EEE) HH:mm") + reflectionDescriptionLabel.textColor = .gray500 + calendarImageView.image = ImageLiterals.imgCalendar + case .Progressing: + reflectionTitleLabel.text = TextLiteral.reflectionTitleLabelProgressing + reflectionTitleLabel.textColor = .white100 + reflectionDescriptionLabel.text = TextLiteral.reflectionDescriptionLabelProgressing + reflectionDescriptionLabel.textColor = .white100 + calendarImageView.image = ImageLiterals.imgYellowCalendar + } + } else { + reflectionTitleLabel.text = TextLiteral.previewTitleLabel reflectionTitleLabel.textColor = .gray600 - reflectionDescriptionLabel.text = TextLiteral.reflectionDescriptionLabelSettingRequired + reflectionDescriptionLabel.text = TextLiteral.previewDescriptionLabel reflectionDescriptionLabel.textColor = .gray500 calendarImageView.image = ImageLiterals.imgEmptyCalendar - case .Before: - reflectionTitleLabel.text = title - reflectionTitleLabel.textColor = .gray600 - reflectionDescriptionLabel.text = date.formatDateString(to: "M월 d일 (EEE) HH:mm") - reflectionDescriptionLabel.textColor = .gray500 - calendarImageView.image = ImageLiterals.imgCalendar - case .Progressing: - reflectionTitleLabel.text = TextLiteral.reflectionTitleLabelProgressing - reflectionTitleLabel.textColor = .white100 - reflectionDescriptionLabel.text = TextLiteral.reflectionDescriptionLabelProgressing - reflectionDescriptionLabel.textColor = .white100 - calendarImageView.image = ImageLiterals.imgYellowCalendar } } } From f5e327dae6c0813a58ef237ed1c5472e1e812101 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 31 Jan 2023 16:05:23 +0900 Subject: [PATCH 063/388] =?UTF-8?q?[CHORE]=20=EC=9E=90=EC=9E=98=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD=20(#297)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index ff4b3388..b7ab73ba 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -364,7 +364,6 @@ extension HomeViewController: UICollectionViewDataSource { viewController.modalPresentationStyle = .fullScreen navigationController.present(viewController, animated: true) } - } } From 1a649d6249219eb5d4353cf50413c05ba213b08d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 31 Jan 2023 17:03:28 +0900 Subject: [PATCH 064/388] =?UTF-8?q?[ADD]=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Setup/SetNickname/UIComponent/ProfileImageButton.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift index a05c1877..b5009b57 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/UIComponent/ProfileImageButton.swift @@ -13,7 +13,7 @@ final class ProfileImageButton: UIButton { // MARK: - property - var profileImage = UIImageView(image: ImageLiterals.imgProfileNone) + let profileImage = UIImageView(image: ImageLiterals.imgProfileNone) private let profilePlus: UIImageView = { let imageView = UIImageView() imageView.image = ImageLiterals.icPlus From 9a945fd344d8845a8816d69dac2b6f57188ff2f2 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 1 Feb 2023 13:36:41 +0900 Subject: [PATCH 065/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=E3=85=87=20(#277)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 2 +- .../Global/Literal/TextLiteral.swift | 2 +- .../Screen/Home/Home/HomeViewController.swift | 1 - .../Home/UIComponent/JoinReflectionButton.swift | 17 ++--------------- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 14f0f655..edef3f53 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1318,7 +1318,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = "HF8GHZB58X"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 1780d38d..c161265a 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -188,7 +188,7 @@ enum TextLiteral { // MARK: - JoinReflectionButton - static let reflectionTitleLabelSettingRequired: String = "아직 회고 일정이 정해지지 않았습니다" + static let reflectionTitleLabelSettingRequired: String = "아직 회고 일정이 없습니다" static let reflectionTitleLabelProgressing: String = "회고가 시작되었습니다!" static let reflectionDescriptionLabelSettingRequired: String = "회고 일정을 정해주세요" static let reflectionDescriptionLabelProgressing: String = "터치하여 회고에 참여해주세요" diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index fa42010a..a0e79839 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -121,7 +121,6 @@ final class HomeViewController: BaseViewController { } override func render() { - view.addSubview(teamButton) teamButton.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift index c8022408..f25cf9dc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift @@ -15,14 +15,6 @@ final class JoinReflectionButton: UIView { // MARK: - property - let shadowView: UIView = { - let view = UIView() - view.layer.shadowColor = UIColor.black100.cgColor - view.layer.shadowOffset = .zero - view.layer.shadowRadius = 2 - view.layer.shadowOpacity = 0.05 - return view - }() let joinButton: UIButton = { let button = UIButton() button.layer.cornerRadius = 10 @@ -59,12 +51,7 @@ final class JoinReflectionButton: UIView { required init?(coder: NSCoder) { nil } func render() { - self.addSubview(shadowView) - shadowView.snp.makeConstraints { - $0.edges.equalToSuperview() - } - - shadowView.addSubview(joinButton) + self.addSubview(joinButton) joinButton.snp.makeConstraints { $0.edges.equalToSuperview() } @@ -93,7 +80,7 @@ final class JoinReflectionButton: UIView { // MARK: - func private func configUI() { - shadowView.makeShadow(color: .black100, opacity: 0.2, offset: .zero, radius: 3) + self.makeShadow(color: .black100, opacity: 0.2, offset: .zero, radius: 3) } private func setupJoinButtonAction() { From 493ef9a9113174c571bcda07f805d6cc70113dcc Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 1 Feb 2023 13:37:39 +0900 Subject: [PATCH 066/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#277)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/JoinReflectionButton.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift index f25cf9dc..c360e61e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/JoinReflectionButton.swift @@ -80,7 +80,7 @@ final class JoinReflectionButton: UIView { // MARK: - func private func configUI() { - self.makeShadow(color: .black100, opacity: 0.2, offset: .zero, radius: 3) + self.makeShadow(color: .black100, opacity: 0.2, offset: .zero, radius: 2) } private func setupJoinButtonAction() { From a4c3a5b0bccff09230af2cd9d4171d70cfd3dc86 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 2 Feb 2023 00:35:31 +0900 Subject: [PATCH 067/388] =?UTF-8?q?[CHORE]=20=ED=8E=B8=EC=A7=91=20?= =?UTF-8?q?=ED=83=80=EC=9D=B4=ED=8B=80=20TextLiteral=EB=A1=9C=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC=20(#282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 4 ++++ .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index f0f2bb83..60dd9827 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -213,4 +213,8 @@ enum TextLiteral { static let DetailTitleLabel: String = "피드백 줄 멤버와 종류를\n선택해주세요" static let toNameTitleLabel: String = "피드백 줄 멤버" + + // MARK: - TeamDetailViewController + + static let teamDetailViewControllerEditButteonText: String = "편집" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index c926cc86..08100ab6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -24,7 +24,7 @@ final class TeamDetailViewController: BaseViewController { }() private let editButton: UIButton = { let button = UIButton() - button.setTitle("편집", for: .normal) + button.setTitle(TextLiteral.teamDetailViewControllerEditButteonText, for: .normal) button.titleLabel?.font = .label2 button.setTitleColor(.gray500, for: .normal) button.setUnderline() From 4e3bc81e5666faa93c9e2614690d7b241aa9b659 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 2 Feb 2023 01:09:17 +0900 Subject: [PATCH 068/388] =?UTF-8?q?[ADD]=20=EA=B8=B0=EB=B3=B8=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/ImageLiteral.swift | 1 + .../DefaultProfile.imageset/Contents.json | 12 ++++++++++++ .../DefaultProfile.imageset/Group 48095761.pdf | Bin 0 -> 3974 bytes .../TeamDetail/TeamDetailViewController.swift | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Contents.json create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Group 48095761.pdf diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift index 1e49df06..b815501f 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift @@ -40,6 +40,7 @@ enum ImageLiterals { static var imgProgress3: UIImage { .load(name: "ProgressBar3") } static var imgProgress4: UIImage { .load(name: "ProgressBar4") } static var imgProgress5: UIImage { .load(name: "ProgressBar5") } + static var imgDefaultProfile: UIImage { .load(name: "DefaultProfile") } } extension UIImage { diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Contents.json b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Contents.json new file mode 100644 index 00000000..a0564b77 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "Group 48095761.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Group 48095761.pdf b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Group 48095761.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2a6477839980a61d86b90d6ef6188c32d9cceafb GIT binary patch literal 3974 zcmeHKOK;pZ5We$Q@Dd<7gv;TZKwu!T6QgK@xONW#f*#gu#c}FgIV-tH`s@3Rq$Ra$ z_XYIUDnLB@i8GwXH{|Ha*~y#dq@oZcwQMgx3n^c`kc*$b-8FLY{@vy0X4M13v-qLe zT=$=(!NT(iI^DMScQb|I_xNtm85J*JZ@b)dcgt{%{q+Rx|HN?{vDqAR zWYw|`HheOKb&zx*T%_ zMc6UMIiwoePH{#}lCa}~apa`&XcBCgStofA2rR9bS5Ct;Gkk`EO2!i?H?s&Yvxdv_ zy}|YzaXhhh@e*wjadyPPizyoJcf^lG*SOJ9)TZh5DD0>ersf!PG6fQTjM z6@#`11#wsn-Mm}rIFk{Pu|@0P5YwG2hNk1aO^P5Iw80s!4$$FLB8LV;3^{2s+~gtH z=#YJo%xiBE7vhG5eqV_Uo-xy;L4s_wDTDLeOD1xYr-)@~26<(Jx6wegu0v&D1(vHd z6cERj1C8poC^dP5zJ=4p!GRRkdGvh=q>`tGJf|5>g(*3ekTr>w&NbZ?W9okt8}XwM z&E{&laUk)nD)`nMuUA6z@qz)yjq&$xUH9LQK>OVh%tQlNoblSToHP^}fH+E`&im<-pws>WlURt#5c@vov) zdhG3d>px*7vub3e%~VKFw#G09MDYvDmV;E@_+j8+N~bSU&I3RyzayTEIw%; zKc=~MV?*FhE@e&yoLB=i<0M042<+_lH&<{~as=mc=kalS4_$iTe+Oh{2_wzi6i3*V z9c$#r%YJ#=UhnIE-8LTu#yS$?xyS#@;5|kR;M2n!@FO=9L_FCaKpBJZK4d&b%R?yP zVB)9P!W473%34e?`>U+QaC889%%}%Yzz4t%>bJ|A+h!{`z2BW6xlg-x-8_>|Z?2w= nDPEknE%M9h8|t;VxcRN&Tp+n!zufjicJLi##giwm-@W-Aa78;p literal 0 HcmV?d00001 diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 54182440..097fa0e8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -40,7 +40,7 @@ final class TeamDetailViewController: BaseViewController { private let profileImageView: UIImageView = { let imageView = UIImageView() imageView.layer.cornerRadius = 23 - imageView.image = ImageLiterals.imgPersonTab + imageView.image = ImageLiterals.imgDefaultProfile return imageView }() private let profileNicknameLabel: UILabel = { From dd6341efb653ec51bc8e2035655a11efe972ab11 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 2 Feb 2023 15:41:39 +0900 Subject: [PATCH 069/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNickname/SetNicknameViewController.swift | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 344c5815..f43b1483 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -113,10 +113,6 @@ final class SetNicknameViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() setupDelegate() - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) setupNotificationCenter() } @@ -290,12 +286,9 @@ extension SetNicknameViewController: UITextFieldDelegate { setCounter(textField: textField, count: textField.text?.count ?? 0) checkMaxLength(textField: textField) - let hasText = textField.hasText - doneButton.isDisabled = !hasText - } - - func textFieldShouldReturn(_ textField: UITextField) -> Bool { - textField.resignFirstResponder() - return true + if textField == nicknameTextField { + let hasText = textField.hasText + doneButton.isDisabled = !hasText + } } } From 4783ddc937a77d316b58b2367ed42695ca8b0a03 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 2 Feb 2023 16:10:50 +0900 Subject: [PATCH 070/388] =?UTF-8?q?[CHORE]=20preserve=20vector=20data=20?= =?UTF-8?q?=EC=B2=B4=ED=81=AC=20(#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets.xcassets/DefaultProfile.imageset/Contents.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Contents.json b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Contents.json index a0564b77..4ade499b 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Contents.json +++ b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/DefaultProfile.imageset/Contents.json @@ -8,5 +8,8 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true } } From ab4a7cbdcea163302a2fc91e256c6973285d333c Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 2 Feb 2023 16:12:48 +0900 Subject: [PATCH 071/388] =?UTF-8?q?[CHORE]=20=EB=A9=A4=EB=B2=84=20TextLite?= =?UTF-8?q?ral=20=EC=B6=94=EA=B0=80=20(#289)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 1 + .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 1fa08c5e..b999e859 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -224,4 +224,5 @@ enum TextLiteral { // MARK: - TeamDetailViewController static let teamDetailViewControllerEditButteonText: String = "편집" + static let teamDetailViewControllerMemberTitleLabel: String = "멤버" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index dd748fb0..dbdf8302 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -32,7 +32,7 @@ final class TeamDetailViewController: BaseViewController { }() private let memberTitleLabel: UILabel = { let label = UILabel() - label.text = "멤버" + label.text = TextLiteral.teamDetailViewControllerMemberTitleLabel label.textColor = .black100 label.font = .label2 return label From 9f2ebe03d60c2d3b1ed98c541c0dd082af12885b Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 2 Feb 2023 16:40:50 +0900 Subject: [PATCH 072/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/ImageLiteral.swift | 2 +- .../Global/Literal/TextLiteral.swift | 2 +- .../plus.imageset/Contents.json | 15 ++++++++ .../Assets.xcassets/plus.imageset/plus.pdf | Bin 0 -> 2045 bytes .../SetNicknameViewController.swift | 34 ++++++++---------- .../UIComponent/ProfileImageButton.swift | 3 +- 6 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/plus.imageset/Contents.json create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/plus.imageset/plus.pdf diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift index e50c175c..6a678574 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift @@ -24,7 +24,7 @@ enum ImageLiterals { static var icPersonCircle: UIImage { .load(systemName: "person.crop.circle") } static var icChevronDown: UIImage { .load(systemName: "chevron.down") } static var icTeamMananage: UIImage { .load(systemName: "person.2.circle") } - static var icPlus: UIImage { .load(systemName: "plus.circle.fill") } + static var icPlus: UIImage { .load(name: "plus") } // MARK: - image diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index abb7cd5c..eb548db3 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -17,6 +17,7 @@ enum TextLiteral { static let feedbackContentLabel = "내용" static let doneButtonNext = "다음" static let doneButtonComplete = "완료" + static let actionSheetCancelTitle = "취소" // MARK: - MainViewController @@ -54,7 +55,6 @@ enum TextLiteral { static let setNicknameControllerProfileActionSheetTitle = "프로필 사진 설정" static let setNicknameControllerProfileActionSheetLibraryTitle = "앨범에서 사진 선택" static let setNicknameControllerProfileActionSheetCameraTitle = "사진 촬영" - static let setNicknameControllerProfileActionSheetCancelTitle = "취소" static let setNicknameControllerCameraErrorAlertTitle = "카메라를 실행할 수 없습니다." static let setNicknameControllerCameraErrorAlertMessage = "설정에서 카메라 접근 권한을 확인해 주세요." static let setNicknameControllerLibraryErrorAlertTitle = "이미지를 불러올 수 없습니다." diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/plus.imageset/Contents.json b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/plus.imageset/Contents.json new file mode 100644 index 00000000..0babeff5 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/plus.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "plus.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/plus.imageset/plus.pdf b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/plus.imageset/plus.pdf new file mode 100644 index 0000000000000000000000000000000000000000..56df3f6c7b542d4ef704691fd1ed2fc7543b427e GIT binary patch literal 2045 zcmb7FOK;RL5Wf3Y%%xI$s1xTMsj5VGDMEl)Qf?K8kac&1HVGstD*SrJi9L469w4X5 z=Xred@c3f4y}uSbWlVq%-Pdmn;N}KyZ<%cO>X!vB?!A}oVLU>JV4<{zv6p4Tysi9M zSF(6>2b%}?uNv47Cb&O+;2YtZr1cpcRSolbkYSLR zBfi9#lgs*ieg$%wWkK+eb)16&oa{n8iN1my&ykM^DRiH`P}`*En9a# zn>&$Wuk{>J`KfY*INi4a7wsoir~QOE!ZdOz5R#jUR5&(z`X~WvzYR*=vXCxivNI!<0)BqQV9+e&?deq$MV!2mZmSgd}2PN zY`#$Q_Kf2&288t|aBEEmxGnV;BF_aRqI?C#0 u9G64a$Sb(4_g8aKyrSzyPzg^3_8#ir64_4=b=i+oIwA`~c5(6g Date: Thu, 2 Feb 2023 18:15:43 +0900 Subject: [PATCH 073/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#277)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index edef3f53..9fd63e41 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1318,7 +1318,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = "HF8GHZB58X"; + DEVELOPMENT_TEAM = HF8GHZB58X; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; From f4d7f0c9d0f2a702b3155f279a0afaa588b81db3 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 2 Feb 2023 18:33:02 +0900 Subject: [PATCH 074/388] =?UTF-8?q?[ADD]=20=EB=A9=A4=EB=B2=84=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20collectionView=20=EA=B8=B0=EB=B3=B8=20?= =?UTF-8?q?=ED=8B=80=20=EC=B6=94=EA=B0=80=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 ++++++ .../TeamDetail/TeamDetailViewController.swift | 9 ++++ .../UIComponent/TeamDetailMembersView.swift | 42 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index fe046a5e..1bf3b789 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -22,6 +22,7 @@ 39257DF328F93D8900201E0B /* TextLiteral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DF228F93D8900201E0B /* TextLiteral.swift */; }; 39257DF528F93E4700201E0B /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DF428F93E4700201E0B /* UIColor+Extension.swift */; }; 39307CF52917DA9300789AB6 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39307CF42917DA9300789AB6 /* LoginViewController.swift */; }; + 39341E0A298BA419006C1727 /* TeamDetailMembersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */; }; 39436C1029127BBA0083D77A /* MyFeedbackCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */; }; 39436C132912877D0083D77A /* MyFeedbackHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C122912877D0083D77A /* MyFeedbackHeaderView.swift */; }; 39436C15291287A00083D77A /* MyFeedbackCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C14291287A00083D77A /* MyFeedbackCollectionViewCell.swift */; }; @@ -161,6 +162,7 @@ 39257DF228F93D8900201E0B /* TextLiteral.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextLiteral.swift; sourceTree = ""; }; 39257DF428F93E4700201E0B /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = ""; }; 39307CF42917DA9300789AB6 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; + 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersView.swift; sourceTree = ""; }; 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionView.swift; sourceTree = ""; }; 39436C122912877D0083D77A /* MyFeedbackHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackHeaderView.swift; sourceTree = ""; }; 39436C14291287A00083D77A /* MyFeedbackCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionViewCell.swift; sourceTree = ""; }; @@ -465,6 +467,14 @@ path = Login; sourceTree = ""; }; + 39341E08298BA3FC006C1727 /* UIComponent */ = { + isa = PBXGroup; + children = ( + 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */, + ); + path = UIComponent; + sourceTree = ""; + }; 39436C162912A2D30083D77A /* Feedback */ = { isa = PBXGroup; children = ( @@ -502,6 +512,7 @@ 3960863F29811D86003AB4F8 /* TeamDetail */ = { isa = PBXGroup; children = ( + 39341E08298BA3FC006C1727 /* UIComponent */, 3960864029811E3C003AB4F8 /* TeamDetailViewController.swift */, ); path = TeamDetail; @@ -1081,6 +1092,7 @@ 3E5580072906A7B200714E46 /* InProgressViewController.swift in Sources */, 39F52C4F29232E8B00B19A77 /* FeedBackContentDTO.swift in Sources */, 39436C132912877D0083D77A /* MyFeedbackHeaderView.swift in Sources */, + 39341E0A298BA419006C1727 /* TeamDetailMembersView.swift in Sources */, 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */, D750511B29423CB6001BDA34 /* SelectKeywordTypeView.swift in Sources */, 39F52C6E2924742E00B19A77 /* ReflectionResponse.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 54182440..96d0e11e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -65,6 +65,7 @@ final class TeamDetailViewController: BaseViewController { view.layer.borderColor = UIColor.gray300.cgColor return view }() + private let memberCollectionView = TeamDetailMembersView() // MARK: - life cycle @@ -125,6 +126,14 @@ final class TeamDetailViewController: BaseViewController { $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) $0.height.equalTo(1) } + + view.addSubview(memberCollectionView) + memberCollectionView.snp.makeConstraints { + $0.top.equalTo(dividerView.snp.bottom).offset(24) + $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + // FIXME: - 아래 뷰 만들고 바텀 레이아웃 수정 + $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom) + } } override func setupNavigationBar() { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift new file mode 100644 index 00000000..acf56477 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -0,0 +1,42 @@ +// +// TeamDetailMemberCollectionView.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/02/02. +// + +import UIKit + +import SnapKit + +final class TeamDetailMembersView: UIView { + + // MARK: - property + + private let memberCollectionView: UICollectionView = { + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout.init()) + return collectionView + }() + + // MARK: - life cycle + + override init(frame: CGRect) { + super.init(frame: frame) + render() + } + + required init?(coder: NSCoder) { nil } + + // MARK: - func + + private func render() { + self.addSubview(memberCollectionView) + memberCollectionView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } +} + +extension TeamDetailMembersView: UICollectionViewDelegateFlowLayout { + +} From ef1c00908bf72e8045ad14c0149f29de22567211 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 2 Feb 2023 18:40:36 +0900 Subject: [PATCH 075/388] =?UTF-8?q?[ADD]=20Login=20>=20JoinTeam=20>=20SetN?= =?UTF-8?q?ickname=20=EC=97=B0=EA=B2=B0(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Literal/TextLiteral.swift | 2 +- .../Network/EndPoint/SetupEndPoint.swift | 4 ++-- .../Setup/JoinTeam/JoinTeamViewController.swift | 11 ++++++----- .../Screen/Setup/Login/LoginViewController.swift | 2 +- .../Setup/SetNickname/SetNicknameViewController.swift | 11 +++++++++-- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 1fa08c5e..2c3f2024 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -86,7 +86,7 @@ enum TextLiteral { // MARK: - JoinTeamViewController - static let joinTeamViewControllerTitleLabel = "님 반가워요!\n이제 팀에 합류해주세요" + static let joinTeamViewControllerTitleLabel = "초대코드를 입력하여\n팀에 합류해주세요" static let joinTeamViewControllerNicknameTextFieldPlaceHolder = "초대코드" static let joinTeamViewControllerSubText = "팀이 없나요?" static let joinTeamViewControllerSubButtonText = "팀 생성하기" diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift index d8fe479b..7ce2eb5d 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift @@ -17,13 +17,13 @@ enum SetupEndPoint: EndPointable { var address: String { switch self { case .dispatchLogin: - return "\(UrlLiteral.baseUrl)/users/login" + return "http://15.165.21.115:3001/api/v2/users/login" case .dispatchCreateTeam: return "\(UrlLiteral.baseUrl)/teams" case .dispatchJoinTeam(let teamId): return "\(UrlLiteral.baseUrl)/users/join-team/\(teamId)" case .fetchCertainTeam(let invitationCode): - return "\(UrlLiteral.baseUrl)/teams?invitation_code=\(invitationCode)" + return "http://15.165.21.115:3001/api/v2/teams?invitation_code=\(invitationCode)" case .dispatchAppleLogin: return "\(UrlLiteral.baseUrl)/login" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index 3d80ecfb..5998dd10 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -14,7 +14,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { override var titleText: String { get { - return UserDefaultStorage.nickname + TextLiteral.joinTeamViewControllerTitleLabel + return TextLiteral.joinTeamViewControllerTitleLabel } set { @@ -124,9 +124,10 @@ final class JoinTeamViewController: BaseTextFieldViewController { rootViewController.modalPresentationStyle = .fullScreen present(rootViewController, animated: true) } - - private func presentCertainTeamViewController(teamName: String, teamId: Int) { - self.showAlertView(type: .join, teamName: teamName) + + private func pushSetNicknameViewController(teamName: String) { + let viewController = SetNicknameViewController(teamName: teamName) + navigationController?.pushViewController(viewController, animated: true) } // MARK: - api @@ -141,7 +142,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { let teamName = json.detail?.teamName else { return } UserDefaultHandler.setTeamId(teamId: teamId) - self.presentCertainTeamViewController(teamName: teamName, teamId: UserDefaultStorage.teamId) + self.pushSetNicknameViewController(teamName: teamName) } else { DispatchQueue.main.async { self.makeAlert(title: TextLiteral.joinTeamViewControllerAlertTitle, message: TextLiteral.joinTeamViewControllerAlertMessage) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift index 0406eb9c..1f0ef1a1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift @@ -153,7 +153,7 @@ final class LoginViewController: BaseViewController { let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate sceneDelegate?.changeRootViewCustomTabBarView() } else { - self?.presentViewController(viewController: SetNicknameViewController()) + self?.presentViewController(viewController: JoinTeamViewController()) } } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index f43b1483..672e5e19 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -12,14 +12,21 @@ import SnapKit final class SetNicknameViewController: BaseViewController { - // FIXME: - 합류한 팀 이름 받아오기 - var teamName = "맛쟁이사과처럼세글자" private enum TextLength { static let totalMin: Int = 0 static let nicknameMax: Int = 6 static let roleMax: Int = 20 } + let teamName: String + + init(teamName: String) { + self.teamName = teamName + super.init() + } + + required init?(coder: NSCoder) { nil } + // MARK: - property private lazy var backButton: BackButton = { From d4bcd8d88077bdcbf3a211fb4e0e9e72a79ec39a Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 3 Feb 2023 16:05:43 +0900 Subject: [PATCH 076/388] =?UTF-8?q?[ADD]=20userjointeam=20api=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/AlertViewController.swift | 3 +- .../Network/EndPoint/SetupEndPoint.swift | 10 ++--- .../Network/Reqeust/DTO/JoinTeamDTO.swift | 4 +- .../Network/Response/JoinTeamResponse.swift | 12 ++++-- .../CreateTeam/CreateTeamViewController.swift | 4 +- .../InvitationCodeViewController.swift | 4 +- .../SetNicknameViewController.swift | 40 ++++++++++++++++--- 7 files changed, 56 insertions(+), 21 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift index cbb98a8c..a45a669b 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift @@ -221,7 +221,8 @@ final class AlertViewController: BaseViewController { case .delete: self.deleteFeedBack(type: .deleteFeedBack(reflectionId: self.reflectionId, feedBackId: self.feedbackId)) case .join: - self.dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId)) + print("join") +// self.dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId)) } self.dismiss(animated: true) { self.navigation?.popViewController(animated: true) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift index 7ce2eb5d..47a551e5 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift @@ -10,7 +10,7 @@ import Alamofire enum SetupEndPoint: EndPointable { case dispatchLogin(T) case dispatchCreateTeam(T) - case dispatchJoinTeam(teamId: Int) + case dispatchJoinTeam(teamId: Int, T) case fetchCertainTeam(invitationCode: String) case dispatchAppleLogin(T) @@ -20,8 +20,8 @@ enum SetupEndPoint: EndPointable { return "http://15.165.21.115:3001/api/v2/users/login" case .dispatchCreateTeam: return "\(UrlLiteral.baseUrl)/teams" - case .dispatchJoinTeam(let teamId): - return "\(UrlLiteral.baseUrl)/users/join-team/\(teamId)" + case .dispatchJoinTeam(let teamId, _): + return "http://15.165.21.115:3001/api/v2/users/join-team/\(teamId)" case .fetchCertainTeam(let invitationCode): return "http://15.165.21.115:3001/api/v2/teams?invitation_code=\(invitationCode)" case .dispatchAppleLogin: @@ -50,8 +50,8 @@ enum SetupEndPoint: EndPointable { return body case .dispatchCreateTeam(let body): return body - case .dispatchJoinTeam: - return nil + case .dispatchJoinTeam(_, let body): + return body case .fetchCertainTeam: return nil case .dispatchAppleLogin(let body): diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift index 13a5ace9..491b51f9 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift @@ -8,5 +8,7 @@ import Foundation struct JoinTeamDTO: Encodable { - let invitation_code: String + let nickname: String + let role: String? + let profile_image: String? } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift index 4ee1d268..aae1942c 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift @@ -9,15 +9,19 @@ import Foundation struct JoinTeamResponse: Decodable { // MARK: - userJoinTeam - let admin: Bool? let id: Int? + let nickname: String? + let role: String? + let profileImagePath: String? let userId: Int? - let teamId: String? + let team: CreateTeamResponse? enum CodingKeys: String, CodingKey { - case admin case id + case nickname + case role + case profileImagePath = "profile_image_path" case userId = "user_id" - case teamId = "team_id" + case team } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index f69e15a8..2222731c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -94,8 +94,8 @@ final class CreateTeamViewController: BaseTextFieldViewController { private func pushInvitationViewController(invitationCode: String) { if let teamName = super.kigoTextField.text { - let viewController = InvitationCodeViewController(teamName: teamName, invitationCode: invitationCode) - self.navigationController?.pushViewController(viewController, animated: true) +// let viewController = InvitationCodeViewController(teamName: teamName, invitationCode: invitationCode) +// self.navigationController?.pushViewController(viewController, animated: true) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift index 33447d9d..a2f690ca 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift @@ -12,12 +12,10 @@ import SnapKit final class InvitationCodeViewController: BaseViewController { - let teamName: String let invitationCode: String private var isTappedCopyButton: Bool = false - init(teamName: String, invitationCode: String) { - self.teamName = teamName + init(invitationCode: String) { self.invitationCode = invitationCode super.init() } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 672e5e19..e09985d0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -105,11 +105,7 @@ final class SetNicknameViewController: BaseViewController { button.title = TextLiteral.setNicknameControllerDoneButtonText button.isDisabled = true let action = UIAction { [weak self] _ in - guard let nickname = self?.nicknameTextField.text else { return } - guard let role = self?.roleTextField.text else { return } - // FIXME: - 수정된 api 연결 (userJoinTeam) - self?.nicknameTextField.resignFirstResponder() - self?.roleTextField.resignFirstResponder() + self?.didTappedDoneButton() } button.addAction(action, for: .touchUpInside) return button @@ -265,6 +261,20 @@ final class SetNicknameViewController: BaseViewController { }, completion: nil) } + private func didTappedDoneButton() { + guard let nickname = nicknameTextField.text else { return } + guard let role = roleTextField.text else { return } + let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) + dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) + nicknameTextField.resignFirstResponder() + roleTextField.resignFirstResponder() + } + + private func pushInvitationCodeViewController(invitationCode: String) { + let viewController = InvitationCodeViewController(invitationCode: invitationCode) + navigationController?.pushViewController(viewController, animated: true) + } + // MARK: - selector @objc private func keyboardWillShow(notification: NSNotification) { @@ -284,6 +294,26 @@ final class SetNicknameViewController: BaseViewController { didTappedBackground() } + + // MARK: - api + + private func dispatchJoinTeam(type: SetupEndPoint) { + AF.request(type.address, + method: type.method, + parameters: type.body, + encoder: JSONParameterEncoder.default, + headers: type.headers + ).responseDecodable(of: BaseModel.self) { json in + if let json = json.value { + dump(json) +// DispatchQueue.main.async { +// if let invitationCode = json.detail?.invitationCode { +// self.pushInvitationCodeViewController(invitationCode: invitationCode) +// } +// } + } + } + } } // MARK: - extension From 3afa9be24fc7e6819dcdff8e0f7d76e2d06d803a Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 3 Feb 2023 17:28:35 +0900 Subject: [PATCH 077/388] =?UTF-8?q?[ADD]=20teamId=20=EC=99=80=20userId=20?= =?UTF-8?q?=EC=97=AC=EB=B6=80=EB=A1=9C=20screen=20=EB=B6=84=EA=B8=B0?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=ED=95=98=EA=B8=B0(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/Storage/UserDefaultHandler.swift | 4 ++++ .../Network/Storage/UserDefaultStorage.swift | 5 +++++ .../Setup/JoinTeam/JoinTeamViewController.swift | 8 +++++--- .../Screen/Setup/Login/LoginViewController.swift | 4 ++-- .../Setup/SetNickname/SetNicknameViewController.swift | 11 ++--------- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Storage/UserDefaultHandler.swift b/Maddori.Apple/Maddori.Apple/Network/Storage/UserDefaultHandler.swift index caf09dbb..9c91aa8b 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Storage/UserDefaultHandler.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Storage/UserDefaultHandler.swift @@ -28,6 +28,10 @@ struct UserDefaultHandler { UserData.setValue(teamId, forKey: .teamId) } + static func setTeamName(teamName: String) { + UserData.setValue(teamName, forKey: .teamName) + } + static func setAccessToken(accessToken: String) { UserData.setValue(accessToken, forKey: .accessToken) } diff --git a/Maddori.Apple/Maddori.Apple/Network/Storage/UserDefaultStorage.swift b/Maddori.Apple/Maddori.Apple/Network/Storage/UserDefaultStorage.swift index 432cf596..9e07b175 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Storage/UserDefaultStorage.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Storage/UserDefaultStorage.swift @@ -12,6 +12,7 @@ enum DataKeys: String, CaseIterable { case userId = "userId" case nickname = "nickname" case teamId = "teamId" + case teamName = "teamName" case accessToken = "accessToken" case refreshToken = "refreshToken" case hasSeenReflectionAlert = "hasSeenReflectionAlert" @@ -37,6 +38,10 @@ struct UserDefaultStorage { return UserData.getValue(forKey: .teamId) ?? 0 } + static var teamName: String { + return UserData.getValue(forKey: .teamName) ?? "" + } + static var accessToken: String { return UserData.getValue(forKey: .accessToken) ?? "" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index 5998dd10..fb45972a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -125,8 +125,8 @@ final class JoinTeamViewController: BaseTextFieldViewController { present(rootViewController, animated: true) } - private func pushSetNicknameViewController(teamName: String) { - let viewController = SetNicknameViewController(teamName: teamName) + private func pushSetNicknameViewController() { + let viewController = SetNicknameViewController() navigationController?.pushViewController(viewController, animated: true) } @@ -138,11 +138,13 @@ final class JoinTeamViewController: BaseTextFieldViewController { headers: type.headers ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { + dump(json) guard let teamId = json.detail?.id, let teamName = json.detail?.teamName else { return } UserDefaultHandler.setTeamId(teamId: teamId) - self.pushSetNicknameViewController(teamName: teamName) + UserDefaultHandler.setTeamName(teamName: teamName) + self.pushSetNicknameViewController() } else { DispatchQueue.main.async { self.makeAlert(title: TextLiteral.joinTeamViewControllerAlertTitle, message: TextLiteral.joinTeamViewControllerAlertMessage) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift index 1f0ef1a1..dbde24dc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift @@ -117,8 +117,8 @@ final class LoginViewController: BaseViewController { let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate sceneDelegate?.changeRootViewCustomTabBarView() self.setLoginUserDefaults() - } else if hasNickname { - self.presentViewController(viewController: JoinTeamViewController()) + } else if hasTeamId { + self.presentViewController(viewController: SetNicknameViewController()) } else { return } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index e09985d0..f6831d60 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -18,15 +18,8 @@ final class SetNicknameViewController: BaseViewController { static let roleMax: Int = 20 } - let teamName: String - - init(teamName: String) { - self.teamName = teamName - super.init() - } - - required init?(coder: NSCoder) { nil } - + let teamName: String = UserDefaultStorage.teamName + // MARK: - property private lazy var backButton: BackButton = { From c8e36a983ee8e1ab0b2ed017e060c9699b49821a Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 4 Feb 2023 17:24:15 +0900 Subject: [PATCH 078/388] =?UTF-8?q?[ADD]=20CreateTeam=20>=20SetNickname=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateTeam/CreateTeamViewController.swift | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index 2222731c..f0097a07 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -84,44 +84,44 @@ final class CreateTeamViewController: BaseTextFieldViewController { private func setupDoneButton() { let action = UIAction { [weak self] _ in - guard let teamName = self?.kigoTextField.text else { return } - self?.dispatchCreateTeam(type: .dispatchCreateTeam(CreateTeamDTO(team_name: teamName))) + if let teamName = self?.kigoTextField.text { + UserDefaultHandler.setTeamName(teamName: teamName) + self?.pushSetNicknameViewController() + } } super.doneButton.addAction(action, for: .touchUpInside) } // MARK: - func - private func pushInvitationViewController(invitationCode: String) { - if let teamName = super.kigoTextField.text { -// let viewController = InvitationCodeViewController(teamName: teamName, invitationCode: invitationCode) -// self.navigationController?.pushViewController(viewController, animated: true) - } + private func pushSetNicknameViewController() { + let viewController = SetNicknameViewController() + self.navigationController?.pushViewController(viewController, animated: true) } // MARK: - api - private func dispatchCreateTeam(type: SetupEndPoint) { - AF.request(type.address, - method: type.method, - parameters: type.body, - encoder: JSONParameterEncoder.default, - headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in - if let json = json.value { - dump(json) - guard let teamId = json.detail?.id else { return } - UserDefaultHandler.setTeamId(teamId: teamId) - DispatchQueue.main.async { - if let invitationCode = json.detail?.invitationCode { - self.pushInvitationViewController(invitationCode: invitationCode) - } - } - } else { - DispatchQueue.main.async { - self.makeAlert(title: TextLiteral.createTeamViewControllerAlertTitle, message: TextLiteral.createTeamViewControllerAlertMessage) - } - } - } - } +// private func dispatchCreateTeam(type: SetupEndPoint) { +// AF.request(type.address, +// method: type.method, +// parameters: type.body, +// encoder: JSONParameterEncoder.default, +// headers: type.headers +// ).responseDecodable(of: BaseModel.self) { json in +// if let json = json.value { +// dump(json) +// guard let teamId = json.detail?.id else { return } +// UserDefaultHandler.setTeamId(teamId: teamId) +// DispatchQueue.main.async { +// if let invitationCode = json.detail?.invitationCode { +// self.pushInvitationViewController(invitationCode: invitationCode) +// } +// } +// } else { +// DispatchQueue.main.async { +// self.makeAlert(title: TextLiteral.createTeamViewControllerAlertTitle, message: TextLiteral.createTeamViewControllerAlertMessage) +// } +// } +// } +// } } From 7a42d97d471f71aba10539a07070a8ccf738854e Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 4 Feb 2023 22:11:10 +0900 Subject: [PATCH 079/388] =?UTF-8?q?[ADD]=20=ED=8A=B9=EC=88=98=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=20=EA=B2=80=EC=82=AC=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Extension/String+Extension.swift | 12 ++++ .../CreateTeam/CreateTeamViewController.swift | 62 ++++++++++--------- 2 files changed, 46 insertions(+), 28 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift index ecdf062d..f2c54714 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift @@ -19,4 +19,16 @@ extension String { return dateToStringFormatter.string(from: date) } + + func hasSpecialCharacters() -> Bool { + if let regex = try? NSRegularExpression(pattern: "[0-9a-zA-Zㄱ-ㅎㅏ-ㅣ가-힣\\s]", options: .caseInsensitive) { + let numOfString = regex.numberOfMatches(in: self, options: [], range: NSMakeRange(0, self.count)) + if numOfString == self.count { + return false + } else { + return true + } + } + return false + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index f0097a07..4cbb700f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -85,43 +85,49 @@ final class CreateTeamViewController: BaseTextFieldViewController { private func setupDoneButton() { let action = UIAction { [weak self] _ in if let teamName = self?.kigoTextField.text { - UserDefaultHandler.setTeamName(teamName: teamName) - self?.pushSetNicknameViewController() + if teamName.hasSpecialCharacters() { + DispatchQueue.main.async { + self?.makeAlert(title: TextLiteral.createTeamViewControllerAlertTitle, message: TextLiteral.createTeamViewControllerAlertMessage) + } + } else { + UserDefaultHandler.setTeamName(teamName: teamName) + self?.pushSetNicknameViewController() + } } } super.doneButton.addAction(action, for: .touchUpInside) } // MARK: - func - + private func pushSetNicknameViewController() { let viewController = SetNicknameViewController() - self.navigationController?.pushViewController(viewController, animated: true) + navigationController?.pushViewController(viewController, animated: true) } // MARK: - api - -// private func dispatchCreateTeam(type: SetupEndPoint) { -// AF.request(type.address, -// method: type.method, -// parameters: type.body, -// encoder: JSONParameterEncoder.default, -// headers: type.headers -// ).responseDecodable(of: BaseModel.self) { json in -// if let json = json.value { -// dump(json) -// guard let teamId = json.detail?.id else { return } -// UserDefaultHandler.setTeamId(teamId: teamId) -// DispatchQueue.main.async { -// if let invitationCode = json.detail?.invitationCode { -// self.pushInvitationViewController(invitationCode: invitationCode) -// } -// } -// } else { -// DispatchQueue.main.async { -// self.makeAlert(title: TextLiteral.createTeamViewControllerAlertTitle, message: TextLiteral.createTeamViewControllerAlertMessage) -// } -// } -// } -// } + + // private func dispatchCreateTeam(type: SetupEndPoint) { + // AF.request(type.address, + // method: type.method, + // parameters: type.body, + // encoder: JSONParameterEncoder.default, + // headers: type.headers + // ).responseDecodable(of: BaseModel.self) { json in + // if let json = json.value { + // dump(json) + // guard let teamId = json.detail?.id else { return } + // UserDefaultHandler.setTeamId(teamId: teamId) + // DispatchQueue.main.async { + // if let invitationCode = json.detail?.invitationCode { + // self.pushInvitationViewController(invitationCode: invitationCode) + // } + // } + // } else { + // DispatchQueue.main.async { + // self.makeAlert(title: TextLiteral.createTeamViewControllerAlertTitle, message: TextLiteral.createTeamViewControllerAlertMessage) + // } + // } + // } + // } } From 9e9cb1baaca8162a5548d4c0b5d9f852eef2eed8 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 4 Feb 2023 22:20:10 +0900 Subject: [PATCH 080/388] =?UTF-8?q?[ADD]=20team=20=ED=95=A9=EB=A5=98=20?= =?UTF-8?q?=EC=97=AC=EB=B6=80=EC=97=90=20=EB=94=B0=EB=9D=BC=20=EB=B6=84?= =?UTF-8?q?=EA=B8=B0=EC=B2=98=EB=A6=AC(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index f6831d60..40511e4d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -19,7 +19,7 @@ final class SetNicknameViewController: BaseViewController { } let teamName: String = UserDefaultStorage.teamName - + // MARK: - property private lazy var backButton: BackButton = { @@ -257,8 +257,15 @@ final class SetNicknameViewController: BaseViewController { private func didTappedDoneButton() { guard let nickname = nicknameTextField.text else { return } guard let role = roleTextField.text else { return } - let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) - dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) + + if UserDefaultStorage.teamId == 0 { + // FIXME: - CreateTeam api 연결 + print("CreateTeam") + } else { + let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) + dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) + } + nicknameTextField.resignFirstResponder() roleTextField.resignFirstResponder() } @@ -299,11 +306,11 @@ final class SetNicknameViewController: BaseViewController { ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) -// DispatchQueue.main.async { -// if let invitationCode = json.detail?.invitationCode { -// self.pushInvitationCodeViewController(invitationCode: invitationCode) -// } -// } + // DispatchQueue.main.async { + // if let invitationCode = json.detail?.invitationCode { + // self.pushInvitationCodeViewController(invitationCode: invitationCode) + // } + // } } } } From 1acbcc76205f94453162fc5ff497f802e38bac86 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 4 Feb 2023 22:32:17 +0900 Subject: [PATCH 081/388] =?UTF-8?q?[CHORE]=20v2=20url=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20&=20end=20point,=20response=20=EC=A0=95=EB=A6=AC(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/UrlLiteral.swift | 1 + .../Network/EndPoint/SetupEndPoint.swift | 21 ++++--------------- .../Network/Response/MemberResponse.swift | 11 ---------- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift index d56bc4aa..e6d933ec 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift @@ -9,4 +9,5 @@ import Foundation enum UrlLiteral { static let baseUrl = "http://15.165.21.115:3001/api/v1" + static let baseUrl2 = "http://15.165.21.115:3001/api/v2" } diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift index 47a551e5..19ae77e7 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift @@ -8,7 +8,6 @@ import Alamofire enum SetupEndPoint: EndPointable { - case dispatchLogin(T) case dispatchCreateTeam(T) case dispatchJoinTeam(teamId: Int, T) case fetchCertainTeam(invitationCode: String) @@ -16,23 +15,19 @@ enum SetupEndPoint: EndPointable { var address: String { switch self { - case .dispatchLogin: - return "http://15.165.21.115:3001/api/v2/users/login" case .dispatchCreateTeam: - return "\(UrlLiteral.baseUrl)/teams" + return "\(UrlLiteral.baseUrl2)/teams" case .dispatchJoinTeam(let teamId, _): - return "http://15.165.21.115:3001/api/v2/users/join-team/\(teamId)" + return "\(UrlLiteral.baseUrl2)/users/join-team/\(teamId)" case .fetchCertainTeam(let invitationCode): - return "http://15.165.21.115:3001/api/v2/teams?invitation_code=\(invitationCode)" + return "\(UrlLiteral.baseUrl2)/teams?invitation_code=\(invitationCode)" case .dispatchAppleLogin: - return "\(UrlLiteral.baseUrl)/login" + return "\(UrlLiteral.baseUrl2)/auth" } } var method: HTTPMethod { switch self { - case .dispatchLogin: - return .post case .dispatchCreateTeam: return .post case .dispatchJoinTeam: @@ -46,8 +41,6 @@ enum SetupEndPoint: EndPointable { var body: T? { switch self { - case .dispatchLogin(let body): - return body case .dispatchCreateTeam(let body): return body case .dispatchJoinTeam(_, let body): @@ -61,12 +54,6 @@ enum SetupEndPoint: EndPointable { var headers: HTTPHeaders? { switch self { - case .dispatchLogin: - let headers = [ - "access_token": "\(UserDefaultStorage.accessToken)", - "refresh_token": "\(UserDefaultStorage.refreshToken)" - ] - return HTTPHeaders(headers) case .dispatchCreateTeam: let headers = [ "access_token": "\(UserDefaultStorage.accessToken)", diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift index 49433f42..efe84201 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift @@ -17,14 +17,3 @@ struct MemberResponse: Decodable { case userName = "username" } } - -// FIXME: - 서버의 response값이 통일되지 않아서 두 가지로 나누어 사용하다 추후에 서버에서 합치면 그 때 둘 중 하나를 없앱니다. -struct JoinMemberResponse: Decodable { - let id: Int? - let userName: String? - - enum CodingKeys: String, CodingKey { - case id - case userName = "username" - } -} From 7e5d569f0b65b664cd7c6ce89e3c3469abf54a0f Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 4 Feb 2023 22:46:51 +0900 Subject: [PATCH 082/388] =?UTF-8?q?[ADD]=20v2=EC=97=90=20=EB=A7=9E?= =?UTF-8?q?=EA=B2=8C=20Request=EC=99=80=20Reponse=20=EC=88=98=EC=A0=95(#30?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/Reqeust/DTO/CreateTeamDTO.swift | 3 +++ .../Network/Response/CreateTeamResponse.swift | 14 ++++++++++---- .../Network/Response/TeamInfoResponse.swift | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift index 1fe9761b..15255c89 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift @@ -9,4 +9,7 @@ import Foundation struct CreateTeamDTO: Encodable { let team_name: String + let nickname: String + let role: String? + let profile_image: String? } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/CreateTeamResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/CreateTeamResponse.swift index 9a1cbc91..9aa15abd 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/CreateTeamResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/CreateTeamResponse.swift @@ -10,12 +10,18 @@ import Foundation struct CreateTeamResponse: Decodable { // MARK: - createTeam let id: Int? - let teamName: String? - let invitationCode: String? + let nickname: String? + let role: String? + let profileImagePath: String? + let userId: Int? + let team: TeamInfoResponse? enum CodingKeys: String, CodingKey { case id - case teamName = "team_name" - case invitationCode = "invitation_code" + case nickname + case role + case profileImagePath = "profile_image_path" + case userId = "user_id" + case team } } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift index 7615fc7c..881b7dae 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift @@ -11,9 +11,11 @@ struct TeamInfoResponse: Decodable { // MARK: - getCertainTeamName let id: Int? let teamName: String? + let invitationCode: String? enum CodingKeys: String, CodingKey { case id case teamName = "team_name" + case invitationCode = "invitation_code" } } From 6be94e34322360cd60f753af7908778efa9ff1b7 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 4 Feb 2023 22:57:57 +0900 Subject: [PATCH 083/388] =?UTF-8?q?[ADD]=20CreateTeam=20api=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateTeam/CreateTeamViewController.swift | 26 ----------------- .../SetNicknameViewController.swift | 28 +++++++++++++++++-- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index 4cbb700f..f0c9a4b4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -104,30 +104,4 @@ final class CreateTeamViewController: BaseTextFieldViewController { let viewController = SetNicknameViewController() navigationController?.pushViewController(viewController, animated: true) } - - // MARK: - api - - // private func dispatchCreateTeam(type: SetupEndPoint) { - // AF.request(type.address, - // method: type.method, - // parameters: type.body, - // encoder: JSONParameterEncoder.default, - // headers: type.headers - // ).responseDecodable(of: BaseModel.self) { json in - // if let json = json.value { - // dump(json) - // guard let teamId = json.detail?.id else { return } - // UserDefaultHandler.setTeamId(teamId: teamId) - // DispatchQueue.main.async { - // if let invitationCode = json.detail?.invitationCode { - // self.pushInvitationViewController(invitationCode: invitationCode) - // } - // } - // } else { - // DispatchQueue.main.async { - // self.makeAlert(title: TextLiteral.createTeamViewControllerAlertTitle, message: TextLiteral.createTeamViewControllerAlertMessage) - // } - // } - // } - // } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 40511e4d..75eeb462 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -259,8 +259,8 @@ final class SetNicknameViewController: BaseViewController { guard let role = roleTextField.text else { return } if UserDefaultStorage.teamId == 0 { - // FIXME: - CreateTeam api 연결 - print("CreateTeam") + let dto = CreateTeamDTO(team_name: UserDefaultStorage.teamName, nickname: nickname, role: role, profile_image: nil) + dispatchCreateTeam(type: .dispatchCreateTeam(dto)) } else { let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) @@ -297,6 +297,30 @@ final class SetNicknameViewController: BaseViewController { // MARK: - api + private func dispatchCreateTeam(type: SetupEndPoint) { + AF.request(type.address, + method: type.method, + parameters: type.body, + encoder: JSONParameterEncoder.default, + headers: type.headers + ).responseDecodable(of: BaseModel.self) { json in + if let json = json.value { + dump(json) + guard let teamId = json.detail?.id else { return } + UserDefaultHandler.setTeamId(teamId: teamId) + DispatchQueue.main.async { +// if let invitationCode = json.detail?.invitationCode { +// self.pushInvitationViewController(invitationCode: invitationCode) +// } + } + } else { + DispatchQueue.main.async { + self.makeAlert(title: "팀 생성 및 팀 합류 실패", message: "다시 시도해 주세요.") + } + } + } + } + private func dispatchJoinTeam(type: SetupEndPoint) { AF.request(type.address, method: type.method, From ee38b4c830f8f9337458cf762c0e70e9e1c2c4d9 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 4 Feb 2023 23:29:25 +0900 Subject: [PATCH 084/388] =?UTF-8?q?[ADD]=20SetNickname=20>=20InvitationCod?= =?UTF-8?q?e=20VC=20=EC=97=B0=EA=B2=B0(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/Response/JoinTeamResponse.swift | 2 +- .../SetNicknameViewController.swift | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift index aae1942c..48e12659 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift @@ -14,7 +14,7 @@ struct JoinTeamResponse: Decodable { let role: String? let profileImagePath: String? let userId: Int? - let team: CreateTeamResponse? + let team: TeamInfoResponse? enum CodingKeys: String, CodingKey { case id diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 75eeb462..bf895026 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -309,9 +309,9 @@ final class SetNicknameViewController: BaseViewController { guard let teamId = json.detail?.id else { return } UserDefaultHandler.setTeamId(teamId: teamId) DispatchQueue.main.async { -// if let invitationCode = json.detail?.invitationCode { -// self.pushInvitationViewController(invitationCode: invitationCode) -// } + if let invitationCode = json.detail?.team?.invitationCode { + self.pushInvitationCodeViewController(invitationCode: invitationCode) + } } } else { DispatchQueue.main.async { @@ -330,11 +330,15 @@ final class SetNicknameViewController: BaseViewController { ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) - // DispatchQueue.main.async { - // if let invitationCode = json.detail?.invitationCode { - // self.pushInvitationCodeViewController(invitationCode: invitationCode) - // } - // } + DispatchQueue.main.async { + if let invitationCode = json.detail?.team?.invitationCode { + self.pushInvitationCodeViewController(invitationCode: invitationCode) + } + } + } else { + DispatchQueue.main.async { + self.makeAlert(title: "팀 합류 실패", message: "다시 시도해 주세요.") + } } } } From 842278aacaf5310aa02e65720c7fdfac226a93cb Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sat, 4 Feb 2023 23:46:48 +0900 Subject: [PATCH 085/388] =?UTF-8?q?[ADD]=20=EA=B3=B5=EC=9C=A0=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/TextLiteral.swift | 2 +- .../InvitationCodeViewController.swift | 63 +++++-------------- 2 files changed, 15 insertions(+), 50 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 2c3f2024..5931edba 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -110,7 +110,7 @@ enum TextLiteral { static let invitationCodeViewControllerTitleLabel = "초대코드를 공유하여\n팀원들을 초대해주세요" static let invitationCodeViewControllerCopyCodeButtonText = "코드 복사하기" static let invitationCodeViewControllerStartButtonText = "시작하기" - static let invitationCodeViewControllerSubLabelText = "초대코드는 다시 복사할 수 있습니다" + static let invitationCodeViewControllerSubLabelText = "초대코드는 팀관리 화면에서 공유할 수 있습니다" // MARK: - StartSuggestionView diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift index a2f690ca..642be770 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift @@ -23,7 +23,7 @@ final class InvitationCodeViewController: BaseViewController { required init?(coder: NSCoder) { nil } // MARK: - property - + private let titleLabel: UILabel = { let label = UILabel() label.setTitleFont(text: TextLiteral.invitationCodeViewControllerTitleLabel) @@ -56,17 +56,6 @@ final class InvitationCodeViewController: BaseViewController { label.textColor = .gray400 return label }() - private let toastView: UIView = { - let view = UIView() - view.layer.cornerRadius = 10 - view.clipsToBounds = true - return view - }() - private let toastContentView: ToastContentView = { - let view = ToastContentView() - view.toastType = .complete - return view - }() // MARK: - life cycle @@ -74,7 +63,6 @@ final class InvitationCodeViewController: BaseViewController { super.viewDidLoad() setupCopyCodeButton() setupStartButton() - setGradientToastView() render() } @@ -87,14 +75,6 @@ final class InvitationCodeViewController: BaseViewController { } override func render() { - - navigationController?.view.addSubview(toastView) - toastView.snp.makeConstraints { - $0.top.equalToSuperview().inset(-60) - $0.centerX.equalToSuperview() - $0.height.equalTo(46) - } - view.addSubview(titleLabel) titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) @@ -126,44 +106,29 @@ final class InvitationCodeViewController: BaseViewController { $0.bottom.equalTo(startButton.snp.top) $0.height.equalTo(SizeLiteral.minimumTouchArea) } - - toastView.addSubview(toastContentView) - toastContentView.snp.makeConstraints { - $0.edges.equalToSuperview() - } - toastContentView.render() } // MARK: - func - private func showToastPopUp() { - if !isTappedCopyButton { - isTappedCopyButton = true - UIView.animate(withDuration: 0.5, delay: 0, animations: { - self.toastView.transform = CGAffineTransform(translationX: 0, y: 115) - }, completion: { _ in - UIView.animate(withDuration: 1, delay: 0.8, animations: { - self.toastView.transform = .identity - }, completion: { _ in - self.isTappedCopyButton = false - }) - }) - } - } - - private func setGradientToastView() { - toastView.layoutIfNeeded() - toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) - } - private func setupCopyCodeButton() { let action = UIAction { [weak self] _ in - UIPasteboard.general.string = self?.invitedCodeLabel.text - self?.showToastPopUp() + self?.presentSharePanel() } copyCodeButton.addAction(action, for: .touchUpInside) } + private func presentSharePanel() { + let shareText: String = invitedCodeLabel.text ?? "" + var shareObject = [Any]() + shareObject.append(shareText) + + let activityViewController = UIActivityViewController(activityItems : shareObject, applicationActivities: nil) + activityViewController.popoverPresentationController?.sourceView = self.view + activityViewController.excludedActivityTypes = [UIActivity.ActivityType.airDrop, UIActivity.ActivityType.postToFacebook, UIActivity.ActivityType.postToTwitter, UIActivity.ActivityType.mail] + + self.present(activityViewController, animated: true, completion: nil) + } + private func setupStartButton() { let action = UIAction { [weak self] _ in self?.pushHomeViewController() From efc5194f26d4c9ac758fd4ad570c7b47b33cc767 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Feb 2023 00:22:09 +0900 Subject: [PATCH 086/388] =?UTF-8?q?[ADD]=20TextLiteral=20&=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=A0=95=EB=A6=AC(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 5 +++-- .../Setup/InvitationCode/InvitationCodeViewController.swift | 2 +- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 5931edba..1615cb80 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -42,8 +42,6 @@ enum TextLiteral { static let setNicknameViewControllerTitleLabel = "키고에서 사용할 \n닉네임을 입력해주세요" static let setNicknameViewControllerNicknameTextFieldPlaceHolder = "예) 진저, 호야, 성민" - static let setNicknameViewControllerAlertTitle = "특수문자를 사용할 수 없습니다." - static let setNicknameControllerAlertMessage = "닉네임을 다시 입력해주세요." static let setNicknameControllerNavigationTitleLabel = "프로필 생성" static let setNicknameControllerTitleLabel = "에서\n사용할 프로필을 작성해 주세요" static let setNicknameControllerNicknameLabel = "닉네임 *" @@ -51,6 +49,9 @@ enum TextLiteral { static let setNicknameControllerRoleLabel = "역할" static let setNicknameControllerRoleTextFieldPlaceHolderText = "ex) iOS 개발자" static let setNicknameControllerDoneButtonText = "입력 완료" + static let setNicknameViewControllerCreateTeamAlertTitle = "팀 생성 및 팀 합류 실패" + static let setNicknameViewControllerJoinTeamAlertTitle = "팀 합류 실패" + static let setNicknameViewControllerAlertMessage = "다시 시도해 주세요." // MARK: - HomeViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift index 642be770..37d79a55 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift @@ -122,7 +122,7 @@ final class InvitationCodeViewController: BaseViewController { var shareObject = [Any]() shareObject.append(shareText) - let activityViewController = UIActivityViewController(activityItems : shareObject, applicationActivities: nil) + let activityViewController = UIActivityViewController(activityItems: shareObject, applicationActivities: nil) activityViewController.popoverPresentationController?.sourceView = self.view activityViewController.excludedActivityTypes = [UIActivity.ActivityType.airDrop, UIActivity.ActivityType.postToFacebook, UIActivity.ActivityType.postToTwitter, UIActivity.ActivityType.mail] diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index bf895026..7e58bb38 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -257,6 +257,7 @@ final class SetNicknameViewController: BaseViewController { private func didTappedDoneButton() { guard let nickname = nicknameTextField.text else { return } guard let role = roleTextField.text else { return } + // FIXME: - 이미지 데이터 추가 if UserDefaultStorage.teamId == 0 { let dto = CreateTeamDTO(team_name: UserDefaultStorage.teamName, nickname: nickname, role: role, profile_image: nil) @@ -315,7 +316,7 @@ final class SetNicknameViewController: BaseViewController { } } else { DispatchQueue.main.async { - self.makeAlert(title: "팀 생성 및 팀 합류 실패", message: "다시 시도해 주세요.") + self.makeAlert(title: TextLiteral.setNicknameViewControllerCreateTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) } } } @@ -337,7 +338,7 @@ final class SetNicknameViewController: BaseViewController { } } else { DispatchQueue.main.async { - self.makeAlert(title: "팀 합류 실패", message: "다시 시도해 주세요.") + self.makeAlert(title: TextLiteral.setNicknameViewControllerJoinTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) } } } From f40d3b93908eca6d481268f383363ac676d0daeb Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Feb 2023 01:02:10 +0900 Subject: [PATCH 087/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=ED=95=A9=EB=A5=98?= =?UTF-8?q?=20Custom=20Alert=20=EC=82=AD=EC=A0=9C(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/AlertViewController.swift | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift index a45a669b..8e68238d 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift @@ -12,14 +12,11 @@ import SnapKit enum AlertType: String { case delete = "삭제" - case join = "합류" var title: String { switch self { case .delete: return TextLiteral.alertViewControllerTypeDeleteTitle - case .join: - return TextLiteral.alertViewControllerTypeJoinTitle } } @@ -27,8 +24,6 @@ enum AlertType: String { switch self { case .delete: return TextLiteral.alertViewControllerTypeDeleteSubTitle - case .join: - return TextLiteral.alertViewControllerTypeJoinSubTitle } } @@ -36,8 +31,6 @@ enum AlertType: String { switch self { case .delete: return self.rawValue - case .join: - return self.rawValue } } @@ -45,8 +38,6 @@ enum AlertType: String { switch self { case .delete: return .red100 - case .join: - return .gray500 } } } @@ -140,8 +131,6 @@ final class AlertViewController: BaseViewController { override func configUI() { view.backgroundColor = .black100.withAlphaComponent(0.85) - setOkLabelColor() - setTeamName() } override func render() { @@ -198,58 +187,18 @@ final class AlertViewController: BaseViewController { // MARK: - func - private func setOkLabelColor() { - if type == .join { - DispatchQueue.main.async { - self.actionButton.setTitleColor(self.type.actionTitleColor, for: .normal) - } - } - } - - private func setTeamName() { - if type == .join { - if teamName != nil { - DispatchQueue.main.async { - self.titleLabel.text = self.teamName - } - } - } - } - private func didTappedActionButton(_ type: AlertType) { switch type { case .delete: self.deleteFeedBack(type: .deleteFeedBack(reflectionId: self.reflectionId, feedBackId: self.feedbackId)) - case .join: - print("join") -// self.dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId)) } self.dismiss(animated: true) { self.navigation?.popViewController(animated: true) } } - private func pushHomeViewController() { - let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate - sceneDelegate?.changeRootViewCustomTabBarView() - } - // MARK: - api - private func dispatchJoinTeam(type: SetupEndPoint) { - AF.request(type.address, - method: type.method, - headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in - if let json = json.value { - dump(json) - DispatchQueue.main.async { - self.pushHomeViewController() - } - } - } - } - private func deleteFeedBack(type: MyFeedBackEndPoint) { AF.request(type.address, method: type.method, From f0f400804eb69759096fd9e21b32f89a8dd1e441 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Feb 2023 01:29:32 +0900 Subject: [PATCH 088/388] =?UTF-8?q?[ADD]=20UIViewController=20Extension?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EA=B3=B5=EC=9C=A0=ED=95=98=EA=B8=B0=20?= =?UTF-8?q?=EB=AA=A8=EB=93=88=ED=99=94(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extension/UIViewController+Extension.swift | 18 +++++++++++++++--- .../InvitationCodeViewController.swift | 14 +------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift index 7407a05c..4699d5c3 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift @@ -78,6 +78,18 @@ extension UIViewController { viewController.modalTransitionStyle = .crossDissolve self.present(viewController, animated: true) } + + func presentSharePanel(text: String) { + let shareText = text + var shareObject = [Any]() + shareObject.append(shareText) + + let activityViewController = UIActivityViewController(activityItems: shareObject, applicationActivities: nil) + activityViewController.popoverPresentationController?.sourceView = self.view + activityViewController.excludedActivityTypes = [UIActivity.ActivityType.airDrop, UIActivity.ActivityType.postToFacebook, UIActivity.ActivityType.postToTwitter, UIActivity.ActivityType.mail] + + self.present(activityViewController, animated: true, completion: nil) + } } extension UIViewController: UIGestureRecognizerDelegate { @@ -87,7 +99,7 @@ extension UIViewController: UIGestureRecognizerDelegate { return count > 1 } public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { - guard touch.view is UIButton else { return true } - return false - } + guard touch.view is UIButton else { return true } + return false + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift index 37d79a55..cfab5913 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift @@ -112,23 +112,11 @@ final class InvitationCodeViewController: BaseViewController { private func setupCopyCodeButton() { let action = UIAction { [weak self] _ in - self?.presentSharePanel() + self?.presentSharePanel(text: self?.invitedCodeLabel.text ?? "") } copyCodeButton.addAction(action, for: .touchUpInside) } - private func presentSharePanel() { - let shareText: String = invitedCodeLabel.text ?? "" - var shareObject = [Any]() - shareObject.append(shareText) - - let activityViewController = UIActivityViewController(activityItems: shareObject, applicationActivities: nil) - activityViewController.popoverPresentationController?.sourceView = self.view - activityViewController.excludedActivityTypes = [UIActivity.ActivityType.airDrop, UIActivity.ActivityType.postToFacebook, UIActivity.ActivityType.postToTwitter, UIActivity.ActivityType.mail] - - self.present(activityViewController, animated: true, completion: nil) - } - private func setupStartButton() { let action = UIAction { [weak self] _ in self?.pushHomeViewController() From 2085026c806084fe3376371e5520b5fb045eef74 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 13:30:39 +0900 Subject: [PATCH 089/388] =?UTF-8?q?[CHORE]=20PR=20=EB=B6=84=EB=A6=AC?= =?UTF-8?q?=EB=A5=BC=20=EC=9C=84=ED=95=9C=20=EC=BB=A4=EB=B0=8B=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 8 --- .../Screen/Home/Home/HomeViewController.swift | 4 +- .../Home/Home/ParticipatingTeamCell.swift | 49 ------------------ .../Screen/Home/Home/SettingCell.swift | 22 -------- .../Home/Home/TeamManageViewController.swift | 51 ------------------- 5 files changed, 2 insertions(+), 132 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift delete mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/SettingCell.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 5b55c76d..e6fd00ea 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -130,8 +130,6 @@ 7EE38BAD2925DDD200FD738D /* EncodeDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */; }; 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */; }; D702278A297F99510027EF64 /* TeamManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7022789297F99500027EF64 /* TeamManageViewController.swift */; }; - D702278C2980075C0027EF64 /* ParticipatingTeamCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */; }; - D702278E29800B240027EF64 /* SettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D702278D29800B240027EF64 /* SettingCell.swift */; }; D724790C28FEC8C900D67B50 /* BaseTextFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */; }; D724790E28FEEEC300D67B50 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790D28FEEEC300D67B50 /* CustomTextField.swift */; }; D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */; }; @@ -270,8 +268,6 @@ 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncodeDTO.swift; sourceTree = ""; }; 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionEndPoint.swift; sourceTree = ""; }; D7022789297F99500027EF64 /* TeamManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageViewController.swift; sourceTree = ""; }; - D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParticipatingTeamCell.swift; sourceTree = ""; }; - D702278D29800B240027EF64 /* SettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingCell.swift; sourceTree = ""; }; D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTextFieldViewController.swift; sourceTree = ""; }; D724790D28FEEEC300D67B50 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = ""; }; D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeViewController.swift; sourceTree = ""; }; @@ -716,8 +712,6 @@ 3E5195A9292B05B000710A01 /* UIComponent */, 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */, D7022789297F99500027EF64 /* TeamManageViewController.swift */, - D702278B2980075C0027EF64 /* ParticipatingTeamCell.swift */, - D702278D29800B240027EF64 /* SettingCell.swift */, ); path = Home; sourceTree = ""; @@ -1066,7 +1060,6 @@ 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */, 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */, 39F52C7A2924CC9600B19A77 /* SetupEndPoint.swift in Sources */, - D702278C2980075C0027EF64 /* ParticipatingTeamCell.swift in Sources */, 39F52C5F2923338B00B19A77 /* CurrentMemberResponse.swift in Sources */, 397E49572924D93F004220D6 /* UrlLiteral.swift in Sources */, 3E557FFA2901CD4200714E46 /* KeywordCollectionViewCell.swift in Sources */, @@ -1082,7 +1075,6 @@ 39436C132912877D0083D77A /* MyFeedbackHeaderView.swift in Sources */, 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */, D750511B29423CB6001BDA34 /* SelectKeywordTypeView.swift in Sources */, - D702278E29800B240027EF64 /* SettingCell.swift in Sources */, 39F52C6E2924742E00B19A77 /* ReflectionResponse.swift in Sources */, 52988B742921EAD50044A77F /* MyReflectionFeedbackViewController.swift in Sources */, 7E8753E129348BB000FBBF83 /* MyReflectionDetailViewLastCell.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 45d40040..351d6a05 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -58,7 +58,7 @@ final class HomeViewController: BaseViewController { button.tintColor = .black100 let action = UIAction { [weak self] _ in // FIXME: 버튼 눌렀을 때 action 추가 - self?.setupPresentModel() + self?.presentTeamModal() } button.addAction(action, for: .touchUpInside) return button @@ -189,7 +189,7 @@ final class HomeViewController: BaseViewController { // MARK: - func - private func setupPresentModel() { + private func presentTeamModal() { let teamViewController = TeamManageViewController() teamViewController.modalPresentationStyle = .pageSheet diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift deleted file mode 100644 index 2b5a6951..00000000 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/ParticipatingTeamCell.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// ParticipatingTeamCell.swift -// Maddori.Apple -// -// Created by 이성호 on 2023/01/24. -// - -import UIKit - -import SnapKit - -final class ParticipatingTeamCell: BaseTableViewCell { - - // MARK: - property - private let titleLable: UILabel = { - let label = UILabel() - label.text = "참여 중인 팀" - label.font = .label2 - return label - }() - let listTableView = UITableView() - - // MARK: - life cycle - - override func render() { - - self.addSubview(titleLable) - titleLable.snp.makeConstraints { - $0.top.equalToSuperview() - $0.leading.equalTo(SizeLiteral.leadingTrailingPadding) - } - - self.addSubview(listTableView) - listTableView.snp.makeConstraints { - $0.top.equalTo(titleLable.snp.bottom).offset(10) - $0.width.equalToSuperview() - $0.height.equalToSuperview() - } - } - - override func configUI() { - backgroundColor = .white100 - } - - // MARK: - func - private func setupTableViewCell() { - listTableView.register(UITableViewCell.self, forCellReuseIdentifier: UITableViewCell.className) - } -} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/SettingCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/SettingCell.swift deleted file mode 100644 index 2c33a955..00000000 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/SettingCell.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SettingCell.swift -// Maddori.Apple -// -// Created by 이성호 on 2023/01/24. -// - -import UIKit - -import SnapKit - -final class SettingCell: BaseTableViewCell { - //FIXME: 네임 변경 예정 - // MARK: - life cycle - override func render() { - - } - - override func configUI() { - backgroundColor = .yellow - } -} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 9765e78c..d2d301f4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -12,24 +12,13 @@ import SnapKit final class TeamManageViewController: BaseViewController { // MARK: - property - private let manageTableView: UITableView = { - let tableView = UITableView() - return tableView - }() // MARK: - life cycle override func viewDidLoad() { super.viewDidLoad() - setupTableViewRegisterCell() - setupTableViewDelegateDataSource() } override func render() { - view.addSubview(manageTableView) - manageTableView.snp.makeConstraints { - $0.top.equalTo(self.view.safeAreaLayoutGuide).inset(38) - $0.width.height.equalToSuperview() - } } override func configUI() { @@ -37,44 +26,4 @@ final class TeamManageViewController: BaseViewController { } // MARK: - func - private func setupTableViewRegisterCell() { - manageTableView.register(ParticipatingTeamCell.self, forCellReuseIdentifier: ParticipatingTeamCell.className) - manageTableView.register(SettingCell.self, forCellReuseIdentifier: SettingCell.className) - } - - private func setupTableViewDelegateDataSource() { - manageTableView.delegate = self - manageTableView.dataSource = self - } -} - -extension TeamManageViewController: UITableViewDataSource { - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 5 - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - if indexPath.row == 0 { - guard let cell = tableView.dequeueReusableCell(withIdentifier: ParticipatingTeamCell.className, for: indexPath) as? ParticipatingTeamCell else { return UITableViewCell() } - cell.listTableView.delegate = self - cell.listTableView.dataSource = self - return cell - } - else { - guard let cell = tableView.dequeueReusableCell(withIdentifier: SettingCell.className, for: indexPath) as? SettingCell else { return UITableViewCell() } - return cell - } - } -} - -extension TeamManageViewController: UITableViewDelegate { - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - //FIXME: 첫번째 그리고 세퍼레이터 변경 예정 - if indexPath.row == 0 { - return 200 - } - else { - return 60 - } - } } From f0d36a05ba847a758b5101713b6ee95c2a924ebb Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 13:42:28 +0900 Subject: [PATCH 090/388] =?UTF-8?q?[CHORE]=20=EB=94=94=EB=B0=94=EC=9D=B4?= =?UTF-8?q?=EB=8D=94=20=EB=B7=B0=20=EC=83=9D=EC=84=B1=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index d2d301f4..1444db30 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -12,6 +12,15 @@ import SnapKit final class TeamManageViewController: BaseViewController { // MARK: - property + private let tempView: UIView = { + let view = UIView() + return view + }() + private let dividerView: UIView = { + let view = UIView() + view.backgroundColor = .gray100 + return view + }() // MARK: - life cycle override func viewDidLoad() { @@ -19,6 +28,19 @@ final class TeamManageViewController: BaseViewController { } override func render() { + view.addSubview(tempView) + tempView.snp.makeConstraints { + $0.width.equalToSuperview() + $0.height.equalTo(275) // FIXME: 수치 바꿀것 + $0.top.equalToSuperview() + } + + view.addSubview(dividerView) + dividerView.snp.makeConstraints { + $0.top.equalTo(tempView.snp.bottom) + $0.width.equalToSuperview() + $0.height.equalTo(6) + } } override func configUI() { From 8ae995eeec9e164d38e75292f1f299c79544bfff Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 13:48:35 +0900 Subject: [PATCH 091/388] =?UTF-8?q?[FEAT]=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EB=B7=B0=20=EC=83=9D=EC=84=B1=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 1444db30..5b9b5b42 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -21,10 +21,17 @@ final class TeamManageViewController: BaseViewController { view.backgroundColor = .gray100 return view }() + private let settingTableView: UITableView = { + let tableView = UITableView() + tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") + tableView.isScrollEnabled = false + return tableView + }() // MARK: - life cycle override func viewDidLoad() { super.viewDidLoad() + setupDelegate() } override func render() { @@ -41,6 +48,13 @@ final class TeamManageViewController: BaseViewController { $0.width.equalToSuperview() $0.height.equalTo(6) } + + view.addSubview(settingTableView) + settingTableView.snp.makeConstraints { + $0.top.equalTo(dividerView.snp.bottom) + $0.width.equalToSuperview() + $0.height.equalTo(500) // FIXME: 수치 바꿀것 + } } override func configUI() { @@ -48,4 +62,25 @@ final class TeamManageViewController: BaseViewController { } // MARK: - func + private func setupDelegate() { + settingTableView.delegate = self + settingTableView.dataSource = self + } +} + +extension TeamManageViewController: UITableViewDataSource { + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 2 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) + cell.textLabel?.text = "테스트" + return cell + } +} + +extension TeamManageViewController: UITableViewDelegate { + } From 4b526685db920e03f19d646603419325db6927cd Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 14:07:01 +0900 Subject: [PATCH 092/388] =?UTF-8?q?[FEAT]=20=EC=84=B8=ED=8C=85=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=20=EC=83=9D=EC=84=B1=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 5b9b5b42..5a1cfc5d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -11,6 +11,8 @@ import SnapKit final class TeamManageViewController: BaseViewController { + private var sections: [Section] = [] + // MARK: - property private let tempView: UIView = { let view = UIView() @@ -32,6 +34,7 @@ final class TeamManageViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() setupDelegate() + configureSettingModels() } override func render() { @@ -66,17 +69,38 @@ final class TeamManageViewController: BaseViewController { settingTableView.delegate = self settingTableView.dataSource = self } + + private func configureSettingModels() { + sections.append(Section(title: "위", options: [Option(title: "새로운 팀 합류하기", handler: { + print("새로운 팀 합류하기") + }), + Option(title: "팀 생성하기", handler: { + print("팀 생성하기") + })])) + + sections.append(Section(title: "아래", options: [Option(title: "로그아웃", handler: { + print("로그아웃") + }), + Option(title: "회원탈퇴", handler: { + print("회원탈퇴") + })])) + } } extension TeamManageViewController: UITableViewDataSource { + func numberOfSections(in tableView: UITableView) -> Int { + return sections.count + } + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 2 + return sections[section].options.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let model = sections[indexPath.section].options[indexPath.row] let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) - cell.textLabel?.text = "테스트" + cell.textLabel?.text = model.title return cell } } @@ -84,3 +108,13 @@ extension TeamManageViewController: UITableViewDataSource { extension TeamManageViewController: UITableViewDelegate { } + +struct Section { + let title: String + let options: [Option] +} + +struct Option { + let title: String + let handler: () -> Void +} From cf039c3e1251189dbf6371249c5be306ce5576ae Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 14:15:18 +0900 Subject: [PATCH 093/388] =?UTF-8?q?[FEAT]=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EB=B7=B0=20=EC=85=80=EB=A7=88=EB=8B=A4=20=ED=95=B8=EB=93=A4?= =?UTF-8?q?=EB=9F=AC=20=EC=97=B0=EA=B2=B0=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 5a1cfc5d..b5689d9e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -103,10 +103,18 @@ extension TeamManageViewController: UITableViewDataSource { cell.textLabel?.text = model.title return cell } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 60 + } } extension TeamManageViewController: UITableViewDelegate { - + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + let model = sections[indexPath.section].options[indexPath.row] + model.handler() + } } struct Section { From 785ec8791772a74ce65c8578880bcf99e9209b1b Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:10:27 +0900 Subject: [PATCH 094/388] =?UTF-8?q?[FEAT]=20=ED=85=8C=EC=9D=B4=EB=B8=94?= =?UTF-8?q?=EB=B7=B0=20=ED=91=B8=ED=84=B0=20=EB=93=B1=EB=A1=9D=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../Home/Home/TeamManageSettingCell.swift | 42 +++++++++++++++++++ .../Home/Home/TeamManageViewController.swift | 39 ++++++++++++++--- 3 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index e6fd00ea..b62a01c8 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -137,6 +137,7 @@ D750511B29423CB6001BDA34 /* SelectKeywordTypeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D750511A29423CB6001BDA34 /* SelectKeywordTypeView.swift */; }; D79D908C2903B6B1004DDC4A /* LabelButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D79D908B2903B6B1004DDC4A /* LabelButtonView.swift */; }; D79D908E29041F42004DDC4A /* CreateTeamViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D79D908D29041F42004DDC4A /* CreateTeamViewController.swift */; }; + D7A585222990C50700E1F4EE /* TeamManageSettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */; }; D7AFB7C32916EAB100E998B7 /* MyReflectionDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C22916EAB100E998B7 /* MyReflectionDetailViewController.swift */; }; D7AFB7C52916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C42916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift */; }; D7AFB7C72916FF9400E998B7 /* CustomSegmentControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C62916FF9400E998B7 /* CustomSegmentControl.swift */; }; @@ -275,6 +276,7 @@ D750511A29423CB6001BDA34 /* SelectKeywordTypeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectKeywordTypeView.swift; sourceTree = ""; }; D79D908B2903B6B1004DDC4A /* LabelButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelButtonView.swift; sourceTree = ""; }; D79D908D29041F42004DDC4A /* CreateTeamViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateTeamViewController.swift; sourceTree = ""; }; + D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageSettingCell.swift; sourceTree = ""; }; D7AFB7C22916EAB100E998B7 /* MyReflectionDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionDetailViewController.swift; sourceTree = ""; }; D7AFB7C42916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionDetailTableViewCell.swift; sourceTree = ""; }; D7AFB7C62916FF9400E998B7 /* CustomSegmentControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSegmentControl.swift; sourceTree = ""; }; @@ -712,6 +714,7 @@ 3E5195A9292B05B000710A01 /* UIComponent */, 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */, D7022789297F99500027EF64 /* TeamManageViewController.swift */, + D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */, ); path = Home; sourceTree = ""; @@ -1145,6 +1148,7 @@ 3EA341EA29261ADD005CBD1C /* InProgressEndPoint.swift in Sources */, 39F52C592923321700B19A77 /* CertainTeamDetailResponse.swift in Sources */, 396334D7292DADBE00E74B77 /* AppleLoginDTO.swift in Sources */, + D7A585222990C50700E1F4EE /* TeamManageSettingCell.swift in Sources */, 397E495A2924F871004220D6 /* UserDefaultStorage.swift in Sources */, 395C7E1B28FEC42900FC2FCA /* CreateReflectionViewController.swift in Sources */, 39F52C612923344C00B19A77 /* FeedBackContentResponse.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift new file mode 100644 index 00000000..a7cf26f0 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift @@ -0,0 +1,42 @@ +// +// TeamManageSettingCell.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/02/06. +// + +import UIKit + +import SnapKit + +final class TeamManageSettingCell: BaseTableViewCell { + + // MARK: - property + + let cellTitleLabel: UILabel = { + let label = UILabel() + label.font = .label2 + return label + }() + + override func render() { + self.addSubview(cellTitleLabel) + cellTitleLabel.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.directionalHorizontalEdges.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + } + + override func configUI() { + self.backgroundColor = .white200 + } +} + +final class TeamManageSettingFooterCell: UITableViewHeaderFooterView { + + override init(reuseIdentifier: String?) { + super.init(reuseIdentifier: reuseIdentifier) + } + + required init?(coder: NSCoder) { nil } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index b5689d9e..73782ad3 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -14,6 +14,7 @@ final class TeamManageViewController: BaseViewController { private var sections: [Section] = [] // MARK: - property + private let tempView: UIView = { let view = UIView() return view @@ -25,12 +26,16 @@ final class TeamManageViewController: BaseViewController { }() private let settingTableView: UITableView = { let tableView = UITableView() - tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") + tableView.register(TeamManageSettingCell.self, forCellReuseIdentifier: TeamManageSettingCell.className) + tableView.register(TeamManageSettingFooterCell.self, forHeaderFooterViewReuseIdentifier: TeamManageSettingFooterCell.className) tableView.isScrollEnabled = false + tableView.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) + tableView.separatorColor = .gray200 return tableView }() // MARK: - life cycle + override func viewDidLoad() { super.viewDidLoad() setupDelegate() @@ -55,8 +60,8 @@ final class TeamManageViewController: BaseViewController { view.addSubview(settingTableView) settingTableView.snp.makeConstraints { $0.top.equalTo(dividerView.snp.bottom) - $0.width.equalToSuperview() - $0.height.equalTo(500) // FIXME: 수치 바꿀것 + $0.directionalHorizontalEdges.equalToSuperview() + $0.height.equalTo(1000) // FIXME: 수치 바꿀것 } } @@ -65,6 +70,7 @@ final class TeamManageViewController: BaseViewController { } // MARK: - func + private func setupDelegate() { settingTableView.delegate = self settingTableView.dataSource = self @@ -99,14 +105,36 @@ extension TeamManageViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let model = sections[indexPath.section].options[indexPath.row] - let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) - cell.textLabel?.text = model.title + + guard let cell = tableView.dequeueReusableCell(withIdentifier: TeamManageSettingCell.className, for: indexPath) as? TeamManageSettingCell else { return UITableViewCell() } + + if indexPath.section == 1 { + cell.cellTitleLabel.textColor = .red + } + + cell.cellTitleLabel.text = model.title + cell.selectionStyle = .none + return cell } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 60 } + + func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { + guard let view = tableView.dequeueReusableHeaderFooterView(withIdentifier: TeamManageSettingFooterCell.className) as? TeamManageSettingFooterCell else { return UITableViewHeaderFooterView() + } + return view + } + + func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) { + view.tintColor = .gray100 + } + + func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { + return 6 + } } extension TeamManageViewController: UITableViewDelegate { @@ -117,6 +145,7 @@ extension TeamManageViewController: UITableViewDelegate { } } +// FIXME: 모델로 뺄것 struct Section { let title: String let options: [Option] From ba679609c12a158e19e054bfefdce248f0c31f21 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:48:52 +0900 Subject: [PATCH 095/388] =?UTF-8?q?[CHORE]=20=EB=A7=88=EC=A7=80=EB=A7=89?= =?UTF-8?q?=20=EC=84=B8=ED=8D=BC=EB=A0=88=EC=9D=B4=ED=84=B0=20=EC=97=86?= =?UTF-8?q?=EC=95=A0=EA=B8=B0=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 73782ad3..4671d26f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -29,8 +29,7 @@ final class TeamManageViewController: BaseViewController { tableView.register(TeamManageSettingCell.self, forCellReuseIdentifier: TeamManageSettingCell.className) tableView.register(TeamManageSettingFooterCell.self, forHeaderFooterViewReuseIdentifier: TeamManageSettingFooterCell.className) tableView.isScrollEnabled = false - tableView.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) - tableView.separatorColor = .gray200 + tableView.separatorInset = UIEdgeInsets(top: 0, left: SizeLiteral.leadingTrailingPadding, bottom: 0, right: SizeLiteral.leadingTrailingPadding) return tableView }() @@ -115,6 +114,10 @@ extension TeamManageViewController: UITableViewDataSource { cell.cellTitleLabel.text = model.title cell.selectionStyle = .none + if indexPath.row == sections.count - 1 { + cell.separatorInset = UIEdgeInsets(top: 0, left: tableView.bounds.width + 1, bottom: 0, right: 0) + } + return cell } From fb8d892197502926df2e8122d9e7309b340ebc6b Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:52:28 +0900 Subject: [PATCH 096/388] =?UTF-8?q?[CHORE]=20=EB=AA=A8=EB=8D=B8=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC=20(280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 16 ++++++++++++++++ .../Screen/Home/Home/Model/Option.swift | 13 +++++++++++++ .../Screen/Home/Home/Model/Section.swift | 13 +++++++++++++ .../Home/Home/TeamManageViewController.swift | 11 ----------- 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Option.swift create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index b62a01c8..1bfe58c1 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -138,6 +138,8 @@ D79D908C2903B6B1004DDC4A /* LabelButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D79D908B2903B6B1004DDC4A /* LabelButtonView.swift */; }; D79D908E29041F42004DDC4A /* CreateTeamViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D79D908D29041F42004DDC4A /* CreateTeamViewController.swift */; }; D7A585222990C50700E1F4EE /* TeamManageSettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */; }; + D7A585272990DAFC00E1F4EE /* Section.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585262990DAFC00E1F4EE /* Section.swift */; }; + D7A585292990DB0D00E1F4EE /* Option.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585282990DB0D00E1F4EE /* Option.swift */; }; D7AFB7C32916EAB100E998B7 /* MyReflectionDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C22916EAB100E998B7 /* MyReflectionDetailViewController.swift */; }; D7AFB7C52916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C42916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift */; }; D7AFB7C72916FF9400E998B7 /* CustomSegmentControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C62916FF9400E998B7 /* CustomSegmentControl.swift */; }; @@ -277,6 +279,8 @@ D79D908B2903B6B1004DDC4A /* LabelButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelButtonView.swift; sourceTree = ""; }; D79D908D29041F42004DDC4A /* CreateTeamViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateTeamViewController.swift; sourceTree = ""; }; D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageSettingCell.swift; sourceTree = ""; }; + D7A585262990DAFC00E1F4EE /* Section.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Section.swift; sourceTree = ""; }; + D7A585282990DB0D00E1F4EE /* Option.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Option.swift; sourceTree = ""; }; D7AFB7C22916EAB100E998B7 /* MyReflectionDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionDetailViewController.swift; sourceTree = ""; }; D7AFB7C42916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionDetailTableViewCell.swift; sourceTree = ""; }; D7AFB7C62916FF9400E998B7 /* CustomSegmentControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSegmentControl.swift; sourceTree = ""; }; @@ -711,6 +715,7 @@ 3E557FC128FE7B9200714E46 /* Home */ = { isa = PBXGroup; children = ( + D7A585252990DAE500E1F4EE /* Model */, 3E5195A9292B05B000710A01 /* UIComponent */, 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */, D7022789297F99500027EF64 /* TeamManageViewController.swift */, @@ -964,6 +969,15 @@ path = Setup; sourceTree = ""; }; + D7A585252990DAE500E1F4EE /* Model */ = { + isa = PBXGroup; + children = ( + D7A585262990DAFC00E1F4EE /* Section.swift */, + D7A585282990DB0D00E1F4EE /* Option.swift */, + ); + path = Model; + sourceTree = ""; + }; D7AFB7C12916EA7C00E998B7 /* MyReflectionDetail */ = { isa = PBXGroup; children = ( @@ -1097,6 +1111,7 @@ 39F5582B2908027500CD6F6E /* UIDevice+Extension.swift in Sources */, 395C7E1328F9841A00FC2FCA /* SizeLiteral.swift in Sources */, 3EB508902917525600FB77CB /* EmptyReflectionView.swift in Sources */, + D7A585292990DB0D00E1F4EE /* Option.swift in Sources */, 3EB5088E2916D05F00FB77CB /* EmptyFeedbackView.swift in Sources */, 391596622904176500A432D9 /* UIView+Extension.swift in Sources */, 3EB508922917585600FB77CB /* UICollectionView + Extension.swift in Sources */, @@ -1134,6 +1149,7 @@ 39257DEF28F937A500201E0B /* BaseTableViewCell.swift in Sources */, 39F52C72292476AE00B19A77 /* KeywordResponse.swift in Sources */, 39F52C5B2923327F00B19A77 /* CurrentReflectionResponse.swift in Sources */, + D7A585272990DAFC00E1F4EE /* Section.swift in Sources */, 3E557FC528FE854600714E46 /* KeywordLabel.swift in Sources */, 39F52C53292330D200B19A77 /* MemberResponse.swift in Sources */, 39F52C6A292473A800B19A77 /* ReflectionInfoResponse.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Option.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Option.swift new file mode 100644 index 00000000..9bbdfc9d --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Option.swift @@ -0,0 +1,13 @@ +// +// Option.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/02/06. +// + +import Foundation + +struct Option { + let title: String + let handler: () -> Void +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift new file mode 100644 index 00000000..0c325e76 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift @@ -0,0 +1,13 @@ +// +// Section.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/02/06. +// + +import Foundation + +struct Section { + let title: String + let options: [Option] +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 4671d26f..a6a5a415 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -147,14 +147,3 @@ extension TeamManageViewController: UITableViewDelegate { model.handler() } } - -// FIXME: 모델로 뺄것 -struct Section { - let title: String - let options: [Option] -} - -struct Option { - let title: String - let handler: () -> Void -} From af7bace8e23598e8e87e20b862dca361d7c40881 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:55:03 +0900 Subject: [PATCH 097/388] =?UTF-8?q?[CHORE]=20=EC=98=A4=EB=B2=84=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=93=9C=20=EC=82=AD=EC=A0=9C=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index a6a5a415..dd07ecd0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -64,10 +64,6 @@ final class TeamManageViewController: BaseViewController { } } - override func configUI() { - super.configUI() - } - // MARK: - func private func setupDelegate() { From be59f842a5d1a85b525683cf0608a200afbb6099 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:57:01 +0900 Subject: [PATCH 098/388] =?UTF-8?q?[CHORE]=20=EB=AA=A8=EB=8D=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/Model/Section.swift | 1 - .../Screen/Home/Home/TeamManageViewController.swift | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift index 0c325e76..83cacc43 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift @@ -8,6 +8,5 @@ import Foundation struct Section { - let title: String let options: [Option] } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index dd07ecd0..1f33744a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -72,14 +72,14 @@ final class TeamManageViewController: BaseViewController { } private func configureSettingModels() { - sections.append(Section(title: "위", options: [Option(title: "새로운 팀 합류하기", handler: { + sections.append(Section(options: [Option(title: "새로운 팀 합류하기", handler: { print("새로운 팀 합류하기") }), Option(title: "팀 생성하기", handler: { print("팀 생성하기") })])) - sections.append(Section(title: "아래", options: [Option(title: "로그아웃", handler: { + sections.append(Section(options: [Option(title: "로그아웃", handler: { print("로그아웃") }), Option(title: "회원탈퇴", handler: { From c7bd89d598e82884846ea25a3f287f06e25117dd Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:57:15 +0900 Subject: [PATCH 099/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EB=B7=B0=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=ED=99=94=20=EC=A4=91=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../Home/Home/TeamManageViewController.swift | 10 ++-- .../Home/UIComponent/ChangeTeamView.swift | 50 +++++++++++++++++++ 3 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 1bfe58c1..026ff223 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -140,6 +140,7 @@ D7A585222990C50700E1F4EE /* TeamManageSettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */; }; D7A585272990DAFC00E1F4EE /* Section.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585262990DAFC00E1F4EE /* Section.swift */; }; D7A585292990DB0D00E1F4EE /* Option.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585282990DB0D00E1F4EE /* Option.swift */; }; + D7A5852B2990DCE700E1F4EE /* ChangeTeamView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */; }; D7AFB7C32916EAB100E998B7 /* MyReflectionDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C22916EAB100E998B7 /* MyReflectionDetailViewController.swift */; }; D7AFB7C52916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C42916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift */; }; D7AFB7C72916FF9400E998B7 /* CustomSegmentControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C62916FF9400E998B7 /* CustomSegmentControl.swift */; }; @@ -281,6 +282,7 @@ D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageSettingCell.swift; sourceTree = ""; }; D7A585262990DAFC00E1F4EE /* Section.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Section.swift; sourceTree = ""; }; D7A585282990DB0D00E1F4EE /* Option.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Option.swift; sourceTree = ""; }; + D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeTeamView.swift; sourceTree = ""; }; D7AFB7C22916EAB100E998B7 /* MyReflectionDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionDetailViewController.swift; sourceTree = ""; }; D7AFB7C42916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionDetailTableViewCell.swift; sourceTree = ""; }; D7AFB7C62916FF9400E998B7 /* CustomSegmentControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSegmentControl.swift; sourceTree = ""; }; @@ -708,6 +710,7 @@ isa = PBXGroup; children = ( 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */, + D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */, ); path = UIComponent; sourceTree = ""; @@ -1150,6 +1153,7 @@ 39F52C72292476AE00B19A77 /* KeywordResponse.swift in Sources */, 39F52C5B2923327F00B19A77 /* CurrentReflectionResponse.swift in Sources */, D7A585272990DAFC00E1F4EE /* Section.swift in Sources */, + D7A5852B2990DCE700E1F4EE /* ChangeTeamView.swift in Sources */, 3E557FC528FE854600714E46 /* KeywordLabel.swift in Sources */, 39F52C53292330D200B19A77 /* MemberResponse.swift in Sources */, 39F52C6A292473A800B19A77 /* ReflectionInfoResponse.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 1f33744a..e46e8a6f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -15,8 +15,8 @@ final class TeamManageViewController: BaseViewController { // MARK: - property - private let tempView: UIView = { - let view = UIView() + private let chageTeamView: ChangeTeamView = { + let view = ChangeTeamView() return view }() private let dividerView: UIView = { @@ -42,8 +42,8 @@ final class TeamManageViewController: BaseViewController { } override func render() { - view.addSubview(tempView) - tempView.snp.makeConstraints { + view.addSubview(chageTeamView) + chageTeamView.snp.makeConstraints { $0.width.equalToSuperview() $0.height.equalTo(275) // FIXME: 수치 바꿀것 $0.top.equalToSuperview() @@ -51,7 +51,7 @@ final class TeamManageViewController: BaseViewController { view.addSubview(dividerView) dividerView.snp.makeConstraints { - $0.top.equalTo(tempView.snp.bottom) + $0.top.equalTo(chageTeamView.snp.bottom) $0.width.equalToSuperview() $0.height.equalTo(6) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift new file mode 100644 index 00000000..19d3fb24 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -0,0 +1,50 @@ +// +// ChangeTeamView.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/02/06. +// + +import UIKit + +import SnapKit + +final class ChangeTeamView: UIView { + + // MARK: - property + + private let titleLabel: UILabel = { + let label = UILabel() + label.font = .label2 + label.text = "참여 중인 팀" + label.textColor = .black100 + return label + }() + + // MARK: - life cycle + + override init(frame: CGRect) { + super.init(frame: frame) + render() + configUI() + } + + required init?(coder: NSCoder) { nil } + + private func configUI() { + self.backgroundColor = .white200 + } + + private func render() { + self.addSubview(titleLabel) + titleLabel.snp.makeConstraints { + $0.top.equalTo(safeAreaLayoutGuide.snp.top).inset(26) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + } + + // MARK: - function + + + +} From 4e2072be7657548d38941ee8119c97107e0ad75b Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 17:05:29 +0900 Subject: [PATCH 100/388] =?UTF-8?q?[CHORE]=20FIXME=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 041968b4..b402a457 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -332,8 +332,8 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { itemProvider.loadObject(ofClass: UIImage.self) { (image, error) in DispatchQueue.main.async { self.profileImageButton.profileImage.image = image as? UIImage - // FIXME: - 이미지 정보 가져오기 } + // FIXME: - 이미지 정보 가져오기 } } else { self.makeAlert(title: TextLiteral.setNicknameControllerLibraryErrorAlertTitle, message: TextLiteral.setNicknameControllerLibraryErrorAlertMessage) From ab000982b3895d3730b66e1dfcb9a782584b8796 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 17:41:00 +0900 Subject: [PATCH 101/388] =?UTF-8?q?[CHORE]=20teamName=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=20=EC=88=98=EC=A0=95(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 449f3b26..ef69ac99 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -19,8 +19,7 @@ final class SetNicknameViewController: BaseViewController { static let roleMax: Int = 20 } private let cameraPicker = UIImagePickerController() - - let teamName: String = UserDefaultStorage.teamName + private let teamName: String = UserDefaultStorage.teamName // MARK: - property @@ -291,7 +290,7 @@ final class SetNicknameViewController: BaseViewController { // FIXME: - 이미지 데이터 추가 if UserDefaultStorage.teamId == 0 { - let dto = CreateTeamDTO(team_name: UserDefaultStorage.teamName, nickname: nickname, role: role, profile_image: nil) + let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) dispatchCreateTeam(type: .dispatchCreateTeam(dto)) } else { let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) From 4e8c5d713db71f5f455346f1186a461cb1007dec Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 20:40:10 +0900 Subject: [PATCH 102/388] =?UTF-8?q?[ADD]=20=ED=8C=8C=EC=9D=BC=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 16 ++++++++++++++ .../ReflectionMemberCollectionView.swift | 22 +++++++++++++++++++ .../ReflectionMemberCollectionViewCell.swift | 20 +++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 93854eb6..7aee4e15 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -118,6 +118,8 @@ 52AED2DD29128532004D70B9 /* FeedbackFromMeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AED2DC29128532004D70B9 /* FeedbackFromMeModel.swift */; }; 52CD58BC297BE24B008567E0 /* ProfileImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */; }; 52DC9091291A98CC00904739 /* MyFeedbackEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52DC9090291A98CC00904739 /* MyFeedbackEditViewController.swift */; }; + 52E6770D29911E0C00A0935B /* ReflectionMemberCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E6770C29911E0C00A0935B /* ReflectionMemberCollectionViewCell.swift */; }; + 52E6770F29911E3E00A0935B /* ReflectionMemberCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E6770E29911E3E00A0935B /* ReflectionMemberCollectionView.swift */; }; 52F07B9A2912541B0015BC8B /* MyFeedbackDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F07B992912541B0015BC8B /* MyFeedbackDetailViewController.swift */; }; 52F0CB5229178C2700E39C50 /* AlertViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F0CB5129178C2700E39C50 /* AlertViewController.swift */; }; 52F2D1C12906F172009CBF89 /* SelectReflectionMemberViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F2D1C02906F172009CBF89 /* SelectReflectionMemberViewController.swift */; }; @@ -257,6 +259,8 @@ 52AED2DC29128532004D70B9 /* FeedbackFromMeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackFromMeModel.swift; sourceTree = ""; }; 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileImageButton.swift; sourceTree = ""; }; 52DC9090291A98CC00904739 /* MyFeedbackEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackEditViewController.swift; sourceTree = ""; }; + 52E6770C29911E0C00A0935B /* ReflectionMemberCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionMemberCollectionViewCell.swift; sourceTree = ""; }; + 52E6770E29911E3E00A0935B /* ReflectionMemberCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionMemberCollectionView.swift; sourceTree = ""; }; 52F07B992912541B0015BC8B /* MyFeedbackDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackDetailViewController.swift; sourceTree = ""; }; 52F0CB5129178C2700E39C50 /* AlertViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertViewController.swift; sourceTree = ""; }; 52F2D1C02906F172009CBF89 /* SelectReflectionMemberViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectReflectionMemberViewController.swift; sourceTree = ""; }; @@ -909,6 +913,15 @@ path = MyFeedbackEdit; sourceTree = ""; }; + 52E6770B29911DF400A0935B /* ReflectionMember */ = { + isa = PBXGroup; + children = ( + 52E6770C29911E0C00A0935B /* ReflectionMemberCollectionViewCell.swift */, + 52E6770E29911E3E00A0935B /* ReflectionMemberCollectionView.swift */, + ); + path = ReflectionMember; + sourceTree = ""; + }; 52F07B98291253D30015BC8B /* MyFeedbackDetail */ = { isa = PBXGroup; children = ( @@ -928,6 +941,7 @@ 52F2D1BF2906F157009CBF89 /* SelectReflectionMember */ = { isa = PBXGroup; children = ( + 52E6770B29911DF400A0935B /* ReflectionMember */, 52F2D1C02906F172009CBF89 /* SelectReflectionMemberViewController.swift */, ); path = SelectReflectionMember; @@ -1113,6 +1127,7 @@ 7E8CDC67292E19B000984742 /* SettingButton.swift in Sources */, 39F5582B2908027500CD6F6E /* UIDevice+Extension.swift in Sources */, 395C7E1328F9841A00FC2FCA /* SizeLiteral.swift in Sources */, + 52E6770F29911E3E00A0935B /* ReflectionMemberCollectionView.swift in Sources */, 3EB508902917525600FB77CB /* EmptyReflectionView.swift in Sources */, 3EB5088E2916D05F00FB77CB /* EmptyFeedbackView.swift in Sources */, 391596622904176500A432D9 /* UIView+Extension.swift in Sources */, @@ -1138,6 +1153,7 @@ 395C7E0B28F9550A00FC2FCA /* NSObject+Extension.swift in Sources */, D7E101392942380900CEC7F0 /* AddFeedbackDetailViewController.swift in Sources */, D7505119294239A5001BDA34 /* SelectMemberView.swift in Sources */, + 52E6770D29911E0C00A0935B /* ReflectionMemberCollectionViewCell.swift in Sources */, 39F909D7292679C400DAD0A3 /* EditFeedBackDTO.swift in Sources */, D79D908E29041F42004DDC4A /* CreateTeamViewController.swift in Sources */, 3E557FFD2901CD7400714E46 /* Keyword.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift new file mode 100644 index 00000000..a82b7f9c --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -0,0 +1,22 @@ +// +// ReflectionMemberCollectionView.swift +// Maddori.Apple +// +// Created by 김유나 on 2023/02/06. +// + +import UIKit + +import SnapKit + +final class ReflectionMemberCollectionView: UIView { + + // MARK: - property + + // MARK: - life cycle + + // MARK: - func + +} + +// MARK: - extension diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift new file mode 100644 index 00000000..9f462281 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -0,0 +1,20 @@ +// +// ReflectionMemberCollectionViewCell.swift +// Maddori.Apple +// +// Created by 김유나 on 2023/02/06. +// + +import UIKit + +import SnapKit + +final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { + + // MARK: - property + + // MARK: - life cycle + + // MARK: - func + +} From fa860ea082d6a805885d0bbf1535bee87db0d3fa Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 20:49:37 +0900 Subject: [PATCH 103/388] =?UTF-8?q?[ADD]=20ReflectionMemberCollectionViewC?= =?UTF-8?q?ell=20=EC=99=84=EC=84=B1(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionViewCell.swift | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index 9f462281..e6db0228 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -13,8 +13,53 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { // MARK: - property + private let profileImage: UIImageView = { + let imageView = UIImageView() + imageView.image = ImageLiterals.imgProfileNone + imageView.layer.cornerRadius = 23 + return imageView + }() + private let nicknameLabel: UILabel = { + let label = UILabel() + label.text = "진구" + label.textColor = .gray600 + label.font = .label2 + return label + }() + private let roleLabel: UILabel = { + let label = UILabel() + label.text = "PM / 개발자 / 디자이너" + label.textColor = .gray400 + label.font = .caption2 + return label + }() + // MARK: - life cycle - // MARK: - func + override func render() { + self.addSubview(profileImage) + profileImage.snp.makeConstraints { + $0.top.equalToSuperview().inset(27) + $0.centerX.equalToSuperview() + $0.width.height.equalTo(46) + } + + self.addSubview(nicknameLabel) + nicknameLabel.snp.makeConstraints { + $0.top.equalTo(profileImage.snp.bottom).offset(12) + $0.centerX.equalToSuperview() + } + + self.addSubview(roleLabel) + roleLabel.snp.makeConstraints { + $0.top.equalTo(nicknameLabel.snp.bottom).offset(4) + $0.centerX.equalToSuperview() + } + } + override func configUI() { + self.backgroundColor = .white300 + self.layer.cornerRadius = 8 + self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 4) + } } From 279eaf6a5dda30319a537542f06136cd798d166a Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 21:14:03 +0900 Subject: [PATCH 104/388] =?UTF-8?q?[ADD]=20ReflectionMemberCollectionView?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionView.swift | 66 ++++++++++++++++++- .../ReflectionMemberCollectionViewCell.swift | 3 +- 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index a82b7f9c..8b730df1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -11,12 +11,74 @@ import SnapKit final class ReflectionMemberCollectionView: UIView { + private enum Size { + static let collectionHorizontalSpacing: CGFloat = 34 + static let collectionVerticalSpacing: CGFloat = 20 + static let cellLength: CGFloat = 140 + static let cellSpacing: CGFloat = 28 + static let collectionInsets = UIEdgeInsets( + top: collectionVerticalSpacing, + left: collectionHorizontalSpacing, + bottom: collectionVerticalSpacing, + right: collectionHorizontalSpacing) + } + + var memberList: [MemberResponse] = [] { + didSet { + collectionView.reloadData() + } + } + // MARK: - property - // MARK: - life cycle + private let collectionViewFlowLayout: UICollectionViewFlowLayout = { + let flowLayout = UICollectionViewFlowLayout() + flowLayout.scrollDirection = .vertical + flowLayout.sectionInset = Size.collectionInsets + flowLayout.itemSize = CGSize(width: Size.cellLength, height: Size.cellLength) + flowLayout.minimumInteritemSpacing = Size.cellSpacing + return flowLayout + }() + private lazy var collectionView: UICollectionView = { + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewFlowLayout) + collectionView.dataSource = self + collectionView.delegate = self + collectionView.showsVerticalScrollIndicator = false + collectionView.register(ReflectionMemberCollectionViewCell.self, forCellWithReuseIdentifier: ReflectionMemberCollectionViewCell.className) + return collectionView + }() - // MARK: - func + // MARK: - life cycle + private func render() { + self.addSubview(collectionView) + collectionView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } } // MARK: - extension + +extension ReflectionMemberCollectionView: UICollectionViewDelegate { + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + + } +} + +extension ReflectionMemberCollectionView: UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return memberList.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: ReflectionMemberCollectionViewCell.className, for: indexPath) as? ReflectionMemberCollectionViewCell else { + assert(false, "Wrong Cell") + return UICollectionViewCell() + } + + cell.nicknameLabel.text = memberList[indexPath.item].userName + + return cell + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index e6db0228..a4667eb8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -19,9 +19,8 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { imageView.layer.cornerRadius = 23 return imageView }() - private let nicknameLabel: UILabel = { + let nicknameLabel: UILabel = { let label = UILabel() - label.text = "진구" label.textColor = .gray600 label.font = .label2 return label From db94c17e13ef7466083167afbc7fb55aa2f7e94f Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 21:47:12 +0900 Subject: [PATCH 105/388] =?UTF-8?q?[ADD]=20CollectionView=20=EB=B0=B0?= =?UTF-8?q?=EC=B9=98(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/TextLiteral.swift | 2 +- .../Global/Supports/SceneDelegate.swift | 2 +- .../ReflectionMemberCollectionView.swift | 14 +++- .../ReflectionMemberCollectionViewCell.swift | 2 +- ...SelectReflectionMemberViewController.swift | 64 ++++++++++--------- 5 files changed, 48 insertions(+), 36 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index eb548db3..36d09ba6 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -127,7 +127,7 @@ enum TextLiteral { // MARK: - SelectReflectionMemberViewController static let selectReflectionMemberViewControllerTitleLabel = "각 팀원이 받은 피드백을\n공유해 보세요" - static let selectReflectionMemberViewControllerDoneButtonText = "모든 회고 끝내기" + static let selectReflectionMemberViewControllerDoneButtonText = "모든 회고 끝내기 " // MARK: - InProgressViewController diff --git a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift index 2aa4fc54..f77f7346 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift @@ -23,7 +23,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if isLogined { rootViewController = CustomTabBarController() } else { - rootViewController = UINavigationController(rootViewController: LoginViewController()) + rootViewController = CustomTabBarController() } window?.rootViewController = rootViewController window?.makeKeyAndVisible() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 8b730df1..1d2d223c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -15,7 +15,8 @@ final class ReflectionMemberCollectionView: UIView { static let collectionHorizontalSpacing: CGFloat = 34 static let collectionVerticalSpacing: CGFloat = 20 static let cellLength: CGFloat = 140 - static let cellSpacing: CGFloat = 28 + static let cellInteritemSpacingSpacing: CGFloat = 27 + static let cellLineSpacing: CGFloat = 20 static let collectionInsets = UIEdgeInsets( top: collectionVerticalSpacing, left: collectionHorizontalSpacing, @@ -36,13 +37,15 @@ final class ReflectionMemberCollectionView: UIView { flowLayout.scrollDirection = .vertical flowLayout.sectionInset = Size.collectionInsets flowLayout.itemSize = CGSize(width: Size.cellLength, height: Size.cellLength) - flowLayout.minimumInteritemSpacing = Size.cellSpacing + flowLayout.minimumInteritemSpacing = Size.cellInteritemSpacingSpacing + flowLayout.minimumLineSpacing = Size.cellLineSpacing return flowLayout }() private lazy var collectionView: UICollectionView = { let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewFlowLayout) collectionView.dataSource = self collectionView.delegate = self + collectionView.backgroundColor = .white200 collectionView.showsVerticalScrollIndicator = false collectionView.register(ReflectionMemberCollectionViewCell.self, forCellWithReuseIdentifier: ReflectionMemberCollectionViewCell.className) return collectionView @@ -50,6 +53,13 @@ final class ReflectionMemberCollectionView: UIView { // MARK: - life cycle + init() { + super.init(frame: .zero) + render() + } + + required init?(coder: NSCoder) { nil } + private func render() { self.addSubview(collectionView) collectionView.snp.makeConstraints { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index a4667eb8..975de3ed 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -59,6 +59,6 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { override func configUI() { self.backgroundColor = .white300 self.layer.cornerRadius = 8 - self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 4) + self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 2) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index 7246c0b1..8314af3a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -39,19 +39,20 @@ final class SelectReflectionMemberViewController: BaseViewController { label.setTitleFont(text: TextLiteral.selectReflectionMemberViewControllerTitleLabel) return label }() - private lazy var memberCollectionView: MemberCollectionView = { - let collectionView = MemberCollectionView(type: .progressReflection) - collectionView.didTappedFeedBackMember = { [weak self] _ in - let member = collectionView.selectedMember - guard let id = member?.userId, - let username = member?.userName, - let reflectionId = self?.reflectionId - else { return } - let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) - self?.navigationController?.pushViewController(viewController, animated: true) - } - return collectionView - }() +// private lazy var memberCollectionView: MemberCollectionView = { +// let collectionView = MemberCollectionView(type: .progressReflection) +// collectionView.didTappedFeedBackMember = { [weak self] _ in +// let member = collectionView.selectedMember +// guard let id = member?.userId, +// let username = member?.userName, +// let reflectionId = self?.reflectionId +// else { return } +// let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) +// self?.navigationController?.pushViewController(viewController, animated: true) +// } +// return collectionView +// }() + private let memberCollectionView = ReflectionMemberCollectionView() private lazy var feedbackDoneButton: MainButton = { let button = MainButton() let action = UIAction { [weak self] _ in @@ -73,7 +74,7 @@ final class SelectReflectionMemberViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - didTappedMember() +// didTappedMember() fetchTeamMembers(type: .fetchTeamMembers) setupPreviousStatus() } @@ -90,18 +91,18 @@ final class SelectReflectionMemberViewController: BaseViewController { $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } - view.addSubview(memberCollectionView) - memberCollectionView.snp.makeConstraints { - $0.top.equalTo(selectFeedbackMemberTitleLabel.snp.bottom) - $0.bottom.equalTo(view.safeAreaLayoutGuide) - $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - } - view.addSubview(feedbackDoneButton) feedbackDoneButton.snp.makeConstraints { $0.bottom.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.bottomPadding) $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + + view.addSubview(memberCollectionView) + memberCollectionView.snp.makeConstraints { + $0.top.equalTo(selectFeedbackMemberTitleLabel.snp.bottom).offset(20) + $0.bottom.equalTo(feedbackDoneButton.snp.top).inset(-6) + $0.leading.trailing.equalToSuperview() + } } // MARK: - func @@ -126,15 +127,15 @@ final class SelectReflectionMemberViewController: BaseViewController { UserDefaultHandler.setHasSeenAlert(to: false) } - private func didTappedMember() { - memberCollectionView.didTappedMember = { [weak self] member in - guard let memberCollectionView = self?.memberCollectionView else { return } - self?.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\( memberCollectionView.selectedMemberIdList.count)/\(memberCollectionView.memberList.count))" - if member.count == self?.memberCollectionView.memberList.count { - self?.feedbackDoneButton.isDisabled = false - } - } - } +// private func didTappedMember() { +// memberCollectionView.didTappedMember = { [weak self] member in +// guard let memberCollectionView = self?.memberCollectionView else { return } +// self?.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\( memberCollectionView.selectedMemberIdList.count)/\(memberCollectionView.memberList.count))" +// if member.count == self?.memberCollectionView.memberList.count { +// self?.feedbackDoneButton.isDisabled = false +// } +// } +// } // MARK: - api @@ -147,7 +148,8 @@ final class SelectReflectionMemberViewController: BaseViewController { guard let fetchedMemberList = json.detail?.members else { return } DispatchQueue.main.async { self.memberCollectionView.memberList = fetchedMemberList - self.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\(self.memberCollectionView.selectedMemberIdList.count)/\(self.memberCollectionView.memberList.count))" +// self.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\(self.memberCollectionView.selectedMemberIdList.count)/\(self.memberCollectionView.memberList.count))" + print(fetchedMemberList) } } } From da17cc50fa82fabf608f06ce0de74c208e4cb890 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 22:07:27 +0900 Subject: [PATCH 106/388] =?UTF-8?q?[ADD]=20isSelected=20=EA=B5=AC=ED=98=84?= =?UTF-8?q?(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionView.swift | 1 + .../ReflectionMemberCollectionViewCell.swift | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 1d2d223c..6d7d4d2f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -47,6 +47,7 @@ final class ReflectionMemberCollectionView: UIView { collectionView.delegate = self collectionView.backgroundColor = .white200 collectionView.showsVerticalScrollIndicator = false + collectionView.allowsMultipleSelection = true collectionView.register(ReflectionMemberCollectionViewCell.self, forCellWithReuseIdentifier: ReflectionMemberCollectionViewCell.className) return collectionView }() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index 975de3ed..6acab308 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -11,6 +11,16 @@ import SnapKit final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { + override var isSelected: Bool { + didSet { + if isSelected { + applyAttribute() + } else { + resetAttribute() + } + } + } + // MARK: - property private let profileImage: UIImageView = { @@ -61,4 +71,22 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { self.layer.cornerRadius = 8 self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 2) } + + // MARK: - func + + private func applyAttribute() { + self.backgroundColor = .white100 + self.profileImage.layer.opacity = 0.5 + self.nicknameLabel.textColor = .gray300 + self.roleLabel.textColor = .gray300 + self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 1) + } + + private func resetAttribute() { + self.backgroundColor = .white300 + self.profileImage.layer.opacity = 1 + self.nicknameLabel.textColor = .gray600 + self.roleLabel.textColor = .gray400 + self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 2) + } } From 2b595caad559d769af510e6c30dfb124cceddb02 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 22:31:57 +0900 Subject: [PATCH 107/388] =?UTF-8?q?[ADD]=20=EC=84=A0=ED=83=9D=ED=95=9C=20?= =?UTF-8?q?=EB=A9=A4=EB=B2=84=20reflection=20view=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionView.swift | 3 +- ...SelectReflectionMemberViewController.swift | 57 +++++++++++-------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 6d7d4d2f..27f0e7b4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -29,6 +29,7 @@ final class ReflectionMemberCollectionView: UIView { collectionView.reloadData() } } + var didTappedMember: ((MemberResponse) -> ())? // MARK: - property @@ -73,7 +74,7 @@ final class ReflectionMemberCollectionView: UIView { extension ReflectionMemberCollectionView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - + didTappedMember?(memberList[indexPath.item]) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index 8314af3a..abd0bd66 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -11,7 +11,7 @@ import Alamofire import SnapKit final class SelectReflectionMemberViewController: BaseViewController { - + let reflectionId: Int let isAdmin: Bool @@ -39,19 +39,19 @@ final class SelectReflectionMemberViewController: BaseViewController { label.setTitleFont(text: TextLiteral.selectReflectionMemberViewControllerTitleLabel) return label }() -// private lazy var memberCollectionView: MemberCollectionView = { -// let collectionView = MemberCollectionView(type: .progressReflection) -// collectionView.didTappedFeedBackMember = { [weak self] _ in -// let member = collectionView.selectedMember -// guard let id = member?.userId, -// let username = member?.userName, -// let reflectionId = self?.reflectionId -// else { return } -// let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) -// self?.navigationController?.pushViewController(viewController, animated: true) -// } -// return collectionView -// }() + // private lazy var memberCollectionView: MemberCollectionView = { + // let collectionView = MemberCollectionView(type: .progressReflection) + // collectionView.didTappedFeedBackMember = { [weak self] _ in + // let member = collectionView.selectedMember + // guard let id = member?.userId, + // let username = member?.userName, + // let reflectionId = self?.reflectionId + // else { return } + // let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) + // self?.navigationController?.pushViewController(viewController, animated: true) + // } + // return collectionView + // }() private let memberCollectionView = ReflectionMemberCollectionView() private lazy var feedbackDoneButton: MainButton = { let button = MainButton() @@ -74,7 +74,7 @@ final class SelectReflectionMemberViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() -// didTappedMember() + didTappedMember() fetchTeamMembers(type: .fetchTeamMembers) setupPreviousStatus() } @@ -127,15 +127,24 @@ final class SelectReflectionMemberViewController: BaseViewController { UserDefaultHandler.setHasSeenAlert(to: false) } -// private func didTappedMember() { -// memberCollectionView.didTappedMember = { [weak self] member in -// guard let memberCollectionView = self?.memberCollectionView else { return } -// self?.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\( memberCollectionView.selectedMemberIdList.count)/\(memberCollectionView.memberList.count))" -// if member.count == self?.memberCollectionView.memberList.count { -// self?.feedbackDoneButton.isDisabled = false -// } -// } -// } + // private func didTappedMember() { + // memberCollectionView.didTappedMember = { [weak self] member in + // guard let memberCollectionView = self?.memberCollectionView else { return } + // self?.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\( memberCollectionView.selectedMemberIdList.count)/\(memberCollectionView.memberList.count))" + // if member.count == self?.memberCollectionView.memberList.count { + // self?.feedbackDoneButton.isDisabled = false + // } + // } + // } + private func didTappedMember() { + memberCollectionView.didTappedMember = { [weak self] member in + guard let id = member.userId, + let username = member.userName, + let reflectionId = self?.reflectionId else { return } + let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) + self?.navigationController?.pushViewController(viewController, animated: true) + } + } // MARK: - api From c8d8832832ea6e503e6427cd93c7a8e9fe9391a7 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 22:34:14 +0900 Subject: [PATCH 108/388] =?UTF-8?q?[ADD]=20isAdmin=20=EC=82=AD=EC=A0=9C(#3?= =?UTF-8?q?04)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 4 ++-- .../SelectReflectionMemberViewController.swift | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 2af1dc6c..370b9a82 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -226,7 +226,7 @@ final class HomeViewController: BaseViewController { } private func presentSelectReflectionMemberViewController() { - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: self.isAdmin)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId)) viewController.modalPresentationStyle = .fullScreen present(viewController, animated: true) } @@ -398,7 +398,7 @@ extension HomeViewController: UICollectionViewDataSource { didTapAddFeedbackButton() case .Progressing: guard let navigationController = self.navigationController else { return } - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: isAdmin)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId)) viewController.modalPresentationStyle = .fullScreen navigationController.present(viewController, animated: true) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index abd0bd66..cd4addec 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -13,11 +13,9 @@ import SnapKit final class SelectReflectionMemberViewController: BaseViewController { let reflectionId: Int - let isAdmin: Bool - init(reflectionId: Int, isAdmin: Bool) { + init(reflectionId: Int) { self.reflectionId = reflectionId - self.isAdmin = isAdmin super.init() } @@ -57,12 +55,7 @@ final class SelectReflectionMemberViewController: BaseViewController { let button = MainButton() let action = UIAction { [weak self] _ in guard let reflectionId = self?.reflectionId else { return } - guard let isAdmin = self?.isAdmin else { return } - if isAdmin { - self?.patchEndReflection(type: .patchEndReflection(reflectionId: reflectionId)) - } else { - self?.dismiss(animated: true) - } + self?.patchEndReflection(type: .patchEndReflection(reflectionId: reflectionId)) self?.resetHasSeenAlert() } button.addAction(action, for: .touchUpInside) From 23986a7b76896b97a253d113f9decb20a5b46059 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 23:15:39 +0900 Subject: [PATCH 109/388] =?UTF-8?q?[ADD]=20=EC=A7=84=ED=96=89=EB=90=9C=20r?= =?UTF-8?q?eflection=20member=20=EC=A0=80=EC=9E=A5=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionView.swift | 14 ++++++++++++-- .../SelectReflectionMemberViewController.swift | 12 +++++++++--- .../StartReflectionViewController.swift | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 27f0e7b4..de0453e0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -29,7 +29,12 @@ final class ReflectionMemberCollectionView: UIView { collectionView.reloadData() } } - var didTappedMember: ((MemberResponse) -> ())? + var didTappedMember: ((MemberResponse, [Int]) -> ())? + var selectedMemberList: [Int] = UserDefaultStorage.seenMemberIdList { + willSet { + UserDefaultHandler.appendSeenMemberIdList(memberIdList: newValue) + } + } // MARK: - property @@ -74,7 +79,12 @@ final class ReflectionMemberCollectionView: UIView { extension ReflectionMemberCollectionView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - didTappedMember?(memberList[indexPath.item]) + let selectedMember = memberList[indexPath.item] + if !selectedMemberList.contains(where: { $0 == selectedMember.userId }) { + selectedMemberList.append(selectedMember.userId ?? 0) + } + didTappedMember?(selectedMember, selectedMemberList) + print(selectedMember, selectedMemberList) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index cd4addec..99cbd39e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -130,12 +130,19 @@ final class SelectReflectionMemberViewController: BaseViewController { // } // } private func didTappedMember() { - memberCollectionView.didTappedMember = { [weak self] member in + memberCollectionView.didTappedMember = { [weak self] member, members in guard let id = member.userId, let username = member.userName, let reflectionId = self?.reflectionId else { return } let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) self?.navigationController?.pushViewController(viewController, animated: true) + + guard let memberCollectionView = self?.memberCollectionView else { return } + self?.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\( members.count)/\(memberCollectionView.memberList.count))" + + if members.count == memberCollectionView.memberList.count { + self?.feedbackDoneButton.isDisabled = false + } } } @@ -150,8 +157,7 @@ final class SelectReflectionMemberViewController: BaseViewController { guard let fetchedMemberList = json.detail?.members else { return } DispatchQueue.main.async { self.memberCollectionView.memberList = fetchedMemberList -// self.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\(self.memberCollectionView.selectedMemberIdList.count)/\(self.memberCollectionView.memberList.count))" - print(fetchedMemberList) + self.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\(self.memberCollectionView.selectedMemberList.count)/\(self.memberCollectionView.memberList.count))" } } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift index 16e8d900..7d3270a8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift @@ -164,7 +164,7 @@ final class StartReflectionViewController: BaseViewController { // MARK: - func private func presentSelectReflectionMemberViewController() { - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: self.reflectionId, isAdmin: self.isAdmin)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: self.reflectionId)) viewController.modalPresentationStyle = .fullScreen self.navigationViewController.present(viewController, animated: true) } From 08367b713a6e14bd1f035fec22fbc3bcb147db48 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 23:26:46 +0900 Subject: [PATCH 110/388] =?UTF-8?q?[ADD]=20=ED=99=94=EB=A9=B4=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=ED=95=98=EA=B3=A0=20=EC=99=80=EB=8F=84=20isSelected?= =?UTF-8?q?=20=EB=B0=98=EC=98=81=EB=90=98=EB=8F=84=EB=A1=9D=20userdefault?= =?UTF-8?q?=EC=97=90=20=EB=84=A3=EA=B8=B0(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionView.swift | 7 +++- .../ReflectionMemberCollectionViewCell.swift | 2 +- ...SelectReflectionMemberViewController.swift | 37 ++++--------------- 3 files changed, 15 insertions(+), 31 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index de0453e0..266857dd 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -84,7 +84,6 @@ extension ReflectionMemberCollectionView: UICollectionViewDelegate { selectedMemberList.append(selectedMember.userId ?? 0) } didTappedMember?(selectedMember, selectedMemberList) - print(selectedMember, selectedMemberList) } } @@ -101,6 +100,12 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { cell.nicknameLabel.text = memberList[indexPath.item].userName + if let userId = memberList[indexPath.item].userId { + if selectedMemberList.contains(userId) { + cell.applyAttribute() + } + } + return cell } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index 6acab308..d73bef65 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -74,7 +74,7 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { // MARK: - func - private func applyAttribute() { + func applyAttribute() { self.backgroundColor = .white100 self.profileImage.layer.opacity = 0.5 self.nicknameLabel.textColor = .gray300 diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index 99cbd39e..f2d6af78 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -14,13 +14,6 @@ final class SelectReflectionMemberViewController: BaseViewController { let reflectionId: Int - init(reflectionId: Int) { - self.reflectionId = reflectionId - super.init() - } - - required init?(coder: NSCoder) { nil } - // MARK: - property private lazy var closeButton: CloseButton = { @@ -37,19 +30,6 @@ final class SelectReflectionMemberViewController: BaseViewController { label.setTitleFont(text: TextLiteral.selectReflectionMemberViewControllerTitleLabel) return label }() - // private lazy var memberCollectionView: MemberCollectionView = { - // let collectionView = MemberCollectionView(type: .progressReflection) - // collectionView.didTappedFeedBackMember = { [weak self] _ in - // let member = collectionView.selectedMember - // guard let id = member?.userId, - // let username = member?.userName, - // let reflectionId = self?.reflectionId - // else { return } - // let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) - // self?.navigationController?.pushViewController(viewController, animated: true) - // } - // return collectionView - // }() private let memberCollectionView = ReflectionMemberCollectionView() private lazy var feedbackDoneButton: MainButton = { let button = MainButton() @@ -65,6 +45,13 @@ final class SelectReflectionMemberViewController: BaseViewController { // MARK: - life cycle + init(reflectionId: Int) { + self.reflectionId = reflectionId + super.init() + } + + required init?(coder: NSCoder) { nil } + override func viewDidLoad() { super.viewDidLoad() didTappedMember() @@ -120,15 +107,6 @@ final class SelectReflectionMemberViewController: BaseViewController { UserDefaultHandler.setHasSeenAlert(to: false) } - // private func didTappedMember() { - // memberCollectionView.didTappedMember = { [weak self] member in - // guard let memberCollectionView = self?.memberCollectionView else { return } - // self?.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\( memberCollectionView.selectedMemberIdList.count)/\(memberCollectionView.memberList.count))" - // if member.count == self?.memberCollectionView.memberList.count { - // self?.feedbackDoneButton.isDisabled = false - // } - // } - // } private func didTappedMember() { memberCollectionView.didTappedMember = { [weak self] member, members in guard let id = member.userId, @@ -142,6 +120,7 @@ final class SelectReflectionMemberViewController: BaseViewController { if members.count == memberCollectionView.memberList.count { self?.feedbackDoneButton.isDisabled = false + UserDefaultHandler.isCurrentReflectionFinished(true) } } } From c0d4dae780d3e93ef949b6d74526a2e60747e990 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 23:35:34 +0900 Subject: [PATCH 111/388] =?UTF-8?q?[ADD]=20MemberCollectionView=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=ED=95=84=EC=9A=94=20=EC=97=86=EB=8A=94=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=20=EC=82=AD=EC=A0=9C(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberCollectionView.swift | 58 ------------------- .../MemberCollectionViewCell.swift | 24 ++------ 2 files changed, 6 insertions(+), 76 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift index 4709c146..2d7c2e54 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift @@ -13,14 +13,11 @@ final class MemberCollectionView: UIView { enum CollectionType { case addFeedback - case progressReflection var collectionHorizontalSpacing: CGFloat { switch self { case .addFeedback: return 20 - case .progressReflection: - return 14 } } @@ -28,8 +25,6 @@ final class MemberCollectionView: UIView { switch self { case .addFeedback: return 4 - case .progressReflection: - return 40 } } @@ -37,8 +32,6 @@ final class MemberCollectionView: UIView { switch self { case .addFeedback: return 133 - case .progressReflection: - return 135 } } @@ -46,8 +39,6 @@ final class MemberCollectionView: UIView { switch self { case .addFeedback: return 52 - case .progressReflection: - return 60 } } @@ -59,12 +50,6 @@ final class MemberCollectionView: UIView { left: collectionHorizontalSpacing, bottom: 4, right: collectionHorizontalSpacing) - case .progressReflection: - return UIEdgeInsets( - top: collectionTopSpacing, - left: collectionHorizontalSpacing, - bottom: 20, - right: collectionHorizontalSpacing) } } @@ -72,8 +57,6 @@ final class MemberCollectionView: UIView { switch self { case .addFeedback: return .white100 - case .progressReflection: - return .white300 } } @@ -81,8 +64,6 @@ final class MemberCollectionView: UIView { switch self { case .addFeedback: return .white200 - case .progressReflection: - return .white100 } } @@ -90,8 +71,6 @@ final class MemberCollectionView: UIView { switch self { case .addFeedback: return 20 - case .progressReflection: - return 30 } } @@ -99,28 +78,18 @@ final class MemberCollectionView: UIView { switch self { case .addFeedback: return .main - case .progressReflection: - return .label1 } } } var type: CollectionType - var currentToUserId = 0 var memberList: [MemberResponse] = [] { didSet { collectionView.reloadData() } } - var didTappedMember: (([MemberResponse]) -> ())? var didTappedFeedBackMember: ((MemberResponse) -> ())? var selectedMember: MemberResponse? - private var selectedMemberList: [MemberResponse] = [] - var selectedMemberIdList: [Int] = UserDefaultStorage.seenMemberIdList { - willSet { - UserDefaultHandler.appendSeenMemberIdList(memberIdList: newValue) - } - } // MARK: - property @@ -169,24 +138,6 @@ extension MemberCollectionView: UICollectionViewDelegate { selectedMember = memberList[indexPath.item] guard let member = selectedMember else { return } didTappedFeedBackMember?(member) - - case .progressReflection: - let selectedItem: MemberResponse = memberList[indexPath.item] - if !selectedMemberList.contains(where: { $0.userName == selectedItem.userName } ) { - selectedMemberList.append(selectedItem) - } - if !selectedMemberIdList.contains(where: { $0 == selectedItem.userId }) { - selectedMemberIdList.append(selectedItem.userId ?? 0) - } - if selectedMemberIdList.count == memberList.count { - UserDefaultHandler.isCurrentReflectionFinished(true) - } - guard let cell = collectionView.cellForItem(at: indexPath) as? MemberCollectionViewCell else { return } - selectedMember = memberList[indexPath.item] - guard let member = selectedMember else { return } - cell.setupAttribute() - didTappedMember?(selectedMemberList) - didTappedFeedBackMember?(member) } } } @@ -202,16 +153,9 @@ extension MemberCollectionView: UICollectionViewDataSource { return UICollectionViewCell() } cell.memberLabel.text = memberList[indexPath.item].userName - if let userId = memberList[indexPath.item].userId { - if type == .progressReflection && selectedMemberIdList.contains(userId) { - cell.setupAttribute() - } - } switch type { case .addFeedback: cell.index = FromCellIndex.fromAddFeedback - case .progressReflection: - cell.index = FromCellIndex.fromSelectMember } cell.cellColor = type.cellColor @@ -221,8 +165,6 @@ extension MemberCollectionView: UICollectionViewDataSource { } } - enum FromCellIndex { case fromAddFeedback - case fromSelectMember } diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift index dfa58df5..7017f3f3 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift @@ -11,7 +11,7 @@ import SnapKit final class MemberCollectionViewCell: BaseCollectionViewCell { - var index: FromCellIndex = .fromSelectMember + var index: FromCellIndex = .fromAddFeedback var cellColor: UIColor = .white300 { didSet { @@ -21,16 +21,10 @@ final class MemberCollectionViewCell: BaseCollectionViewCell { override var isSelected: Bool { didSet { - if index == FromCellIndex.fromAddFeedback { - if isSelected { - applyAttribute() - } - else { - resetAttribute() - } - } - else { - setupAttribute() + if isSelected { + applyAttribute() + } else { + resetAttribute() } } } @@ -63,7 +57,7 @@ final class MemberCollectionViewCell: BaseCollectionViewCell { memberShadow.snp.makeConstraints { $0.edges.equalToSuperview() } - + memberShadow.addSubview(memberLabel) memberLabel.snp.makeConstraints { $0.edges.equalToSuperview() @@ -72,12 +66,6 @@ final class MemberCollectionViewCell: BaseCollectionViewCell { // MARK: - func - func setupAttribute() { - memberLabel.textColor = .gray300 - memberLabel.backgroundColor = .white100 - memberShadow.layer.shadowRadius = 1 - } - private func applyAttribute() { if isSelected { memberLabel.layer.borderWidth = 2 From 09f1cb22177612bb491b7edec196a5bb9bd7b50d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Feb 2023 23:43:44 +0900 Subject: [PATCH 112/388] =?UTF-8?q?[ADD]=20pr=20=EB=B6=84=EB=A6=AC?= =?UTF-8?q?=EB=A5=BC=20=EC=9C=84=ED=95=B4=20isAdmin=20=EB=B3=B5=EA=B5=AC(#?= =?UTF-8?q?304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 4 ++-- .../SelectReflectionMemberViewController.swift | 11 +++++++++-- .../StartReflectionViewController.swift | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 370b9a82..1e7d22fa 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -226,7 +226,7 @@ final class HomeViewController: BaseViewController { } private func presentSelectReflectionMemberViewController() { - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: isAdmin)) viewController.modalPresentationStyle = .fullScreen present(viewController, animated: true) } @@ -398,7 +398,7 @@ extension HomeViewController: UICollectionViewDataSource { didTapAddFeedbackButton() case .Progressing: guard let navigationController = self.navigationController else { return } - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: isAdmin)) viewController.modalPresentationStyle = .fullScreen navigationController.present(viewController, animated: true) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index f2d6af78..ef97593d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -13,6 +13,7 @@ import SnapKit final class SelectReflectionMemberViewController: BaseViewController { let reflectionId: Int + let isAdmin: Bool // MARK: - property @@ -35,7 +36,12 @@ final class SelectReflectionMemberViewController: BaseViewController { let button = MainButton() let action = UIAction { [weak self] _ in guard let reflectionId = self?.reflectionId else { return } - self?.patchEndReflection(type: .patchEndReflection(reflectionId: reflectionId)) + guard let isAdmin = self?.isAdmin else { return } + if isAdmin { + self?.patchEndReflection(type: .patchEndReflection(reflectionId: reflectionId)) + } else { + self?.dismiss(animated: true) + } self?.resetHasSeenAlert() } button.addAction(action, for: .touchUpInside) @@ -45,8 +51,9 @@ final class SelectReflectionMemberViewController: BaseViewController { // MARK: - life cycle - init(reflectionId: Int) { + init(reflectionId: Int, isAdmin: Bool) { self.reflectionId = reflectionId + self.isAdmin = isAdmin super.init() } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift index 7d3270a8..16e8d900 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift @@ -164,7 +164,7 @@ final class StartReflectionViewController: BaseViewController { // MARK: - func private func presentSelectReflectionMemberViewController() { - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: self.reflectionId)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: self.reflectionId, isAdmin: self.isAdmin)) viewController.modalPresentationStyle = .fullScreen self.navigationViewController.present(viewController, animated: true) } From 0961f82c86420b5f1c0359a4de11f80e959e0e9d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 7 Feb 2023 00:11:15 +0900 Subject: [PATCH 113/388] =?UTF-8?q?[CHORE]=20SceneDelegate=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD,=20Fixme=20=EC=A3=BC=EC=84=9D=20=EC=B6=94=EA=B0=80(#3?= =?UTF-8?q?04)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift | 2 +- .../ReflectionMember/ReflectionMemberCollectionView.swift | 1 + .../SelectReflectionMemberViewController.swift | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift index f77f7346..2aa4fc54 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Supports/SceneDelegate.swift @@ -23,7 +23,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if isLogined { rootViewController = CustomTabBarController() } else { - rootViewController = CustomTabBarController() + rootViewController = UINavigationController(rootViewController: LoginViewController()) } window?.rootViewController = rootViewController window?.makeKeyAndVisible() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 266857dd..b4fe0b83 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -99,6 +99,7 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { } cell.nicknameLabel.text = memberList[indexPath.item].userName + // FIXME: - profile image, role 추가 if let userId = memberList[indexPath.item].userId { if selectedMemberList.contains(userId) { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index ef97593d..97ee86ab 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -133,6 +133,7 @@ final class SelectReflectionMemberViewController: BaseViewController { } // MARK: - api + // FIXME: - fetchTeamMembers, patchEndReflection v2 api 로 변경하기 private func fetchTeamMembers(type: InProgressEndPoint) { AF.request(type.address, From 5bc128a2b7ea9ac73128ef1012ae590d9663043a Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 7 Feb 2023 00:25:47 +0900 Subject: [PATCH 114/388] =?UTF-8?q?[ADD]=20MemberCollectionView=20enum=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberCollectionView.swift | 113 ++++-------------- .../MemberCollectionViewCell.swift | 11 +- .../UIComponent/SelectMemberView.swift | 2 +- 3 files changed, 23 insertions(+), 103 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift index 2d7c2e54..5a9b52d6 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift @@ -11,78 +11,19 @@ import SnapKit final class MemberCollectionView: UIView { - enum CollectionType { - case addFeedback - - var collectionHorizontalSpacing: CGFloat { - switch self { - case .addFeedback: - return 20 - } - } - - var collectionTopSpacing: CGFloat { - switch self { - case .addFeedback: - return 4 - } - } - - var cellWidth: CGFloat { - switch self { - case .addFeedback: - return 133 - } - } - - var cellHeight: CGFloat { - switch self { - case .addFeedback: - return 52 - } - } - - var collectionInsets: UIEdgeInsets { - switch self { - case .addFeedback: - return UIEdgeInsets( - top: collectionTopSpacing, - left: collectionHorizontalSpacing, - bottom: 4, - right: collectionHorizontalSpacing) - } - } - - var cellColor: UIColor { - switch self { - case .addFeedback: - return .white100 - } - } - - var collectionViewBackgroudColor: UIColor { - switch self { - case .addFeedback: - return .white200 - } - } - - var cellSpacing: CGFloat { - switch self { - case .addFeedback: - return 20 - } - } - - var cellFont: UIFont { - switch self { - case .addFeedback: - return .main - } - } + private enum Size { + static let collectionHorizontalSpacing: CGFloat = 20 + static let collectionVerticalSpacing: CGFloat = 4 + static let cellWidth: CGFloat = 133 + static let cellHeight: CGFloat = 52 + static let cellSpacing: CGFloat = 20 + static let collectionInsets: UIEdgeInsets = UIEdgeInsets( + top: collectionVerticalSpacing, + left: collectionHorizontalSpacing, + bottom: collectionVerticalSpacing, + right: collectionHorizontalSpacing) } - var type: CollectionType var memberList: [MemberResponse] = [] { didSet { collectionView.reloadData() @@ -96,14 +37,14 @@ final class MemberCollectionView: UIView { private lazy var collectionViewFlowLayout: UICollectionViewFlowLayout = { let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical - flowLayout.sectionInset = type.collectionInsets - flowLayout.itemSize = CGSize(width: type.cellWidth, height: type.cellHeight) - flowLayout.minimumLineSpacing = type.cellSpacing + flowLayout.sectionInset = Size.collectionInsets + flowLayout.itemSize = CGSize(width: Size.cellWidth, height: Size.cellHeight) + flowLayout.minimumLineSpacing = Size.cellSpacing return flowLayout }() private lazy var collectionView: UICollectionView = { let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewFlowLayout) - collectionView.backgroundColor = type.collectionViewBackgroudColor + collectionView.backgroundColor = .white200 collectionView.dataSource = self collectionView.delegate = self collectionView.showsVerticalScrollIndicator = false @@ -113,8 +54,7 @@ final class MemberCollectionView: UIView { // MARK: - life cycle - init(type: CollectionType) { - self.type = type + init() { super.init(frame: .zero) render() } @@ -133,12 +73,9 @@ final class MemberCollectionView: UIView { extension MemberCollectionView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - switch type { - case .addFeedback: - selectedMember = memberList[indexPath.item] - guard let member = selectedMember else { return } - didTappedFeedBackMember?(member) - } + selectedMember = memberList[indexPath.item] + guard let member = selectedMember else { return } + didTappedFeedBackMember?(member) } } @@ -152,19 +89,9 @@ extension MemberCollectionView: UICollectionViewDataSource { assert(false, "Wrong Cell") return UICollectionViewCell() } - cell.memberLabel.text = memberList[indexPath.item].userName - switch type { - case .addFeedback: - cell.index = FromCellIndex.fromAddFeedback - } - cell.cellColor = type.cellColor - cell.memberLabel.font = type.cellFont + cell.memberLabel.text = memberList[indexPath.item].userName return cell } } - -enum FromCellIndex { - case fromAddFeedback -} diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift index 7017f3f3..06c03961 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift @@ -11,14 +11,6 @@ import SnapKit final class MemberCollectionViewCell: BaseCollectionViewCell { - var index: FromCellIndex = .fromAddFeedback - - var cellColor: UIColor = .white300 { - didSet { - memberLabel.backgroundColor = cellColor - } - } - override var isSelected: Bool { didSet { if isSelected { @@ -33,11 +25,12 @@ final class MemberCollectionViewCell: BaseCollectionViewCell { let memberLabel: UILabel = { let label = UILabel() - label.font = .label1 + label.font = .main label.textColor = .black100 label.layer.masksToBounds = true label.layer.cornerRadius = 8 label.textAlignment = .center + label.backgroundColor = .white100 return label }() private lazy var memberShadow: UIView = { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift index aedef5b0..079cc3d4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift @@ -59,7 +59,7 @@ final class SelectMemberView: UIStackView { return imageView }() lazy var memberCollectionView: MemberCollectionView = { - let collectionView = MemberCollectionView(type: .addFeedback) + let collectionView = MemberCollectionView() collectionView.didTappedFeedBackMember = { [weak self] user in self?.didSelectedMemeber?(user) self?.isSelectedMember?(true) From 20994289a54c5fa721777f9359270114fd7a20a5 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 7 Feb 2023 00:28:35 +0900 Subject: [PATCH 115/388] =?UTF-8?q?[CHORE]=20Home=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EB=90=9C=20=EA=B1=B0=20=EB=B3=B5=EA=B5=AC(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 1e7d22fa..2af1dc6c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -226,7 +226,7 @@ final class HomeViewController: BaseViewController { } private func presentSelectReflectionMemberViewController() { - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: isAdmin)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: self.isAdmin)) viewController.modalPresentationStyle = .fullScreen present(viewController, animated: true) } From 484691f9a792f012e87cb26b02b46451fc3de1c0 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 13:46:43 +0900 Subject: [PATCH 116/388] =?UTF-8?q?[ADD]=20=EB=A9=A4=EB=B2=84=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20cell=20=EC=B6=94=EA=B0=80=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 +++++++ .../Cell/TeamDetailMembersCell.swift | 30 ++++++++++++++++ .../UIComponent/TeamDetailMembersView.swift | 34 +++++++++++++++++-- 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 1bf3b789..79e70d8e 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -23,6 +23,7 @@ 39257DF528F93E4700201E0B /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DF428F93E4700201E0B /* UIColor+Extension.swift */; }; 39307CF52917DA9300789AB6 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39307CF42917DA9300789AB6 /* LoginViewController.swift */; }; 39341E0A298BA419006C1727 /* TeamDetailMembersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */; }; + 39341E0D298BC354006C1727 /* TeamDetailMembersCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */; }; 39436C1029127BBA0083D77A /* MyFeedbackCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */; }; 39436C132912877D0083D77A /* MyFeedbackHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C122912877D0083D77A /* MyFeedbackHeaderView.swift */; }; 39436C15291287A00083D77A /* MyFeedbackCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C14291287A00083D77A /* MyFeedbackCollectionViewCell.swift */; }; @@ -163,6 +164,7 @@ 39257DF428F93E4700201E0B /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = ""; }; 39307CF42917DA9300789AB6 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersView.swift; sourceTree = ""; }; + 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersCell.swift; sourceTree = ""; }; 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionView.swift; sourceTree = ""; }; 39436C122912877D0083D77A /* MyFeedbackHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackHeaderView.swift; sourceTree = ""; }; 39436C14291287A00083D77A /* MyFeedbackCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionViewCell.swift; sourceTree = ""; }; @@ -475,6 +477,14 @@ path = UIComponent; sourceTree = ""; }; + 39341E0B298BC344006C1727 /* Cell */ = { + isa = PBXGroup; + children = ( + 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */, + ); + path = Cell; + sourceTree = ""; + }; 39436C162912A2D30083D77A /* Feedback */ = { isa = PBXGroup; children = ( @@ -512,6 +522,7 @@ 3960863F29811D86003AB4F8 /* TeamDetail */ = { isa = PBXGroup; children = ( + 39341E0B298BC344006C1727 /* Cell */, 39341E08298BA3FC006C1727 /* UIComponent */, 3960864029811E3C003AB4F8 /* TeamDetailViewController.swift */, ); @@ -1108,6 +1119,7 @@ 39F15C0C296D371500952D02 /* EmptyPersonView.swift in Sources */, 52DC9091291A98CC00904739 /* MyFeedbackEditViewController.swift in Sources */, 3E66777529419C8300BB5670 /* KeywordTextFieldView.swift in Sources */, + 39341E0D298BC354006C1727 /* TeamDetailMembersCell.swift in Sources */, 3EA341E82925E5EA005CBD1C /* String+Extension.swift in Sources */, D7AFB7C72916FF9400E998B7 /* CustomSegmentControl.swift in Sources */, 7E8CDC67292E19B000984742 /* SettingButton.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift new file mode 100644 index 00000000..0b7341d9 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift @@ -0,0 +1,30 @@ +// +// TeamDetailMembersCell.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/02/02. +// + +import UIKit + +import SnapKit + +final class TeamDetailMembersCell: BaseCollectionViewCell { + + // MARK: - property + + private let profileImageView: UIImageView = { + let imageView = UIImageView() + imageView.image = ImageLiterals.icPersonCircle + imageView.layer.cornerRadius = 23 + return imageView + }() + + override func render() { + self.addSubview(profileImageView) + profileImageView.snp.makeConstraints { + $0.top.leading.equalToSuperview() + $0.width.height.equalTo(46) + } + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index acf56477..8878bcc9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -11,10 +11,20 @@ import SnapKit final class TeamDetailMembersView: UIView { + private let cellWidth = UIScreen.main.bounds.width - (SizeLiteral.leadingTrailingPadding * 2) + // MARK: - property - private let memberCollectionView: UICollectionView = { - let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout.init()) + private lazy var flowLayout: UICollectionViewFlowLayout = { + let flowLayout = UICollectionViewFlowLayout() + flowLayout.scrollDirection = .vertical + flowLayout.itemSize = CGSize(width: cellWidth, height: 46) + flowLayout.minimumLineSpacing = 20 + return flowLayout + }() + private lazy var memberCollectionView: UICollectionView = { + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) + collectionView.register(TeamDetailMembersCell.self, forCellWithReuseIdentifier: TeamDetailMembersCell.className) return collectionView }() @@ -23,6 +33,7 @@ final class TeamDetailMembersView: UIView { override init(frame: CGRect) { super.init(frame: frame) render() + setupDelegation() } required init?(coder: NSCoder) { nil } @@ -35,8 +46,25 @@ final class TeamDetailMembersView: UIView { $0.edges.equalToSuperview() } } + + private func setupDelegation() { + memberCollectionView.delegate = self + memberCollectionView.dataSource = self + } +} + +extension TeamDetailMembersView: UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + // FIXME: - 임시 확인 값 + return 3 + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TeamDetailMembersCell.className, for: indexPath) as? TeamDetailMembersCell else { return UICollectionViewCell() } + return cell + } } -extension TeamDetailMembersView: UICollectionViewDelegateFlowLayout { +extension TeamDetailMembersView: UICollectionViewDelegate { } From fddd090e30a3d3f6a5d2051c2abf6f17b719f0a2 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 13:58:05 +0900 Subject: [PATCH 117/388] =?UTF-8?q?[CHORE]=20=EB=A9=A4=EB=B2=84=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20view=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EB=B6=84=EB=A6=AC=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../TeamDetail/TeamDetailViewController.swift | 47 +++----------- .../UIComponent/MemberInformationView.swift | 62 +++++++++++++++++++ 3 files changed, 73 insertions(+), 40 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 79e70d8e..6bf8f36f 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ 39307CF52917DA9300789AB6 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39307CF42917DA9300789AB6 /* LoginViewController.swift */; }; 39341E0A298BA419006C1727 /* TeamDetailMembersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */; }; 39341E0D298BC354006C1727 /* TeamDetailMembersCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */; }; + 39341E0F29921181006C1727 /* MemberInformationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E0E29921181006C1727 /* MemberInformationView.swift */; }; 39436C1029127BBA0083D77A /* MyFeedbackCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */; }; 39436C132912877D0083D77A /* MyFeedbackHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C122912877D0083D77A /* MyFeedbackHeaderView.swift */; }; 39436C15291287A00083D77A /* MyFeedbackCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C14291287A00083D77A /* MyFeedbackCollectionViewCell.swift */; }; @@ -165,6 +166,7 @@ 39307CF42917DA9300789AB6 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersView.swift; sourceTree = ""; }; 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersCell.swift; sourceTree = ""; }; + 39341E0E29921181006C1727 /* MemberInformationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberInformationView.swift; sourceTree = ""; }; 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionView.swift; sourceTree = ""; }; 39436C122912877D0083D77A /* MyFeedbackHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackHeaderView.swift; sourceTree = ""; }; 39436C14291287A00083D77A /* MyFeedbackCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionViewCell.swift; sourceTree = ""; }; @@ -473,6 +475,7 @@ isa = PBXGroup; children = ( 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */, + 39341E0E29921181006C1727 /* MemberInformationView.swift */, ); path = UIComponent; sourceTree = ""; @@ -1189,6 +1192,7 @@ 3E5195A42928C8FB00710A01 /* CreateReflectionEndPoint.swift in Sources */, 525E721A28FF0F1900EF3FCB /* MemberCollectionViewCell.swift in Sources */, 395C7E2228FEDB6500FC2FCA /* UITextField+Extension.swift in Sources */, + 39341E0F29921181006C1727 /* MemberInformationView.swift in Sources */, D7AFB7C32916EAB100E998B7 /* MyReflectionDetailViewController.swift in Sources */, 39F52C632923357700B19A77 /* FeedBackInfoResponse.swift in Sources */, 39F52C5D292332EA00B19A77 /* AddReflectionResponse.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 96d0e11e..9aa394d2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -37,28 +37,7 @@ final class TeamDetailViewController: BaseViewController { label.font = .label2 return label }() - private let profileImageView: UIImageView = { - let imageView = UIImageView() - imageView.layer.cornerRadius = 23 - imageView.image = ImageLiterals.imgPersonTab - return imageView - }() - private let profileNicknameLabel: UILabel = { - let label = UILabel() - // FIXME: - API 연결 후 삭제 - label.text = "이두" - label.font = .label2 - label.textColor = .gray600 - return label - }() - private let profileRoleLabel: UILabel = { - let label = UILabel() - // FIXME: - API 연결 후 삭제 - label.text = "디자인 리드 / 개발자" - label.font = .caption2 - label.textColor = .gray400 - return label - }() + private let memberInformationView = MemberInformationView() private let dividerView: UIView = { let view = UIView() view.layer.borderWidth = 0.5 @@ -101,28 +80,16 @@ final class TeamDetailViewController: BaseViewController { $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } - view.addSubview(profileImageView) - profileImageView.snp.makeConstraints { + view.addSubview(memberInformationView) + memberInformationView.snp.makeConstraints { $0.top.equalTo(memberTitleLabel.snp.bottom).offset(20) - $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.width.height.equalTo(46) - } - - view.addSubview(profileNicknameLabel) - profileNicknameLabel.snp.makeConstraints { - $0.leading.equalTo(profileImageView.snp.trailing).offset(12) - $0.bottom.equalTo(profileImageView.snp.centerY) - } - - view.addSubview(profileRoleLabel) - profileRoleLabel.snp.makeConstraints { - $0.leading.equalTo(profileImageView.snp.trailing).offset(12) - $0.top.equalTo(profileNicknameLabel.snp.bottom).offset(4) + $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.height.equalTo(46) } - + view.addSubview(dividerView) dividerView.snp.makeConstraints { - $0.top.equalTo(profileImageView.snp.bottom).offset(25) + $0.top.equalTo(memberInformationView.snp.bottom).offset(25) $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) $0.height.equalTo(1) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift new file mode 100644 index 00000000..a24ec4a4 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift @@ -0,0 +1,62 @@ +// +// MemberInformationView.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/02/07. +// + +import UIKit + +import SnapKit + +final class MemberInformationView: UIView { + private let profileImageView: UIImageView = { + let imageView = UIImageView() + imageView.layer.cornerRadius = 23 + imageView.image = ImageLiterals.imgPersonTab + return imageView + }() + private let profileNicknameLabel: UILabel = { + let label = UILabel() + // FIXME: - API 연결 후 삭제 + label.text = "이두" + label.font = .label2 + label.textColor = .gray600 + return label + }() + private let profileRoleLabel: UILabel = { + let label = UILabel() + // FIXME: - API 연결 후 삭제 + label.text = "디자인 리드 / 개발자" + label.font = .caption2 + label.textColor = .gray400 + return label + }() + + override init(frame: CGRect) { + super.init(frame: frame) + render() + } + + required init?(coder: NSCoder) { nil } + + private func render() { + self.addSubview(profileImageView) + profileImageView.snp.makeConstraints { + $0.top.leading.equalToSuperview() + $0.width.height.equalTo(46) + } + + self.addSubview(profileNicknameLabel) + profileNicknameLabel.snp.makeConstraints { + $0.leading.equalTo(profileImageView.snp.trailing).offset(12) + $0.top.equalTo(profileImageView.snp.top).offset(8) + } + + self.addSubview(profileRoleLabel) + profileRoleLabel.snp.makeConstraints { + $0.leading.equalTo(profileNicknameLabel.snp.leading) + $0.top.equalTo(profileNicknameLabel.snp.bottom).offset(4) + } + } +} From a4fb4d9156c961f774ce07075f4a994f601fbe8e Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 14:20:44 +0900 Subject: [PATCH 118/388] =?UTF-8?q?[CHORE]=20mark=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/Cell/TeamDetailMembersCell.swift | 15 ++++----------- .../UIComponent/MemberInformationView.swift | 5 +++++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift index 0b7341d9..ad8c516c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift @@ -13,18 +13,11 @@ final class TeamDetailMembersCell: BaseCollectionViewCell { // MARK: - property - private let profileImageView: UIImageView = { - let imageView = UIImageView() - imageView.image = ImageLiterals.icPersonCircle - imageView.layer.cornerRadius = 23 - return imageView - }() + private let memberInformationView = MemberInformationView() + + // MARK: - life cycle override func render() { - self.addSubview(profileImageView) - profileImageView.snp.makeConstraints { - $0.top.leading.equalToSuperview() - $0.width.height.equalTo(46) - } + self.addSubview(memberInformationView) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift index a24ec4a4..8037477c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift @@ -10,6 +10,9 @@ import UIKit import SnapKit final class MemberInformationView: UIView { + + // MARK: - property + private let profileImageView: UIImageView = { let imageView = UIImageView() imageView.layer.cornerRadius = 23 @@ -33,6 +36,8 @@ final class MemberInformationView: UIView { return label }() + // MARK: - life cycle + override init(frame: CGRect) { super.init(frame: frame) render() From 4cfde9bc24ea42e051737b27d82652b9201acca1 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 14:30:43 +0900 Subject: [PATCH 119/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=EC=9B=90=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20initializer=20=EC=B6=94=EA=B0=80=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cell/TeamDetailMembersCell.swift | 2 +- .../TeamDetail/TeamDetailViewController.swift | 2 +- .../UIComponent/MemberInformationView.swift | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift index ad8c516c..c492fba6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift @@ -13,7 +13,7 @@ final class TeamDetailMembersCell: BaseCollectionViewCell { // MARK: - property - private let memberInformationView = MemberInformationView() + private let memberInformationView = MemberInformationView(nickname: "익명", role: "팀원") // MARK: - life cycle diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 9aa394d2..8282a48d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -37,7 +37,7 @@ final class TeamDetailViewController: BaseViewController { label.font = .label2 return label }() - private let memberInformationView = MemberInformationView() + private let memberInformationView = MemberInformationView(nickname: "이드", role: "디자인 리드 / 개발자") private let dividerView: UIView = { let view = UIView() view.layer.borderWidth = 0.5 diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift index 8037477c..53621e64 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift @@ -10,6 +10,8 @@ import UIKit import SnapKit final class MemberInformationView: UIView { + let nickname: String + let role: String // MARK: - property @@ -19,18 +21,16 @@ final class MemberInformationView: UIView { imageView.image = ImageLiterals.imgPersonTab return imageView }() - private let profileNicknameLabel: UILabel = { + private lazy var profileNicknameLabel: UILabel = { let label = UILabel() - // FIXME: - API 연결 후 삭제 - label.text = "이두" + label.text = nickname label.font = .label2 label.textColor = .gray600 return label }() - private let profileRoleLabel: UILabel = { + private lazy var profileRoleLabel: UILabel = { let label = UILabel() - // FIXME: - API 연결 후 삭제 - label.text = "디자인 리드 / 개발자" + label.text = role label.font = .caption2 label.textColor = .gray400 return label @@ -38,8 +38,10 @@ final class MemberInformationView: UIView { // MARK: - life cycle - override init(frame: CGRect) { - super.init(frame: frame) + init(nickname: String, role: String) { + self.nickname = nickname + self.role = role + super.init(frame: .zero) render() } From b8fc6876f26273ef608aef1b75a0af875b72d5f2 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 7 Feb 2023 14:32:07 +0900 Subject: [PATCH 120/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 1 - .../Screen/Home/Home/TeamManageViewController.swift | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 351d6a05..2b7d84de 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -57,7 +57,6 @@ final class HomeViewController: BaseViewController { button.setPreferredSymbolConfiguration(UIImage.SymbolConfiguration(pointSize: 13, weight: .semibold), forImageIn: .normal) button.tintColor = .black100 let action = UIAction { [weak self] _ in - // FIXME: 버튼 눌렀을 때 action 추가 self?.presentTeamModal() } button.addAction(action, for: .touchUpInside) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index d2d301f4..8dcf163f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -14,6 +14,7 @@ final class TeamManageViewController: BaseViewController { // MARK: - property // MARK: - life cycle + override func viewDidLoad() { super.viewDidLoad() } From 184a78ab3fb1f67541987ce79119ab15fc497439 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 7 Feb 2023 14:34:02 +0900 Subject: [PATCH 121/388] =?UTF-8?q?[CHORE]=20=ED=92=80=EB=96=99=EA=B8=B0?= =?UTF-8?q?=EA=B8=B0=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 0a568371..f8c56ece 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -180,7 +180,7 @@ final class HomeViewController: BaseViewController { present(teamViewController, animated: true) } - private func setUpDelegation() { + private func setupDelegation() { keywordCollectionView.delegate = self keywordCollectionView.dataSource = self } From 281eda0dea9d4aa143081988d0f57e80cf489f8f Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 7 Feb 2023 14:42:15 +0900 Subject: [PATCH 122/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageSettingCell.swift | 1 + .../Screen/Home/Home/TeamManageViewController.swift | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift index a7cf26f0..d677e0a1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift @@ -16,6 +16,7 @@ final class TeamManageSettingCell: BaseTableViewCell { let cellTitleLabel: UILabel = { let label = UILabel() label.font = .label2 + label.textColor = .black100 return label }() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 1f33744a..08b2e4a1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -75,14 +75,13 @@ final class TeamManageViewController: BaseViewController { sections.append(Section(options: [Option(title: "새로운 팀 합류하기", handler: { print("새로운 팀 합류하기") }), - Option(title: "팀 생성하기", handler: { + Option(title: "팀 생성하기", handler: { print("팀 생성하기") })])) - sections.append(Section(options: [Option(title: "로그아웃", handler: { print("로그아웃") }), - Option(title: "회원탈퇴", handler: { + Option(title: "회원탈퇴", handler: { print("회원탈퇴") })])) } @@ -104,7 +103,7 @@ extension TeamManageViewController: UITableViewDataSource { guard let cell = tableView.dequeueReusableCell(withIdentifier: TeamManageSettingCell.className, for: indexPath) as? TeamManageSettingCell else { return UITableViewCell() } if indexPath.section == 1 { - cell.cellTitleLabel.textColor = .red + cell.cellTitleLabel.textColor = .red100 } cell.cellTitleLabel.text = model.title From e38aebd82c08414e2833a9f03d2953bbf6f79f07 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 14:45:39 +0900 Subject: [PATCH 123/388] =?UTF-8?q?[CHORE]=20=EB=91=90=EA=BA=BC=EC=9A=B4?= =?UTF-8?q?=20divider=20=EC=B6=94=EA=B0=80=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 8282a48d..49cd2707 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -45,6 +45,11 @@ final class TeamDetailViewController: BaseViewController { return view }() private let memberCollectionView = TeamDetailMembersView() + private let fullDividerView: UIView = { + let view = UIView() + view.backgroundColor = .gray300 + return view + }() // MARK: - life cycle @@ -98,8 +103,14 @@ final class TeamDetailViewController: BaseViewController { memberCollectionView.snp.makeConstraints { $0.top.equalTo(dividerView.snp.bottom).offset(24) $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - // FIXME: - 아래 뷰 만들고 바텀 레이아웃 수정 - $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom) + $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(120) + } + + view.addSubview(fullDividerView) + fullDividerView.snp.makeConstraints { + $0.top.equalTo(memberCollectionView.snp.bottom) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(4) } } From 0ac5486dbb7935b1880b1dcebd0ac3008bb685e3 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 7 Feb 2023 15:22:40 +0900 Subject: [PATCH 124/388] =?UTF-8?q?[FEAT]=20=ED=8C=80=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EC=BB=AC=EB=A0=89=EC=85=98=20=EB=B7=B0=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../Home/UIComponent/ChangeTeamView.swift | 41 +++++++++++++++++++ .../TeamChangeCollectionViewCell.swift | 36 ++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 1bc2688f..c2c8baee 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -132,6 +132,7 @@ 7EE38BAD2925DDD200FD738D /* EncodeDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */; }; 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */; }; D702278A297F99510027EF64 /* TeamManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7022789297F99500027EF64 /* TeamManageViewController.swift */; }; + D7195FBC299223F6002526E7 /* TeamChangeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7195FBB299223F6002526E7 /* TeamChangeCollectionViewCell.swift */; }; D724790C28FEC8C900D67B50 /* BaseTextFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */; }; D724790E28FEEEC300D67B50 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790D28FEEEC300D67B50 /* CustomTextField.swift */; }; D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */; }; @@ -276,6 +277,7 @@ 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncodeDTO.swift; sourceTree = ""; }; 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionEndPoint.swift; sourceTree = ""; }; D7022789297F99500027EF64 /* TeamManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageViewController.swift; sourceTree = ""; }; + D7195FBB299223F6002526E7 /* TeamChangeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamChangeCollectionViewCell.swift; sourceTree = ""; }; D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTextFieldViewController.swift; sourceTree = ""; }; D724790D28FEEEC300D67B50 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = ""; }; D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeViewController.swift; sourceTree = ""; }; @@ -724,6 +726,7 @@ children = ( 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */, D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */, + D7195FBB299223F6002526E7 /* TeamChangeCollectionViewCell.swift */, ); path = UIComponent; sourceTree = ""; @@ -1152,6 +1155,7 @@ 525E722528FFCFA600EF3FCB /* FeedbackTypeButtonView.swift in Sources */, 39A64ACE2905885F001DB020 /* StartSuggestionView.swift in Sources */, D7AFB7C52916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift in Sources */, + D7195FBC299223F6002526E7 /* TeamChangeCollectionViewCell.swift in Sources */, 520FEC44292234C0009FC1F2 /* FeedbackToMeModel.swift in Sources */, 3E5195AB292B05BC00710A01 /* JoinReflectionButton.swift in Sources */, 52AED2DD29128532004D70B9 /* FeedbackFromMeModel.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 19d3fb24..ee7f27c8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -20,6 +20,22 @@ final class ChangeTeamView: UIView { label.textColor = .black100 return label }() + private let collectionViewFlowLayout: UICollectionViewFlowLayout = { + let flowLayout = UICollectionViewFlowLayout() + flowLayout.scrollDirection = .vertical + flowLayout.sectionInset = UIEdgeInsets(top: 12, left: SizeLiteral.leadingTrailingPadding, bottom: 16, right: SizeLiteral.leadingTrailingPadding) + flowLayout.itemSize = CGSize(width: 335, height: 59) + flowLayout.minimumLineSpacing = 8 + return flowLayout + }() + private lazy var teamCollectionView: UICollectionView = { + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewFlowLayout) + collectionView.delegate = self + collectionView.dataSource = self + collectionView.register(TeamChangeCollectionViewCell.self, forCellWithReuseIdentifier: TeamChangeCollectionViewCell.className) + collectionView.backgroundColor = .white200 + return collectionView + }() // MARK: - life cycle @@ -41,10 +57,35 @@ final class ChangeTeamView: UIView { $0.top.equalTo(safeAreaLayoutGuide.snp.top).inset(26) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + + self.addSubview(teamCollectionView) + teamCollectionView.snp.makeConstraints { + $0.top.equalTo(titleLabel.snp.bottom) + $0.directionalHorizontalEdges.equalToSuperview() + $0.height.equalToSuperview() + } } // MARK: - function +} + +extension ChangeTeamView: UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return 3 + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TeamChangeCollectionViewCell.className, for: indexPath) as? TeamChangeCollectionViewCell else { return UICollectionViewCell() } + cell.teamNameLabel.text = "맛쟁이 사과처럼 입니다" + return cell + } + + +} + +extension ChangeTeamView: UICollectionViewDelegate { + } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift new file mode 100644 index 00000000..5ecd2bc4 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift @@ -0,0 +1,36 @@ +// +// TeamChangeCollectionViewCell.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/02/07. +// + +import UIKit + +import SnapKit + +final class TeamChangeCollectionViewCell: BaseCollectionViewCell { + + // MARK: - property + + let teamNameLabel: UILabel = { + let label = UILabel() + label.font = .label2 + label.textColor = .black100 + return label + }() + + // MARK: - life cycle + + override func render() { + self.addSubview(teamNameLabel) + teamNameLabel.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalToSuperview().inset(16) + } + } + + override func configUI() { + self.backgroundColor = .white200 + } +} From 638fa921697e430fa5ed3f5a6abbd3b30691a795 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 15:40:21 +0900 Subject: [PATCH 125/388] =?UTF-8?q?[ADD]=20=EC=B4=88=EB=8C=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EA=B3=B5=EC=9C=A0=ED=95=98=EA=B8=B0=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=B6=94=EA=B0=80=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Literal/TextLiteral.swift | 1 + .../Home/TeamDetail/TeamDetailViewController.swift | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 9c31c260..06aef477 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -235,4 +235,5 @@ enum TextLiteral { static let teamDetailViewControllerEditButteonText: String = "편집" static let teamDetailViewControllerMemberTitleLabel: String = "멤버" + static let teamDetailViewControllerShareCodeText: String = "초대코드 공유하기" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 1520308e..708bc041 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -50,6 +50,13 @@ final class TeamDetailViewController: BaseViewController { view.backgroundColor = .gray300 return view }() + private let codyShareButton: UIButton = { + let button = UIButton(type: .system) + button.setTitle(TextLiteral.teamDetailViewControllerShareCodeText, for: .normal) + button.setTitleColor(.blue200, for: .normal) + button.titleLabel?.font = .label2 + return button + }() // MARK: - life cycle @@ -112,6 +119,12 @@ final class TeamDetailViewController: BaseViewController { $0.leading.trailing.equalToSuperview() $0.height.equalTo(4) } + + view.addSubview(codyShareButton) + codyShareButton.snp.makeConstraints { + $0.top.equalTo(fullDividerView.snp.bottom).offset(20) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } } override func setupNavigationBar() { From 79e3d93146f8ca93e19820ee44c75664f809822d Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 15:46:53 +0900 Subject: [PATCH 126/388] =?UTF-8?q?[ADD]=20=EC=B4=88=EB=8C=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20label=20=EC=B6=94=EA=B0=80=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 708bc041..9299ff8f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -50,13 +50,21 @@ final class TeamDetailViewController: BaseViewController { view.backgroundColor = .gray300 return view }() - private let codyShareButton: UIButton = { + private let codeShareButton: UIButton = { let button = UIButton(type: .system) button.setTitle(TextLiteral.teamDetailViewControllerShareCodeText, for: .normal) button.setTitleColor(.blue200, for: .normal) button.titleLabel?.font = .label2 return button }() + private let invitationCodeLabel: UILabel = { + let label = UILabel() + // FIXME: - APi 연결 후 삭제 + label.text = "1BCDEF" + label.font = .label2 + label.textColor = .gray600 + return label + }() // MARK: - life cycle @@ -120,11 +128,17 @@ final class TeamDetailViewController: BaseViewController { $0.height.equalTo(4) } - view.addSubview(codyShareButton) - codyShareButton.snp.makeConstraints { - $0.top.equalTo(fullDividerView.snp.bottom).offset(20) + view.addSubview(codeShareButton) + codeShareButton.snp.makeConstraints { + $0.top.equalTo(fullDividerView.snp.bottom).offset(14) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + + view.addSubview(invitationCodeLabel) + invitationCodeLabel.snp.makeConstraints { + $0.top.equalTo(fullDividerView.snp.bottom).offset(20) + $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } } override func setupNavigationBar() { From 515c1cb70783e1ce27a4f233e8b9adeae87cadb8 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 15:55:46 +0900 Subject: [PATCH 127/388] =?UTF-8?q?[ADD]=20full=20divider=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=B6=84=EB=A6=AC=20=ED=9B=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../TeamDetail/TeamDetailViewController.swift | 21 +++++----- .../UIComponent/FullDividerView.swift | 38 +++++++++++++++++++ 3 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 8429990c..74aa11a6 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 39341E0A298BA419006C1727 /* TeamDetailMembersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */; }; 39341E0D298BC354006C1727 /* TeamDetailMembersCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */; }; 39341E0F29921181006C1727 /* MemberInformationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E0E29921181006C1727 /* MemberInformationView.swift */; }; + 39341E1129922D17006C1727 /* FullDividerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E1029922D17006C1727 /* FullDividerView.swift */; }; 39436C1029127BBA0083D77A /* MyFeedbackCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */; }; 39436C132912877D0083D77A /* MyFeedbackHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C122912877D0083D77A /* MyFeedbackHeaderView.swift */; }; 39436C15291287A00083D77A /* MyFeedbackCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C14291287A00083D77A /* MyFeedbackCollectionViewCell.swift */; }; @@ -168,6 +169,7 @@ 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersView.swift; sourceTree = ""; }; 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersCell.swift; sourceTree = ""; }; 39341E0E29921181006C1727 /* MemberInformationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberInformationView.swift; sourceTree = ""; }; + 39341E1029922D17006C1727 /* FullDividerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullDividerView.swift; sourceTree = ""; }; 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionView.swift; sourceTree = ""; }; 39436C122912877D0083D77A /* MyFeedbackHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackHeaderView.swift; sourceTree = ""; }; 39436C14291287A00083D77A /* MyFeedbackCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionViewCell.swift; sourceTree = ""; }; @@ -478,6 +480,7 @@ children = ( 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */, 39341E0E29921181006C1727 /* MemberInformationView.swift */, + 39341E1029922D17006C1727 /* FullDividerView.swift */, ); path = UIComponent; sourceTree = ""; @@ -1147,6 +1150,7 @@ 39257DC528F8FEBD00201E0B /* AppDelegate.swift in Sources */, 39F52C4B29232E2600B19A77 /* CreateTeamDTO.swift in Sources */, 39F52C74292476EA00B19A77 /* FeedBackResponse.swift in Sources */, + 39341E1129922D17006C1727 /* FullDividerView.swift in Sources */, 39F5583D2908CFAD00CD6F6E /* Encodable+Extension.swift in Sources */, 39257DC728F8FEBD00201E0B /* SceneDelegate.swift in Sources */, 52F07B9A2912541B0015BC8B /* MyFeedbackDetailViewController.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 9299ff8f..6032b2f1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -45,11 +45,7 @@ final class TeamDetailViewController: BaseViewController { return view }() private let memberCollectionView = TeamDetailMembersView() - private let fullDividerView: UIView = { - let view = UIView() - view.backgroundColor = .gray300 - return view - }() + private let firstFullDividerView = FullDividerView() private let codeShareButton: UIButton = { let button = UIButton(type: .system) button.setTitle(TextLiteral.teamDetailViewControllerShareCodeText, for: .normal) @@ -65,6 +61,7 @@ final class TeamDetailViewController: BaseViewController { label.textColor = .gray600 return label }() + private let secondFullDividerView = FullDividerView() // MARK: - life cycle @@ -121,8 +118,8 @@ final class TeamDetailViewController: BaseViewController { $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(120) } - view.addSubview(fullDividerView) - fullDividerView.snp.makeConstraints { + view.addSubview(firstFullDividerView) + firstFullDividerView.snp.makeConstraints { $0.top.equalTo(memberCollectionView.snp.bottom) $0.leading.trailing.equalToSuperview() $0.height.equalTo(4) @@ -130,15 +127,21 @@ final class TeamDetailViewController: BaseViewController { view.addSubview(codeShareButton) codeShareButton.snp.makeConstraints { - $0.top.equalTo(fullDividerView.snp.bottom).offset(14) + $0.top.equalTo(firstFullDividerView.snp.bottom).offset(14) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } view.addSubview(invitationCodeLabel) invitationCodeLabel.snp.makeConstraints { - $0.top.equalTo(fullDividerView.snp.bottom).offset(20) + $0.top.equalTo(firstFullDividerView.snp.bottom).offset(20) $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + + view.addSubview(secondFullDividerView) + secondFullDividerView.snp.makeConstraints { + $0.top.equalTo(invitationCodeLabel.snp.bottom).offset(20) + $0.leading.trailing.equalToSuperview() + } } override func setupNavigationBar() { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift new file mode 100644 index 00000000..e61ddbdb --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift @@ -0,0 +1,38 @@ +// +// FullDividerView.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/02/07. +// + +import UIKit + +import SnapKit + +final class FullDividerView: UIView { + + // MARK: - property + + let dividerView: UIView = { + let view = UIView() + view.backgroundColor = .gray300 + return view + }() + + // MARK: - life cycle + + override init(frame: CGRect) { + super.init(frame: frame) + render() + } + + required init?(coder: NSCoder) { nil } + + private func render() { + self.addSubview(dividerView) + dividerView.snp.makeConstraints { + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(4) + } + } +} From dd48d95c30c3b7a95c0e904f7d7459e69c4cc2bb Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 7 Feb 2023 15:57:37 +0900 Subject: [PATCH 128/388] =?UTF-8?q?[FEAT]=20=EC=85=80=EC=97=90=20=EA=B7=B8?= =?UTF-8?q?=EB=A6=BC=EC=9E=90=20=EB=84=A3=EA=B8=B0=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIComponent/TeamChangeCollectionViewCell.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift index 5ecd2bc4..fea5f1e4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift @@ -23,7 +23,7 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { // MARK: - life cycle override func render() { - self.addSubview(teamNameLabel) + contentView.addSubview(teamNameLabel) teamNameLabel.snp.makeConstraints { $0.centerY.equalToSuperview() $0.leading.equalToSuperview().inset(16) @@ -32,5 +32,17 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { override func configUI() { self.backgroundColor = .white200 + self.layer.cornerRadius = 10 + self.makeShadow(color: .black100, opacity: 0.3, offset: CGSize(width: 0, height: 0), radius: 1) + self.layer.masksToBounds = false + } + + // MARK: - func + + private func setBorder(color: CGColor, width: CGFloat) { + self.layer.borderColor = color + self.layer.borderWidth = width + } + } From 3bb481d8315021932b8557100f47cc22e84471dc Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 7 Feb 2023 16:05:51 +0900 Subject: [PATCH 129/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20-=20create=20&=20edit=20?= =?UTF-8?q?=ED=8C=90=EB=B3=84=20=EB=B3=80=EC=88=98=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?(#295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateReflectionViewController.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index f8a3ddbb..cd6f932c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -16,6 +16,14 @@ final class CreateReflectionViewController: BaseViewController { var reflectionTitle: String? var reflectionDate: Date? + var isCreateReflection: Bool { + if reflectionTitle == nil { + return true + } else { + return false + } + } + init(reflectionId: Int) { self.reflectionId = reflectionId super.init() @@ -42,7 +50,7 @@ final class CreateReflectionViewController: BaseViewController { }() private lazy var titleLabel: UILabel = { let label = UILabel() - if reflectionTitle == nil { + if isCreateReflection { label.setTitleFont(text: TextLiteral.createReflectionViewControllerTitle) } else { label.setTitleFont(text: TextLiteral.editReflectionViewControllerTitle) From 08ed65e4206d6fb452d771a5335f903ffa5bce8a Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 7 Feb 2023 16:09:53 +0900 Subject: [PATCH 130/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20-=20textliteral=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 9dbcba12..4cf00071 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -37,7 +37,7 @@ enum TextLiteral { static let createReflectionViewControllerTextFieldPlaceHolder = "예) 1차 스프린트" static let createReflectionViewControllerDateLabel = "회고 일시" static let createReflectionViewControllerButtonText = "추가하기" - static let editReflectionViewControllerTitle = "회고 정보를 수정해주세요" + static let editReflectionViewControllerTitle = "회고 정보를 수정해 주세요" static let editReflectionViewControllerButtonText = "수정하기" // MARK: - SetNicknameViewController From 6d39f7828b7ce99f52b8d526d26bcaaa2e066cad Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 7 Feb 2023 17:00:15 +0900 Subject: [PATCH 131/388] =?UTF-8?q?[CHORE]=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=ED=8C=80=20=EC=83=89=20=EB=B3=80=EA=B2=BD=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/UIComponent/ChangeTeamView.swift | 12 +++++++++-- .../TeamChangeCollectionViewCell.swift | 21 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index ee7f27c8..3da66e14 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -11,6 +11,9 @@ import SnapKit final class ChangeTeamView: UIView { + // MARK: - FIXME: 데이터 더미 입니다. + private let teamDataDummy: [String] = ["맛쟁이 사과처럼", "굿굿이에요", "테스트더미에요"] + // MARK: - property private let titleLabel: UILabel = { @@ -74,12 +77,12 @@ final class ChangeTeamView: UIView { extension ChangeTeamView: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return 3 + return teamDataDummy.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TeamChangeCollectionViewCell.className, for: indexPath) as? TeamChangeCollectionViewCell else { return UICollectionViewCell() } - cell.teamNameLabel.text = "맛쟁이 사과처럼 입니다" + cell.teamNameLabel.text = teamDataDummy[indexPath.item] return cell } @@ -87,5 +90,10 @@ extension ChangeTeamView: UICollectionViewDataSource { } extension ChangeTeamView: UICollectionViewDelegate { + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + // MARK: - FIXME + let selectedTeamName = teamDataDummy[indexPath.item] + print(selectedTeamName) + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift index fea5f1e4..1c5b94ed 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift @@ -22,6 +22,17 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { // MARK: - life cycle + override var isSelected: Bool { + didSet { + if isSelected { + applyAttribute() + } + else { + resetAttribute() + } + } + } + override func render() { contentView.addSubview(teamNameLabel) teamNameLabel.snp.makeConstraints { @@ -44,5 +55,15 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { self.layer.borderColor = color self.layer.borderWidth = width } + + private func applyAttribute() { + if isSelected { + self.layer.borderWidth = 2 + self.layer.borderColor = UIColor.blue200.cgColor + } + } + private func resetAttribute() { + self.layer.borderWidth = 0 + } } From b563e14daeff1a3be2a3b933bad968b5fe498703 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 7 Feb 2023 18:04:11 +0900 Subject: [PATCH 132/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../Global/Literal/UrlLiteral.swift | 1 + .../UIComponent/Button/DeleteButton.swift | 35 ++++++++++ .../EndPoint/CreateReflectionEndPoint.swift | 2 +- .../CreateReflectionViewController.swift | 67 ++++++++++--------- 5 files changed, 77 insertions(+), 32 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/DeleteButton.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 14f0f655..ab0893bf 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -85,6 +85,7 @@ 39F909D7292679C400DAD0A3 /* EditFeedBackDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F909D6292679C400DAD0A3 /* EditFeedBackDTO.swift */; }; 3E5195A42928C8FB00710A01 /* CreateReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */; }; 3E5195AB292B05BC00710A01 /* JoinReflectionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */; }; + 3E5368992992461A000CBD48 /* DeleteButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5368982992461A000CBD48 /* DeleteButton.swift */; }; 3E557FC328FE7BBC00714E46 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */; }; 3E557FC528FE854600714E46 /* KeywordLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FC428FE854600714E46 /* KeywordLabel.swift */; }; 3E557FF82901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FF72901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift */; }; @@ -222,6 +223,7 @@ 39F909D6292679C400DAD0A3 /* EditFeedBackDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditFeedBackDTO.swift; sourceTree = ""; }; 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateReflectionEndPoint.swift; sourceTree = ""; }; 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinReflectionButton.swift; sourceTree = ""; }; + 3E5368982992461A000CBD48 /* DeleteButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteButton.swift; sourceTree = ""; }; 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 3E557FC428FE854600714E46 /* KeywordLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordLabel.swift; sourceTree = ""; }; 3E557FF72901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordCollectionViewFlowLayout.swift; sourceTree = ""; }; @@ -538,6 +540,7 @@ 395C7E1C28FEC8C400FC2FCA /* CloseButton.swift */, 395C7E0C28F959A500FC2FCA /* MainButton.swift */, 7E8CDC66292E19B000984742 /* SettingButton.swift */, + 3E5368982992461A000CBD48 /* DeleteButton.swift */, ); path = Button; sourceTree = ""; @@ -1121,6 +1124,7 @@ 3EB50866291350BB00FB77CB /* TotalReflectionCell.swift in Sources */, 7E7F160B2921CC4800C6BE96 /* CustomTabBarController.swift in Sources */, 395C7E1D28FEC8C400FC2FCA /* CloseButton.swift in Sources */, + 3E5368992992461A000CBD48 /* DeleteButton.swift in Sources */, 39F52C572923317500B19A77 /* CreateTeamResponse.swift in Sources */, 398474222925CF4800EDC139 /* TeamInfoResponse.swift in Sources */, 3EDED995293C81EC0000B4DC /* AddFeedbackKeywordViewController.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift index d56bc4aa..95803891 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift @@ -9,4 +9,5 @@ import Foundation enum UrlLiteral { static let baseUrl = "http://15.165.21.115:3001/api/v1" + static let v2BaseUrl = "http://15.165.21.115:3001/api/v2" } diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/DeleteButton.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/DeleteButton.swift new file mode 100644 index 00000000..728682a2 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/DeleteButton.swift @@ -0,0 +1,35 @@ +// +// DeleteButton.swift +// Maddori.Apple +// +// Created by 이성민 on 2023/02/07. +// + +import UIKit + +import SnapKit + +final class DeleteButton: UIButton { + + // MARK: - life cycle + + override init(frame: CGRect) { + super.init(frame: frame) + configUI() + render() + } + + required init?(coder: NSCoder) { nil } + + private func configUI() { + self.setTitle("삭제", for: .normal) + self.setTitleColor(.red100, for: .normal) + } + + private func render() { + self.snp.makeConstraints { + $0.width.height.equalTo(44) + } + } +} + diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/CreateReflectionEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/CreateReflectionEndPoint.swift index 7c2841e3..1425cce8 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/CreateReflectionEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/CreateReflectionEndPoint.swift @@ -13,7 +13,7 @@ enum CreateReflectionEndPoint { var address: String { switch self { case .patchReflectionDetail(let reflectionId, _): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)" + return "\(UrlLiteral.v2BaseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)" } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index cd6f932c..0f806089 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -16,13 +16,7 @@ final class CreateReflectionViewController: BaseViewController { var reflectionTitle: String? var reflectionDate: Date? - var isCreateReflection: Bool { - if reflectionTitle == nil { - return true - } else { - return false - } - } + var isEditReflection: Bool = false init(reflectionId: Int) { self.reflectionId = reflectionId @@ -33,6 +27,7 @@ final class CreateReflectionViewController: BaseViewController { self.reflectionId = reflectionId self.reflectionTitle = reflectionTitle self.reflectionDate = reflectionDate?.formatStringToDate() + self.isEditReflection = true super.init() } @@ -48,23 +43,22 @@ final class CreateReflectionViewController: BaseViewController { button.addAction(action, for: .touchUpInside) return button }() + private lazy var deleteButton: DeleteButton = { + let button = DeleteButton(type: .system) + let action = UIAction { [weak self] _ in + // FIXME: Delete Reflection API 연결 + print("삭제") + } + button.addAction(action, for: .touchUpInside) + return button + }() private lazy var titleLabel: UILabel = { let label = UILabel() - if isCreateReflection { - label.setTitleFont(text: TextLiteral.createReflectionViewControllerTitle) - } else { - label.setTitleFont(text: TextLiteral.editReflectionViewControllerTitle) - } + label.setTitleFont(text: TextLiteral.createReflectionViewControllerTitle) label.textColor = .black100 return label }() - private lazy var reflectionNameView: ReflectionNameView = { - let nameView = ReflectionNameView() - if let name = reflectionTitle { - nameView.nameTextField.text = reflectionTitle - } - return nameView - }() + private let reflectionNameView = ReflectionNameView() private let reflectionDateLabel: UILabel = { let label = UILabel() label.text = TextLiteral.createReflectionViewControllerDateLabel @@ -80,9 +74,6 @@ final class CreateReflectionViewController: BaseViewController { let hideKeyboardAction = UIAction { [weak self] _ in self?.view.endEditing(true) } - if let date = reflectionDate { - picker.date = date - } picker.datePickerMode = .date picker.locale = Locale(identifier: "ko_KR") picker.preferredDatePickerStyle = .compact @@ -101,9 +92,6 @@ final class CreateReflectionViewController: BaseViewController { let hideKeyboardAction = UIAction { [weak self] _ in self?.view.endEditing(true) } - if let time = reflectionDate { - picker.date = time - } picker.datePickerMode = .time picker.locale = Locale(identifier: "ko_KR") picker.preferredDatePickerStyle = .inline @@ -116,11 +104,7 @@ final class CreateReflectionViewController: BaseViewController { }() private lazy var mainButton: MainButton = { let button = MainButton() - if reflectionTitle == nil { - button.title = TextLiteral.createReflectionViewControllerButtonText - } else { - button.title = TextLiteral.editReflectionViewControllerButtonText - } + button.title = TextLiteral.createReflectionViewControllerButtonText return button }() @@ -132,6 +116,13 @@ final class CreateReflectionViewController: BaseViewController { setupNotificationCenter() } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + if isEditReflection { + setupEditReflection() + } + } + override func render() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { @@ -199,12 +190,26 @@ final class CreateReflectionViewController: BaseViewController { )) } else { // FIXME: UX writing 생각 - self?.makeAlert(title: "회고 일시 오류", message: "회고 일시를 미래로 설정해주세요") + self?.makeAlert(title: "회고 일정 설정 오류", message: "회고 일정은 현시각보다 이전으로 설정할 수 없습니다.") } } mainButton.addAction(action, for: .touchUpInside) } + private func setupEditReflection() { + titleLabel.setTitleFont(text: TextLiteral.editReflectionViewControllerTitle) + mainButton.title = TextLiteral.editReflectionViewControllerButtonText + guard let title = reflectionTitle, let date = reflectionDate else { return } + reflectionNameView.nameTextField.text = title + datePicker.date = date + timePicker.date = date + + let closeButton = makeBarButtonItem(with: closeButton) + let deleteButton = makeBarButtonItem(with: deleteButton) + navigationItem.leftBarButtonItem = closeButton + navigationItem.rightBarButtonItem = deleteButton + } + // MARK: - func private func combineDateAndTime() -> Date { From faa2a62f051ad83b961cd73d5c2ecbe626d6851e Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 7 Feb 2023 19:10:47 +0900 Subject: [PATCH 133/388] =?UTF-8?q?[CHORE]=20=EB=8D=B0=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=20=EB=B3=80=ED=99=94=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EB=B7=B0?= =?UTF-8?q?=20=EB=86=92=EC=9D=B4=20=EB=B3=80=EA=B2=BD=20=EC=A4=91=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 3ec4710c..b2913314 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -15,10 +15,7 @@ final class TeamManageViewController: BaseViewController { // MARK: - property - private let chageTeamView: ChangeTeamView = { - let view = ChangeTeamView() - return view - }() + private let chageTeamView = ChangeTeamView() private let dividerView: UIView = { let view = UIView() view.backgroundColor = .gray100 From 48939ae96c595d137abd3c348649f4d9d5aad7b7 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 8 Feb 2023 13:40:30 +0900 Subject: [PATCH 134/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20-=20textliteral=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 2 ++ .../Home/CreateReflection/CreateReflectionViewController.swift | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 4cf00071..a6effd26 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -37,6 +37,8 @@ enum TextLiteral { static let createReflectionViewControllerTextFieldPlaceHolder = "예) 1차 스프린트" static let createReflectionViewControllerDateLabel = "회고 일시" static let createReflectionViewControllerButtonText = "추가하기" + static let createReflectionAlertTitle = "회고 일정 설정 오류" + static let createReflectionAlertContent = "회고 일정은 현 시간보다 이전으로 설정할 수 없습니다." static let editReflectionViewControllerTitle = "회고 정보를 수정해 주세요" static let editReflectionViewControllerButtonText = "수정하기" diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 0f806089..95a772fd 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -189,8 +189,7 @@ final class CreateReflectionViewController: BaseViewController { ) )) } else { - // FIXME: UX writing 생각 - self?.makeAlert(title: "회고 일정 설정 오류", message: "회고 일정은 현시각보다 이전으로 설정할 수 없습니다.") + self?.makeAlert(title: TextLiteral.createReflectionAlertTitle, message: TextLiteral.createReflectionAlertContent) } } mainButton.addAction(action, for: .touchUpInside) From c2045938ddd9af204aa3f98004cd4cf6f1ed49ee Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 8 Feb 2023 16:55:17 +0900 Subject: [PATCH 135/388] =?UTF-8?q?[CHORE]=20layout=20=EC=88=9C=EC=84=9C?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 53 ++++++++++++------- .../UIComponent/FullDividerView.swift | 2 +- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 6032b2f1..e7fe460e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -62,6 +62,13 @@ final class TeamDetailViewController: BaseViewController { return label }() private let secondFullDividerView = FullDividerView() + private let teamLeaveButton: UIButton = { + let button = UIButton(type: .system) + button.setTitle("팀 나가기", for: .normal) + button.titleLabel?.font = .label2 + button.setTitleColor(.red100, for: .normal) + return button + }() // MARK: - life cycle @@ -111,36 +118,42 @@ final class TeamDetailViewController: BaseViewController { $0.height.equalTo(1) } - view.addSubview(memberCollectionView) - memberCollectionView.snp.makeConstraints { - $0.top.equalTo(dividerView.snp.bottom).offset(24) - $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(120) + view.addSubview(teamLeaveButton) + teamLeaveButton.snp.makeConstraints { + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(20) } - view.addSubview(firstFullDividerView) - firstFullDividerView.snp.makeConstraints { - $0.top.equalTo(memberCollectionView.snp.bottom) + view.addSubview(secondFullDividerView) + secondFullDividerView.snp.makeConstraints { $0.leading.trailing.equalToSuperview() - $0.height.equalTo(4) - } - - view.addSubview(codeShareButton) - codeShareButton.snp.makeConstraints { - $0.top.equalTo(firstFullDividerView.snp.bottom).offset(14) - $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.bottom.equalTo(teamLeaveButton.snp.top).offset(-20) } view.addSubview(invitationCodeLabel) invitationCodeLabel.snp.makeConstraints { - $0.top.equalTo(firstFullDividerView.snp.bottom).offset(20) $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.bottom.equalTo(secondFullDividerView.snp.top).offset(-20) } - - view.addSubview(secondFullDividerView) - secondFullDividerView.snp.makeConstraints { - $0.top.equalTo(invitationCodeLabel.snp.bottom).offset(20) + + view.addSubview(codeShareButton) + codeShareButton.snp.makeConstraints { + $0.centerY.equalTo(invitationCodeLabel.snp.centerY) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + + view.addSubview(firstFullDividerView) + + firstFullDividerView.snp.makeConstraints { $0.leading.trailing.equalToSuperview() + $0.bottom.equalTo(invitationCodeLabel.snp.top).offset(-20) + } + + view.addSubview(memberCollectionView) + memberCollectionView.snp.makeConstraints { + $0.top.equalTo(dividerView.snp.bottom).offset(24) + $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.bottom.equalTo(firstFullDividerView.snp.top) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift index e61ddbdb..6288873c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift @@ -31,7 +31,7 @@ final class FullDividerView: UIView { private func render() { self.addSubview(dividerView) dividerView.snp.makeConstraints { - $0.leading.trailing.equalToSuperview() + $0.edges.equalToSuperview() $0.height.equalTo(4) } } From 0cb7edddf23b9a11dd8ba1631e035a3fc20e67d4 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 8 Feb 2023 17:21:27 +0900 Subject: [PATCH 136/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EB=82=98?= =?UTF-8?q?=EA=B0=80=EA=B8=B0=20TextLiteral=20=EC=B6=94=EA=B0=80=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 06aef477..e188067d 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -236,4 +236,7 @@ enum TextLiteral { static let teamDetailViewControllerEditButteonText: String = "편집" static let teamDetailViewControllerMemberTitleLabel: String = "멤버" static let teamDetailViewControllerShareCodeText: String = "초대코드 공유하기" + static let teamDetailViewControllerLeaveTeamLabel: String = "팀 나가기" + static let teamDetailViewControllerLeaveTeamAlertTitle: String = "팀에서 나가시겠습니까?" + static let teamDetailViewControllerLeaveTeamAlertMessage: String = "모든 회고와 피드백 정보가 사라지며,\n되돌릴 수 없습니다." } From 866720cd4fc3c6d70e9e788dcaca07dcbebfe754 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 8 Feb 2023 17:21:42 +0900 Subject: [PATCH 137/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EB=82=98=EA=B0=80?= =?UTF-8?q?=EA=B8=B0=20Alert=EC=B6=94=EA=B0=80=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index e7fe460e..5c58696a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -64,7 +64,7 @@ final class TeamDetailViewController: BaseViewController { private let secondFullDividerView = FullDividerView() private let teamLeaveButton: UIButton = { let button = UIButton(type: .system) - button.setTitle("팀 나가기", for: .normal) + button.setTitle(TextLiteral.teamDetailViewControllerLeaveTeamLabel, for: .normal) button.titleLabel?.font = .label2 button.setTitleColor(.red100, for: .normal) return button @@ -76,6 +76,7 @@ final class TeamDetailViewController: BaseViewController { super.viewDidLoad() setupBackButton() setupEditButton() + setupExitButton() } override func configUI() { @@ -187,4 +188,14 @@ final class TeamDetailViewController: BaseViewController { } self.editButton.addAction(action, for: .touchUpInside) } + + private func setupExitButton() { + let action = UIAction { [weak self] _ in + self?.makeRequestAlert(title: TextLiteral.teamDetailViewControllerLeaveTeamAlertTitle, + message: TextLiteral.teamDetailViewControllerLeaveTeamAlertMessage, + // FIXME: - 팀 나가기 API 연결 + okAction: nil) + } + teamLeaveButton.addAction(action, for: .touchUpInside) + } } From e20e7a8d84569c5b2305d7093df7814271c9acc3 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 10 Feb 2023 11:25:10 +0900 Subject: [PATCH 138/388] =?UTF-8?q?[ADD]=20=EA=B1=B4=EB=84=88=EB=9B=B0?= =?UTF-8?q?=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80(#309)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/TextLiteral.swift | 1 + .../JoinTeam/JoinTeamViewController.swift | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 9c7f60ad..672cec70 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -101,6 +101,7 @@ enum TextLiteral { static let joinTeamViewControllerSubButtonText = "팀 생성하기" static let joinTeamViewControllerAlertTitle = "잘못된 초대코드" static let joinTeamViewControllerAlertMessage = "초대코드를 다시 입력해주세요." + static let joinTeamViewControllerSkipButtonText = "건너뛰기" // MARK: - StartReflectionViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index fb45972a..a0bac7c8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -62,6 +62,14 @@ final class JoinTeamViewController: BaseTextFieldViewController { button.addAction(action, for: .touchUpInside) return button }() + private let skipButton: UIButton = { + let button = UIButton() + button.setTitle(TextLiteral.joinTeamViewControllerSkipButtonText, for: .normal) + button.setTitleColor(.gray500, for: .normal) + button.titleLabel?.font = .toast + button.frame = CGRect(x: 0, y: 0, width: 49, height: 44) + return button + }() private lazy var createView: LabelButtonView = { let view = LabelButtonView() view.subText = TextLiteral.joinTeamViewControllerSubText @@ -78,6 +86,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { super.viewDidLoad() setupDoneButton() setupKeyboard() + setupSkipButton() } override func render() { @@ -96,9 +105,12 @@ final class JoinTeamViewController: BaseTextFieldViewController { let button = removeBarButtonItemOffset(with: backButton, offsetX: 10) let backButton = makeBarButtonItem(with: button) + let skipButton = makeBarButtonItem(with: skipButton) + navigationController?.navigationBar.prefersLargeTitles = false navigationItem.largeTitleDisplayMode = .never navigationItem.leftBarButtonItem = backButton + navigationItem.rightBarButtonItem = skipButton } // MARK: - setup @@ -116,6 +128,13 @@ final class JoinTeamViewController: BaseTextFieldViewController { super.kigoTextField.autocapitalizationType = .allCharacters } + private func setupSkipButton() { + let action = UIAction { [weak self] _ in + self?.pushHomeViewController() + } + skipButton.addAction(action, for: .touchUpInside) + } + // MARK: - func private func presentCreateTeamViewController() { @@ -130,6 +149,11 @@ final class JoinTeamViewController: BaseTextFieldViewController { navigationController?.pushViewController(viewController, animated: true) } + private func pushHomeViewController() { + let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate + sceneDelegate?.changeRootViewCustomTabBarView() + } + // MARK: - api private func fetchCertainTeam(type: SetupEndPoint) { From e6648ded3875554e92f8826a1b3c1dcc1d4e6715 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 10 Feb 2023 16:50:08 +0900 Subject: [PATCH 139/388] =?UTF-8?q?[ADD]=20=EC=A0=91=EA=B7=BC=20=EA=B6=8C?= =?UTF-8?q?=ED=95=9C=20=EC=B6=94=EA=B0=80(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 2 ++ .../SetNicknameViewController.swift | 31 +++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 93854eb6..9f8354a6 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1347,6 +1347,7 @@ INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; INFOPLIST_KEY_NSCameraUsageDescription = ""; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -1383,6 +1384,7 @@ INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; INFOPLIST_KEY_NSCameraUsageDescription = ""; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index ef69ac99..289586f0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -198,7 +198,7 @@ final class SetNicknameViewController: BaseViewController { TextLiteral.actionSheetCancelTitle ], actionStyle: [.default, .default, .cancel], - actions: [{ _ in self.openLibrary() }, { _ in self.openCamera() }, nil] + actions: [{ _ in self.setupPhotoLibrary() }, { _ in self.openCamera() }, nil] ) } @@ -306,6 +306,34 @@ final class SetNicknameViewController: BaseViewController { navigationController?.pushViewController(viewController, animated: true) } + private func setupPhotoLibrary() { + switch PHPhotoLibrary.authorizationStatus(for: .readWrite) { + case .limited, .authorized: + openLibrary() + case .notDetermined: + PHPhotoLibrary.requestAuthorization(for: .readWrite) { [weak self] status in + switch status { + case .limited, .authorized: + self?.openLibrary() + default: + self?.showPermissionAlert() + } + } + case .restricted, .denied: + showPermissionAlert() + default: + break + } + } + + private func showPermissionAlert() { + DispatchQueue.main.async { + self.makeAlert(title: "사진 접근 권한", message: "사진 추가를 원하시면 '확인'을 눌러 사진 접근을 허용해 주세요.", okAction: { _ in + UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!) + }) + } + } + // MARK: - selector @objc private func keyboardWillShow(notification: NSNotification) { @@ -399,7 +427,6 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { DispatchQueue.main.async { self.profileImageButton.profileImage.image = image as? UIImage } - // FIXME: - 이미지 정보 가져오기 } } else { self.makeAlert(title: TextLiteral.setNicknameControllerLibraryErrorAlertTitle, message: TextLiteral.setNicknameControllerLibraryErrorAlertMessage) From 977a910131efd6857cb1d4f8b2b4f60d4c05b2fa Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 10 Feb 2023 17:06:54 +0900 Subject: [PATCH 140/388] =?UTF-8?q?[ADD]=20isLogin=20&=20nickname=20userde?= =?UTF-8?q?fault=EC=97=90=20=EC=B6=94=EA=B0=80(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index ef69ac99..0a614c2f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -339,6 +339,7 @@ final class SetNicknameViewController: BaseViewController { dump(json) guard let teamId = json.detail?.id else { return } UserDefaultHandler.setTeamId(teamId: teamId) + UserDefaultHandler.setIsLogin(isLogin: true) DispatchQueue.main.async { if let invitationCode = json.detail?.team?.invitationCode { self.pushInvitationCodeViewController(invitationCode: invitationCode) @@ -361,6 +362,9 @@ final class SetNicknameViewController: BaseViewController { ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) + guard let nickname = json.detail?.nickname else { return } + UserDefaultHandler.setIsLogin(isLogin: true) + UserDefaultHandler.setNickname(nickname: nickname) DispatchQueue.main.async { if let invitationCode = json.detail?.team?.invitationCode { self.pushInvitationCodeViewController(invitationCode: invitationCode) From 177b622edb87869dcb49fe417b6fe08735a136f3 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 10 Feb 2023 17:46:27 +0900 Subject: [PATCH 141/388] =?UTF-8?q?[ADD]=20setup=20=EB=B6=84=EA=B8=B0?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EC=A0=9C=EA=B1=B0(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyReflectionViewController.swift | 1 - .../Setup/Login/LoginViewController.swift | 28 +------------------ 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift index ca1faac4..d44c6445 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift @@ -102,7 +102,6 @@ final class MyReflectionViewController: BaseViewController { private func logoutUser() { makeRequestAlert(title: TextLiteral.myReflectionViewControllerLogOutMessage, message: "", okTitle: "확인", cancelTitle: "취소") { _ in - UserDefaultHandler.clearAllData() guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate else { return } sceneDelegate.logout() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift index dbde24dc..933604be 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift @@ -44,11 +44,6 @@ final class LoginViewController: BaseViewController { // MARK: - life cycle - override func viewDidLoad() { - super.viewDidLoad() - navigateToLastView() - } - override func configUI() { super.configUI() setGradientText() @@ -110,20 +105,6 @@ final class LoginViewController: BaseViewController { UserDefaultHandler.setIsLogin(isLogin: true) } - private func navigateToLastView() { - let hasNickname = UserDefaultStorage.nickname != "" - let hasTeamId = UserDefaultStorage.teamId != 0 - if hasNickname && hasTeamId { - let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate - sceneDelegate?.changeRootViewCustomTabBarView() - self.setLoginUserDefaults() - } else if hasTeamId { - self.presentViewController(viewController: SetNicknameViewController()) - } else { - return - } - } - // MARK: - api private func dispatchAppleLogin(type: SetupEndPoint) { @@ -142,14 +123,7 @@ final class LoginViewController: BaseViewController { UserDefaultHandler.setAccessToken(accessToken: accessToken) UserDefaultHandler.setRefreshToken(refreshToken: refreshToken) UserDefaultHandler.setUserId(userId: userId) - let hasNickName = data.detail?.user?.userName != nil - let hasTeamId = data.detail?.user?.teamId != nil - if hasNickName && hasTeamId { - guard let nickName = data.detail?.user?.userName, - let teamId = data.detail?.user?.teamId - else { return } - UserDefaultHandler.setNickname(nickname: nickName) - UserDefaultHandler.setTeamId(teamId: teamId) + if UserDefaultStorage.isLogin { let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate sceneDelegate?.changeRootViewCustomTabBarView() } else { From 4d6b93bb6952162bb5e08e478793bb65760fdb2a Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sat, 11 Feb 2023 17:33:14 +0900 Subject: [PATCH 142/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateReflectionViewController.swift | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 95a772fd..6a0006e6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -54,11 +54,17 @@ final class CreateReflectionViewController: BaseViewController { }() private lazy var titleLabel: UILabel = { let label = UILabel() - label.setTitleFont(text: TextLiteral.createReflectionViewControllerTitle) + label.setTitleFont(text: isEditReflection ? TextLiteral.editReflectionViewControllerTitle : TextLiteral.createReflectionViewControllerTitle) label.textColor = .black100 return label }() - private let reflectionNameView = ReflectionNameView() + private lazy var reflectionNameView: ReflectionNameView = { + let nameView = ReflectionNameView() + if isEditReflection { + nameView.nameTextField.text = reflectionTitle + } + return nameView + }() private let reflectionDateLabel: UILabel = { let label = UILabel() label.text = TextLiteral.createReflectionViewControllerDateLabel @@ -74,6 +80,9 @@ final class CreateReflectionViewController: BaseViewController { let hideKeyboardAction = UIAction { [weak self] _ in self?.view.endEditing(true) } + if isEditReflection, let date = reflectionDate { + picker.date = date + } picker.datePickerMode = .date picker.locale = Locale(identifier: "ko_KR") picker.preferredDatePickerStyle = .compact @@ -92,6 +101,9 @@ final class CreateReflectionViewController: BaseViewController { let hideKeyboardAction = UIAction { [weak self] _ in self?.view.endEditing(true) } + if isEditReflection, let date = reflectionDate { + picker.date = date + } picker.datePickerMode = .time picker.locale = Locale(identifier: "ko_KR") picker.preferredDatePickerStyle = .inline @@ -104,7 +116,7 @@ final class CreateReflectionViewController: BaseViewController { }() private lazy var mainButton: MainButton = { let button = MainButton() - button.title = TextLiteral.createReflectionViewControllerButtonText + button.title = isEditReflection ? TextLiteral.editReflectionViewControllerButtonText : TextLiteral.createReflectionViewControllerButtonText return button }() @@ -116,12 +128,12 @@ final class CreateReflectionViewController: BaseViewController { setupNotificationCenter() } - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - if isEditReflection { - setupEditReflection() - } - } +// override func viewWillAppear(_ animated: Bool) { +// super.viewWillAppear(animated) +// if isEditReflection { +// setupEditReflection() +// } +// } override func render() { view.addSubview(titleLabel) @@ -195,9 +207,10 @@ final class CreateReflectionViewController: BaseViewController { mainButton.addAction(action, for: .touchUpInside) } + private func setupEditReflection() { - titleLabel.setTitleFont(text: TextLiteral.editReflectionViewControllerTitle) - mainButton.title = TextLiteral.editReflectionViewControllerButtonText +// titleLabel.setTitleFont(text: TextLiteral.editReflectionViewControllerTitle) +// mainButton.title = TextLiteral.editReflectionViewControllerButtonText guard let title = reflectionTitle, let date = reflectionDate else { return } reflectionNameView.nameTextField.text = title datePicker.date = date @@ -209,6 +222,7 @@ final class CreateReflectionViewController: BaseViewController { navigationItem.rightBarButtonItem = deleteButton } + // MARK: - func private func combineDateAndTime() -> Date { From 1c8635a05fd504eeff4e4f473279e55279e26c4a Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 12 Feb 2023 01:04:01 +0900 Subject: [PATCH 143/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20-=20=ED=8C=80=EA=B3=BC=20chevr?= =?UTF-8?q?on=20=EA=B0=84=EA=B2=A9=20=EB=9D=84=EC=9A=B0=EA=B8=B0=20(#297)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index b7ab73ba..dfe537c6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -272,7 +272,7 @@ final class HomeViewController: BaseViewController { else { return } self.isAdmin = isAdmin DispatchQueue.main.async { - self.teamButton.setTitle(teamName, for: .normal) + self.teamButton.setTitle(teamName + " ", for: .normal) } } else { DispatchQueue.main.async { From 2a6946fe69dbcb9118fe97df2eb418fdb14c12fe Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 12 Feb 2023 18:50:24 +0900 Subject: [PATCH 144/388] =?UTF-8?q?[ADD]=20=EC=BD=94=EB=93=9C=20toast=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EB=B3=B5=EA=B5=AC(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvitationCodeViewController.swift | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift index cfab5913..440bf375 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift @@ -56,6 +56,17 @@ final class InvitationCodeViewController: BaseViewController { label.textColor = .gray400 return label }() + private let toastView: UIView = { + let view = UIView() + view.layer.cornerRadius = 10 + view.clipsToBounds = true + return view + }() + private let toastContentView: ToastContentView = { + let view = ToastContentView() + view.toastType = .complete + return view + }() // MARK: - life cycle @@ -63,6 +74,7 @@ final class InvitationCodeViewController: BaseViewController { super.viewDidLoad() setupCopyCodeButton() setupStartButton() + setGradientToastView() render() } @@ -75,6 +87,13 @@ final class InvitationCodeViewController: BaseViewController { } override func render() { + navigationController?.view.addSubview(toastView) + toastView.snp.makeConstraints { + $0.top.equalToSuperview().inset(-60) + $0.centerX.equalToSuperview() + $0.height.equalTo(46) + } + view.addSubview(titleLabel) titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) @@ -106,12 +125,40 @@ final class InvitationCodeViewController: BaseViewController { $0.bottom.equalTo(startButton.snp.top) $0.height.equalTo(SizeLiteral.minimumTouchArea) } + + toastView.addSubview(toastContentView) + toastContentView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + toastContentView.render() } // MARK: - func + private func showToastPopUp() { + if !isTappedCopyButton { + isTappedCopyButton = true + UIView.animate(withDuration: 0.5, delay: 0, animations: { + self.toastView.transform = CGAffineTransform(translationX: 0, y: 115) + }, completion: { _ in + UIView.animate(withDuration: 1, delay: 0.8, animations: { + self.toastView.transform = .identity + }, completion: { _ in + self.isTappedCopyButton = false + }) + }) + } + } + + private func setGradientToastView() { + toastView.layoutIfNeeded() + toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) + } + private func setupCopyCodeButton() { let action = UIAction { [weak self] _ in + UIPasteboard.general.string = self?.invitedCodeLabel.text + self?.showToastPopUp() self?.presentSharePanel(text: self?.invitedCodeLabel.text ?? "") } copyCodeButton.addAction(action, for: .touchUpInside) From 252dee7b2a50ff6fdb9fb1bf6a110a5b88f0da9f Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 12 Feb 2023 18:51:51 +0900 Subject: [PATCH 145/388] =?UTF-8?q?[CHORE]=20share=20panel=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extension/UIViewController+Extension.swift | 12 ------------ .../InvitationCodeViewController.swift | 1 - 2 files changed, 13 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift index 4699d5c3..c1efa4ba 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift @@ -78,18 +78,6 @@ extension UIViewController { viewController.modalTransitionStyle = .crossDissolve self.present(viewController, animated: true) } - - func presentSharePanel(text: String) { - let shareText = text - var shareObject = [Any]() - shareObject.append(shareText) - - let activityViewController = UIActivityViewController(activityItems: shareObject, applicationActivities: nil) - activityViewController.popoverPresentationController?.sourceView = self.view - activityViewController.excludedActivityTypes = [UIActivity.ActivityType.airDrop, UIActivity.ActivityType.postToFacebook, UIActivity.ActivityType.postToTwitter, UIActivity.ActivityType.mail] - - self.present(activityViewController, animated: true, completion: nil) - } } extension UIViewController: UIGestureRecognizerDelegate { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift index 440bf375..1c488db3 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift @@ -159,7 +159,6 @@ final class InvitationCodeViewController: BaseViewController { let action = UIAction { [weak self] _ in UIPasteboard.general.string = self?.invitedCodeLabel.text self?.showToastPopUp() - self?.presentSharePanel(text: self?.invitedCodeLabel.text ?? "") } copyCodeButton.addAction(action, for: .touchUpInside) } From 29003561750225192edee8c1d231517a448c8963 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 12 Feb 2023 18:54:56 +0900 Subject: [PATCH 146/388] =?UTF-8?q?[CHORE]=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EC=88=98=EC=A0=95=20=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=B3=B5=EA=B5=AC(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Extension/UIViewController+Extension.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift index c1efa4ba..86e9f6cc 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift @@ -87,7 +87,7 @@ extension UIViewController: UIGestureRecognizerDelegate { return count > 1 } public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { - guard touch.view is UIButton else { return true } - return false + guard touch.view is UIButton else { return true } + return false } } From 24547ed7aa7e29c03e02a488e384e7e0c48523c3 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 12 Feb 2023 18:55:34 +0900 Subject: [PATCH 147/388] =?UTF-8?q?[CHORE]=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=B3=B5=EA=B5=AC(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Extension/UIViewController+Extension.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift index 86e9f6cc..7407a05c 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift @@ -89,5 +89,5 @@ extension UIViewController: UIGestureRecognizerDelegate { public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { guard touch.view is UIButton else { return true } return false - } + } } From f53867768251b2af54057e414cbd1bbe58e6e8a7 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 12 Feb 2023 18:58:39 +0900 Subject: [PATCH 148/388] =?UTF-8?q?[CHORE]=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EB=B3=B5=EA=B5=AC(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Setup/InvitationCode/InvitationCodeViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift index 1c488db3..b53e8b25 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift @@ -23,7 +23,7 @@ final class InvitationCodeViewController: BaseViewController { required init?(coder: NSCoder) { nil } // MARK: - property - + private let titleLabel: UILabel = { let label = UILabel() label.setTitleFont(text: TextLiteral.invitationCodeViewControllerTitleLabel) @@ -93,7 +93,7 @@ final class InvitationCodeViewController: BaseViewController { $0.centerX.equalToSuperview() $0.height.equalTo(46) } - + view.addSubview(titleLabel) titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.topPadding) From d150b23757b885c04409bf1a81645016ffc9dd3a Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 12 Feb 2023 22:36:06 +0900 Subject: [PATCH 149/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20-=20lazy=20var=20->=20let=20(#?= =?UTF-8?q?295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/CreateReflection/CreateReflectionViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 6a0006e6..5406fa27 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -114,7 +114,7 @@ final class CreateReflectionViewController: BaseViewController { picker.addAction(hideKeyboardAction, for: .editingDidBegin) return picker }() - private lazy var mainButton: MainButton = { + private let mainButton: MainButton = { let button = MainButton() button.title = isEditReflection ? TextLiteral.editReflectionViewControllerButtonText : TextLiteral.createReflectionViewControllerButtonText return button From 34557c32c7a2f0c65c194f8a9cd8e542db157d62 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 12 Feb 2023 22:39:07 +0900 Subject: [PATCH 150/388] [CHORE] restore previous commit (#295) --- .../Home/CreateReflection/CreateReflectionViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 5406fa27..6a0006e6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -114,7 +114,7 @@ final class CreateReflectionViewController: BaseViewController { picker.addAction(hideKeyboardAction, for: .editingDidBegin) return picker }() - private let mainButton: MainButton = { + private lazy var mainButton: MainButton = { let button = MainButton() button.title = isEditReflection ? TextLiteral.editReflectionViewControllerButtonText : TextLiteral.createReflectionViewControllerButtonText return button From 0b331aba87b3ee02471afc3ea2a6b5be5b06a863 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 12 Feb 2023 22:39:48 +0900 Subject: [PATCH 151/388] =?UTF-8?q?[CHORE]=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20(#295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateReflection/CreateReflectionViewController.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 6a0006e6..3ad1a31c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -128,13 +128,6 @@ final class CreateReflectionViewController: BaseViewController { setupNotificationCenter() } -// override func viewWillAppear(_ animated: Bool) { -// super.viewWillAppear(animated) -// if isEditReflection { -// setupEditReflection() -// } -// } - override func render() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { From 73af84dfcb71c6d1dbea2f7bacad8536acb1979a Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 17 Feb 2023 15:28:25 +0900 Subject: [PATCH 152/388] =?UTF-8?q?[ADD]=20cell=20width=20=EB=B9=84?= =?UTF-8?q?=EC=9C=A8=EB=A1=9C=20=EB=B3=80=EA=B2=BD(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMember/ReflectionMemberCollectionView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index b4fe0b83..82e00a9b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -14,7 +14,8 @@ final class ReflectionMemberCollectionView: UIView { private enum Size { static let collectionHorizontalSpacing: CGFloat = 34 static let collectionVerticalSpacing: CGFloat = 20 - static let cellLength: CGFloat = 140 + static let cellWidth: CGFloat = UIScreen.main.bounds.width * 0.37 + static let cellHeight: CGFloat = 140 static let cellInteritemSpacingSpacing: CGFloat = 27 static let cellLineSpacing: CGFloat = 20 static let collectionInsets = UIEdgeInsets( @@ -42,7 +43,7 @@ final class ReflectionMemberCollectionView: UIView { let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical flowLayout.sectionInset = Size.collectionInsets - flowLayout.itemSize = CGSize(width: Size.cellLength, height: Size.cellLength) + flowLayout.itemSize = CGSize(width: Size.cellWidth, height: Size.cellHeight) flowLayout.minimumInteritemSpacing = Size.cellInteritemSpacingSpacing flowLayout.minimumLineSpacing = Size.cellLineSpacing return flowLayout From 6c85742e6a95be42a2af8e173120e0eabd4eb34c Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 28 Feb 2023 14:41:18 +0900 Subject: [PATCH 153/388] =?UTF-8?q?[ADD]=20=EA=B0=A4=EB=9F=AC=EB=A6=AC=20J?= =?UTF-8?q?oinTeam=20&=20CreateTeam=20=EA=B5=AC=ED=98=84=20=EC=A4=91(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/SetupEndPoint.swift | 20 ++-- .../CreateTeam/CreateTeamViewController.swift | 1 + .../SetNicknameViewController.swift | 105 +++++++++++------- 3 files changed, 74 insertions(+), 52 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift index 19ae77e7..b4c124be 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift @@ -8,8 +8,8 @@ import Alamofire enum SetupEndPoint: EndPointable { - case dispatchCreateTeam(T) - case dispatchJoinTeam(teamId: Int, T) + case dispatchCreateTeam + case dispatchJoinTeam(teamId: Int) case fetchCertainTeam(invitationCode: String) case dispatchAppleLogin(T) @@ -17,7 +17,7 @@ enum SetupEndPoint: EndPointable { switch self { case .dispatchCreateTeam: return "\(UrlLiteral.baseUrl2)/teams" - case .dispatchJoinTeam(let teamId, _): + case .dispatchJoinTeam(let teamId): return "\(UrlLiteral.baseUrl2)/users/join-team/\(teamId)" case .fetchCertainTeam(let invitationCode): return "\(UrlLiteral.baseUrl2)/teams?invitation_code=\(invitationCode)" @@ -41,10 +41,10 @@ enum SetupEndPoint: EndPointable { var body: T? { switch self { - case .dispatchCreateTeam(let body): - return body - case .dispatchJoinTeam(_, let body): - return body + case .dispatchCreateTeam: + return nil + case .dispatchJoinTeam: + return nil case .fetchCertainTeam: return nil case .dispatchAppleLogin(let body): @@ -57,13 +57,15 @@ enum SetupEndPoint: EndPointable { case .dispatchCreateTeam: let headers = [ "access_token": "\(UserDefaultStorage.accessToken)", - "refresh_token": "\(UserDefaultStorage.refreshToken)" + "refresh_token": "\(UserDefaultStorage.refreshToken)", + "Content-Type": "multipart/form-data" ] return HTTPHeaders(headers) case .dispatchJoinTeam: let headers = [ "access_token": "\(UserDefaultStorage.accessToken)", - "refresh_token": "\(UserDefaultStorage.refreshToken)" + "refresh_token": "\(UserDefaultStorage.refreshToken)", + "Content-Type": "multipart/form-data" ] return HTTPHeaders(headers) case .fetchCertainTeam: diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index f0c9a4b4..13197c35 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -91,6 +91,7 @@ final class CreateTeamViewController: BaseTextFieldViewController { } } else { UserDefaultHandler.setTeamName(teamName: teamName) + UserDefaultHandler.setTeamId(teamId: 0) self?.pushSetNicknameViewController() } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 289586f0..4033abe7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -20,6 +20,7 @@ final class SetNicknameViewController: BaseViewController { } private let cameraPicker = UIImagePickerController() private let teamName: String = UserDefaultStorage.teamName + var profileURL: URL? // MARK: - property @@ -287,14 +288,12 @@ final class SetNicknameViewController: BaseViewController { private func didTappedDoneButton() { guard let nickname = nicknameTextField.text else { return } guard let role = roleTextField.text else { return } - // FIXME: - 이미지 데이터 추가 - if UserDefaultStorage.teamId == 0 { - let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) - dispatchCreateTeam(type: .dispatchCreateTeam(dto)) +// let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) + dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) } else { - let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) - dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) + // let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) + dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId), nickname: nickname, role: role) } nicknameTextField.resignFirstResponder() @@ -356,48 +355,56 @@ final class SetNicknameViewController: BaseViewController { // MARK: - api - private func dispatchCreateTeam(type: SetupEndPoint) { - AF.request(type.address, - method: type.method, - parameters: type.body, - encoder: JSONParameterEncoder.default, - headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in - if let json = json.value { - dump(json) - guard let teamId = json.detail?.id else { return } - UserDefaultHandler.setTeamId(teamId: teamId) - DispatchQueue.main.async { - if let invitationCode = json.detail?.team?.invitationCode { - self.pushInvitationCodeViewController(invitationCode: invitationCode) - } - } - } else { - DispatchQueue.main.async { - self.makeAlert(title: TextLiteral.setNicknameViewControllerCreateTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) - } + private func dispatchCreateTeam(type: SetupEndPoint, teamName: String, nickname: String, role: String?) { + AF.upload(multipartFormData: { multipartFormData in + let teamInfo: Dictionary = ["team_name": teamName, "nickname": nickname, "role": role] + for (key, value) in teamInfo { + multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") + print(key, value) + } + if let profileURL = self.profileURL { + multipartFormData.append(profileURL, withName: "profile_image", fileName: ".png", mimeType: "image/png") } + }, to: type.address, method: type.method, headers: type.headers).response { response in + dump(response) } +// AF.request(type.address, +// method: type.method, +// parameters: type.body, +// encoder: JSONParameterEncoder.default, +// headers: type.headers +// ).responseDecodable(of: BaseModel.self) { json in +// if let json = json.value { +// dump(json) +// guard let teamId = json.detail?.id else { return } +// UserDefaultHandler.setTeamId(teamId: teamId) +// DispatchQueue.main.async { +// if let invitationCode = json.detail?.team?.invitationCode { +// self.pushInvitationCodeViewController(invitationCode: invitationCode) +// } +// } +// } else { +// DispatchQueue.main.async { +// self.makeAlert(title: TextLiteral.setNicknameViewControllerCreateTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) +// } +// } +// } } - - private func dispatchJoinTeam(type: SetupEndPoint) { - AF.request(type.address, - method: type.method, - parameters: type.body, - encoder: JSONParameterEncoder.default, - headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + + private func dispatchJoinTeam(type: SetupEndPoint, nickname: String, role: String?) { + let profileInfo: Dictionary = ["nickname": nickname, "role": role] + + AF.upload(multipartFormData: { multipartFormData in + for (key, value) in profileInfo { + multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") + print(key, value) + } + if let profileURL = self.profileURL { + multipartFormData.append(profileURL, withName: "profile_image", fileName: "\(nickname).jpg", mimeType: "image/jpg") + } + }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) - DispatchQueue.main.async { - if let invitationCode = json.detail?.team?.invitationCode { - self.pushInvitationCodeViewController(invitationCode: invitationCode) - } - } - } else { - DispatchQueue.main.async { - self.makeAlert(title: TextLiteral.setNicknameViewControllerJoinTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) - } } } } @@ -427,6 +434,18 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { DispatchQueue.main.async { self.profileImageButton.profileImage.image = image as? UIImage } + let profileImage = image as? UIImage + if let data = profileImage?.pngData() { + let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let url = documents.appendingPathComponent(".png") + do { + try data.write(to: url) + self.profileURL = url + } catch { + // FIXME: - alert 추가 + print("Unable to Write Data to Disk (\(error))") + } + } } } else { self.makeAlert(title: TextLiteral.setNicknameControllerLibraryErrorAlertTitle, message: TextLiteral.setNicknameControllerLibraryErrorAlertMessage) From 42fdad06060fb115234928b92b082f7112ff10e4 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 28 Feb 2023 17:38:29 +0900 Subject: [PATCH 154/388] =?UTF-8?q?[ADD]=20=EA=B0=A4=EB=9F=AC=EB=A6=AC=20-?= =?UTF-8?q?=20CreateTeam=20=EC=84=B1=EA=B3=B5(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 49 ++++++++----------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 4033abe7..4e203b0b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -289,7 +289,7 @@ final class SetNicknameViewController: BaseViewController { guard let nickname = nicknameTextField.text else { return } guard let role = roleTextField.text else { return } if UserDefaultStorage.teamId == 0 { -// let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) + // let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) } else { // let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) @@ -359,45 +359,38 @@ final class SetNicknameViewController: BaseViewController { AF.upload(multipartFormData: { multipartFormData in let teamInfo: Dictionary = ["team_name": teamName, "nickname": nickname, "role": role] for (key, value) in teamInfo { + if let value = value { multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") - print(key, value) + } } if let profileURL = self.profileURL { multipartFormData.append(profileURL, withName: "profile_image", fileName: ".png", mimeType: "image/png") } - }, to: type.address, method: type.method, headers: type.headers).response { response in - dump(response) + }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in + if let json = json.value { + dump(json) + guard let teamId = json.detail?.id else { return } + UserDefaultHandler.setTeamId(teamId: teamId) + DispatchQueue.main.async { + if let invitationCode = json.detail?.team?.invitationCode { + self.pushInvitationCodeViewController(invitationCode: invitationCode) + } + } + } else { + DispatchQueue.main.async { + self.makeAlert(title: TextLiteral.setNicknameViewControllerCreateTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) + } + } } -// AF.request(type.address, -// method: type.method, -// parameters: type.body, -// encoder: JSONParameterEncoder.default, -// headers: type.headers -// ).responseDecodable(of: BaseModel.self) { json in -// if let json = json.value { -// dump(json) -// guard let teamId = json.detail?.id else { return } -// UserDefaultHandler.setTeamId(teamId: teamId) -// DispatchQueue.main.async { -// if let invitationCode = json.detail?.team?.invitationCode { -// self.pushInvitationCodeViewController(invitationCode: invitationCode) -// } -// } -// } else { -// DispatchQueue.main.async { -// self.makeAlert(title: TextLiteral.setNicknameViewControllerCreateTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) -// } -// } -// } } - + private func dispatchJoinTeam(type: SetupEndPoint, nickname: String, role: String?) { let profileInfo: Dictionary = ["nickname": nickname, "role": role] AF.upload(multipartFormData: { multipartFormData in for (key, value) in profileInfo { - multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") - print(key, value) + multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") + print(key, value) } if let profileURL = self.profileURL { multipartFormData.append(profileURL, withName: "profile_image", fileName: "\(nickname).jpg", mimeType: "image/jpg") From d6487ee87b7f9cef21cd779741c37ed300e1743f Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 28 Feb 2023 17:55:24 +0900 Subject: [PATCH 155/388] =?UTF-8?q?[ADD]=20=EA=B0=A4=EB=9F=AC=EB=A6=AC=20J?= =?UTF-8?q?oinTeam=20=EA=B5=AC=ED=98=84(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 4e203b0b..b5886c96 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -369,8 +369,11 @@ final class SetNicknameViewController: BaseViewController { }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) - guard let teamId = json.detail?.id else { return } + guard let teamId = json.detail?.team?.id else { return } + guard let nickname = json.detail?.nickname else { return } UserDefaultHandler.setTeamId(teamId: teamId) + UserDefaultHandler.setNickname(nickname: nickname) + UserDefaultHandler.setIsLogin(isLogin: true) DispatchQueue.main.async { if let invitationCode = json.detail?.team?.invitationCode { self.pushInvitationCodeViewController(invitationCode: invitationCode) @@ -385,19 +388,33 @@ final class SetNicknameViewController: BaseViewController { } private func dispatchJoinTeam(type: SetupEndPoint, nickname: String, role: String?) { - let profileInfo: Dictionary = ["nickname": nickname, "role": role] - AF.upload(multipartFormData: { multipartFormData in + let profileInfo: Dictionary = ["nickname": nickname, "role": role] for (key, value) in profileInfo { - multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") - print(key, value) + if let value = value { + multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") + } } if let profileURL = self.profileURL { - multipartFormData.append(profileURL, withName: "profile_image", fileName: "\(nickname).jpg", mimeType: "image/jpg") + multipartFormData.append(profileURL, withName: "profile_image", fileName: ".png", mimeType: "image/png") } }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) + guard let teamId = json.detail?.team?.id else { return } + guard let nickname = json.detail?.nickname else { return } + UserDefaultHandler.setTeamId(teamId: teamId) + UserDefaultHandler.setNickname(nickname: nickname) + UserDefaultHandler.setIsLogin(isLogin: true) + DispatchQueue.main.async { + if let invitationCode = json.detail?.team?.invitationCode { + self.pushInvitationCodeViewController(invitationCode: invitationCode) + } + } + } else { + DispatchQueue.main.async { + self.makeAlert(title: TextLiteral.setNicknameViewControllerJoinTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) + } } } } From 239df2f81ce458fb88fb8851fbd0e7915a1ed30b Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 28 Feb 2023 19:48:30 +0900 Subject: [PATCH 156/388] =?UTF-8?q?[ADD]=20=EC=B9=B4=EB=A9=94=EB=9D=BC=20C?= =?UTF-8?q?reateTeam=20&=20JoinTeam=20=EA=B5=AC=ED=98=84(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Setup/SetNickname/SetNicknameViewController.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index b5886c96..84c11330 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -470,6 +470,17 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate, UINavigati if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { self.profileImageButton.profileImage.image = image + if let data = image.pngData() { + let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let url = documents.appendingPathComponent(".png") + do { + try data.write(to: url) + self.profileURL = url + } catch { + // FIXME: - alert 추가 + print("Unable to Write Data to Disk (\(error))") + } + } } } } From e03ab32df35e03830b279af472cebd1c639a7a01 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 1 Mar 2023 13:28:16 +0900 Subject: [PATCH 157/388] =?UTF-8?q?[ADD]=20alert=20=EC=B6=94=EA=B0=80(#311?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Setup/SetNickname/SetNicknameViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 84c11330..97ecc489 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -452,8 +452,7 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { try data.write(to: url) self.profileURL = url } catch { - // FIXME: - alert 추가 - print("Unable to Write Data to Disk (\(error))") + self.makeAlert(title: TextLiteral.setNicknameControllerLibraryErrorAlertTitle, message: TextLiteral.setNicknameControllerLibraryErrorAlertMessage) } } } @@ -477,9 +476,10 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate, UINavigati try data.write(to: url) self.profileURL = url } catch { - // FIXME: - alert 추가 - print("Unable to Write Data to Disk (\(error))") + self.makeAlert(title: "촬영된 이미지를 불러올 수 없습니다.", message: "다시 시도해 주세요.") } + } else { + self.makeAlert(title: "촬영된 이미지를 불러올 수 없습니다.", message: "다시 시도해 주세요.") } } } From fa529bddff813ed78094e7b8d5bcf44b5d3b8d6c Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 1 Mar 2023 13:44:40 +0900 Subject: [PATCH 158/388] =?UTF-8?q?[ADD]=20Textliteral=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Literal/TextLiteral.swift | 3 +++ .../Setup/SetNickname/SetNicknameViewController.swift | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 9c7f60ad..97c05b94 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -60,6 +60,9 @@ enum TextLiteral { static let setNicknameViewControllerCreateTeamAlertTitle = "팀 생성 및 팀 합류 실패" static let setNicknameViewControllerJoinTeamAlertTitle = "팀 합류 실패" static let setNicknameViewControllerAlertMessage = "다시 시도해 주세요." + static let setNicknameViewControllerPermissionAlertTitle = "사진 접근 권한" + static let setNicknameViewControllerPermissionAlertMessage = "사진 추가를 원하시면 '확인'을 눌러 사진 접근을 허용해 주세요." + static let setNicknameViewControllerCameraAlertTitle = "촬영된 이미지를 불러올 수 없습니다." // MARK: - HomeViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 97ecc489..748ed3ca 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -289,10 +289,8 @@ final class SetNicknameViewController: BaseViewController { guard let nickname = nicknameTextField.text else { return } guard let role = roleTextField.text else { return } if UserDefaultStorage.teamId == 0 { - // let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) } else { - // let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId), nickname: nickname, role: role) } @@ -327,7 +325,7 @@ final class SetNicknameViewController: BaseViewController { private func showPermissionAlert() { DispatchQueue.main.async { - self.makeAlert(title: "사진 접근 권한", message: "사진 추가를 원하시면 '확인'을 눌러 사진 접근을 허용해 주세요.", okAction: { _ in + self.makeAlert(title: TextLiteral.setNicknameViewControllerPermissionAlertTitle, message: TextLiteral.setNicknameViewControllerPermissionAlertMessage, okAction: { _ in UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!) }) } @@ -476,10 +474,10 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate, UINavigati try data.write(to: url) self.profileURL = url } catch { - self.makeAlert(title: "촬영된 이미지를 불러올 수 없습니다.", message: "다시 시도해 주세요.") + self.makeAlert(title: TextLiteral.setNicknameViewControllerCameraAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) } } else { - self.makeAlert(title: "촬영된 이미지를 불러올 수 없습니다.", message: "다시 시도해 주세요.") + self.makeAlert(title: TextLiteral.setNicknameViewControllerCameraAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) } } } From 68a25e76df7abb28a631d38afd386e104c9fab98 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:48:40 +0900 Subject: [PATCH 159/388] =?UTF-8?q?[CHORE]=20=EC=95=88=EC=93=B4=EB=8A=90?= =?UTF-8?q?=20=ED=95=A8=EC=88=98=20=EC=A4=84=EC=9D=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index f8c56ece..a038ea80 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -385,6 +385,4 @@ extension HomeViewController: UICollectionViewDelegateFlowLayout { } } -extension HomeViewController: UISheetPresentationControllerDelegate { - -} +extension HomeViewController: UISheetPresentationControllerDelegate {} From 1ceb7d5464beca5586bdcbc7f9e095aabe82521a Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:54:06 +0900 Subject: [PATCH 160/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20Cell=20->=20View=20=EB=A1=9C?= =?UTF-8?q?=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageSettingCell.swift | 2 +- .../Screen/Home/Home/TeamManageViewController.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift index d677e0a1..c29180b2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift @@ -33,7 +33,7 @@ final class TeamManageSettingCell: BaseTableViewCell { } } -final class TeamManageSettingFooterCell: UITableViewHeaderFooterView { +final class TeamManageSettingFooterView: UITableViewHeaderFooterView { override init(reuseIdentifier: String?) { super.init(reuseIdentifier: reuseIdentifier) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 08b2e4a1..5f3ee132 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -27,7 +27,7 @@ final class TeamManageViewController: BaseViewController { private let settingTableView: UITableView = { let tableView = UITableView() tableView.register(TeamManageSettingCell.self, forCellReuseIdentifier: TeamManageSettingCell.className) - tableView.register(TeamManageSettingFooterCell.self, forHeaderFooterViewReuseIdentifier: TeamManageSettingFooterCell.className) + tableView.register(TeamManageSettingFooterView.self, forHeaderFooterViewReuseIdentifier: TeamManageSettingFooterView.className) tableView.isScrollEnabled = false tableView.separatorInset = UIEdgeInsets(top: 0, left: SizeLiteral.leadingTrailingPadding, bottom: 0, right: SizeLiteral.leadingTrailingPadding) return tableView @@ -121,7 +121,7 @@ extension TeamManageViewController: UITableViewDataSource { } func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { - guard let view = tableView.dequeueReusableHeaderFooterView(withIdentifier: TeamManageSettingFooterCell.className) as? TeamManageSettingFooterCell else { return UITableViewHeaderFooterView() + guard let view = tableView.dequeueReusableHeaderFooterView(withIdentifier: TeamManageSettingFooterView.className) as? TeamManageSettingFooterView else { return UITableViewHeaderFooterView() } return view } From 4e5fe33bcb99fd9cf5edc855aabd74371ce29789 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:56:18 +0900 Subject: [PATCH 161/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20=EC=BB=A8=EB=B2=A4=EC=85=98=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 5f3ee132..4c40219d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -29,7 +29,10 @@ final class TeamManageViewController: BaseViewController { tableView.register(TeamManageSettingCell.self, forCellReuseIdentifier: TeamManageSettingCell.className) tableView.register(TeamManageSettingFooterView.self, forHeaderFooterViewReuseIdentifier: TeamManageSettingFooterView.className) tableView.isScrollEnabled = false - tableView.separatorInset = UIEdgeInsets(top: 0, left: SizeLiteral.leadingTrailingPadding, bottom: 0, right: SizeLiteral.leadingTrailingPadding) + tableView.separatorInset = UIEdgeInsets(top: 0, + left: SizeLiteral.leadingTrailingPadding, + bottom: 0, + right: SizeLiteral.leadingTrailingPadding) return tableView }() From 9097b23de00b98184a8de72bd2576810ad723ef2 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 2 Mar 2023 22:15:40 +0900 Subject: [PATCH 162/388] =?UTF-8?q?[FEAT]=20=EC=8A=A4=ED=81=AC=EB=A1=A4?= =?UTF-8?q?=EB=B7=B0=20=EC=B6=94=EA=B0=80=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 4c40219d..7e6f6e7f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -35,6 +35,7 @@ final class TeamManageViewController: BaseViewController { right: SizeLiteral.leadingTrailingPadding) return tableView }() + private let scrollView: UIScrollView = UIScrollView() // MARK: - life cycle @@ -45,24 +46,29 @@ final class TeamManageViewController: BaseViewController { } override func render() { - view.addSubview(tempView) + view.addSubview(scrollView) + scrollView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + + scrollView.addSubview(tempView) tempView.snp.makeConstraints { - $0.width.equalToSuperview() + $0.width.equalTo(UIScreen.main.bounds.width) $0.height.equalTo(275) // FIXME: 수치 바꿀것 $0.top.equalToSuperview() } - view.addSubview(dividerView) + scrollView.addSubview(dividerView) dividerView.snp.makeConstraints { $0.top.equalTo(tempView.snp.bottom) $0.width.equalToSuperview() $0.height.equalTo(6) } - view.addSubview(settingTableView) + scrollView.addSubview(settingTableView) settingTableView.snp.makeConstraints { $0.top.equalTo(dividerView.snp.bottom) - $0.directionalHorizontalEdges.equalToSuperview() + $0.width.equalTo(UIScreen.main.bounds.width) $0.height.equalTo(1000) // FIXME: 수치 바꿀것 } } From b08169738107fb3844f3ead80edb5162d216202e Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Fri, 3 Mar 2023 16:27:19 +0900 Subject: [PATCH 163/388] [CHORE] build error resolved (#292) --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index b584211d..5be4ed47 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -305,7 +305,7 @@ final class HomeViewController: BaseViewController { case .Progressing: self.hideAddFeedbackButton() if !UserDefaultStorage.hasSeenReflectionAlert { - self.showStartReflectionView() + self.presentStartReflectionView() } } self.flowLayout.count = reflectionKeywordList.count From 7eabe355220419e25c13f14a337571cd5a4a24e1 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 3 Mar 2023 19:35:16 +0900 Subject: [PATCH 164/388] =?UTF-8?q?[ADD]=20Empty=20=ED=8C=80=20=EB=B7=B0?= =?UTF-8?q?=20=EB=A7=8C=EB=93=A4=EA=B8=B0=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../Global/Literal/ImageLiteral.swift | 1 + .../Global/Literal/TextLiteral.swift | 4 ++ .../team.imageset/Contents.json | 15 +++++ .../Assets.xcassets/team.imageset/team.pdf | Bin 0 -> 3746 bytes .../Home/Home/TeamManageViewController.swift | 2 +- .../Home/UIComponent/ChangeTeamView.swift | 24 ++++++-- .../Home/Home/UIComponent/EmptyTeamView.swift | 57 ++++++++++++++++++ 8 files changed, 100 insertions(+), 7 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/team.imageset/Contents.json create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/team.imageset/team.pdf create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/EmptyTeamView.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index c2c8baee..cb7c0c84 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -138,6 +138,7 @@ D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */; }; D7505119294239A5001BDA34 /* SelectMemberView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7505118294239A5001BDA34 /* SelectMemberView.swift */; }; D750511B29423CB6001BDA34 /* SelectKeywordTypeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D750511A29423CB6001BDA34 /* SelectKeywordTypeView.swift */; }; + D75D0D2229B2003F0013ADA5 /* EmptyTeamView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D75D0D2129B2003F0013ADA5 /* EmptyTeamView.swift */; }; D79D908C2903B6B1004DDC4A /* LabelButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D79D908B2903B6B1004DDC4A /* LabelButtonView.swift */; }; D79D908E29041F42004DDC4A /* CreateTeamViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D79D908D29041F42004DDC4A /* CreateTeamViewController.swift */; }; D7A585222990C50700E1F4EE /* TeamManageSettingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */; }; @@ -283,6 +284,7 @@ D72CF1AF290552960067A118 /* InvitationCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeViewController.swift; sourceTree = ""; }; D7505118294239A5001BDA34 /* SelectMemberView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectMemberView.swift; sourceTree = ""; }; D750511A29423CB6001BDA34 /* SelectKeywordTypeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectKeywordTypeView.swift; sourceTree = ""; }; + D75D0D2129B2003F0013ADA5 /* EmptyTeamView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyTeamView.swift; sourceTree = ""; }; D79D908B2903B6B1004DDC4A /* LabelButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelButtonView.swift; sourceTree = ""; }; D79D908D29041F42004DDC4A /* CreateTeamViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateTeamViewController.swift; sourceTree = ""; }; D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageSettingCell.swift; sourceTree = ""; }; @@ -727,6 +729,7 @@ 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */, D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */, D7195FBB299223F6002526E7 /* TeamChangeCollectionViewCell.swift */, + D75D0D2129B2003F0013ADA5 /* EmptyTeamView.swift */, ); path = UIComponent; sourceTree = ""; @@ -1126,6 +1129,7 @@ 7E8753E129348BB000FBBF83 /* MyReflectionDetailViewLastCell.swift in Sources */, 395C7E1828F9912700FC2FCA /* UIButton+Extension.swift in Sources */, 39AC287F29269BC6006CFEE6 /* Endpointable.swift in Sources */, + D75D0D2229B2003F0013ADA5 /* EmptyTeamView.swift in Sources */, 7EE38BAD2925DDD200FD738D /* EncodeDTO.swift in Sources */, 3E557FC328FE7BBC00714E46 /* HomeViewController.swift in Sources */, 39847428292656EB00EDC139 /* VoidModel.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift index 6a678574..d257445a 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift @@ -42,6 +42,7 @@ enum ImageLiterals { static var imgProgress4: UIImage { .load(name: "ProgressBar4") } static var imgProgress5: UIImage { .load(name: "ProgressBar5") } static var imgProfileNone: UIImage { .load(name: "profileNone") } + static var imgEmptyTeam: UIImage { .load(name: "team") } } extension UIImage { diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index a319be04..d46bea47 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -234,4 +234,8 @@ enum TextLiteral { // MARK: - TeamDetailViewController static let teamDetailViewControllerEditButteonText: String = "편집" + + // MARK: - TeamManageViewController + + static let teamManageViewControllerEmptyLabel: String = "아직 팀에 합류한 팀원이 없습니다\n초대코드를 공유하여 팀원을 초대해주세요" } diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/team.imageset/Contents.json b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/team.imageset/Contents.json new file mode 100644 index 00000000..5153f8ff --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/team.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "team.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/team.imageset/team.pdf b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/team.imageset/team.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1c57ebc85eac64c3373069a0e1ed6aa873e526d6 GIT binary patch literal 3746 zcmbtXTW{Mo6n^Kg;7ft@Au{h2fgnKR)I+v*&5{gz==z|@a-t!YGg}$j{rY`}l1ar$ z`!WGG$Qkjhx8_^|-!r7O8Cf>*2dQ&`u3lL*b(JJ?6h_% zIxe9^+x63JPrl8_Lrsi}1~i@_V#-*@nkI3)>@n%N#2B*bm|ui1IK zTEXV7Zg%`LB+Vf4%i%^O?jZb+cG=(WIOW*Y2rV{Ue|EO{N~a4EpC7%9vS)PcW7Th4 zIw-$?@CQqKQG=5ta5U*=^Ly7)oH=ECGPK?9dSVYbHF)!(IsmT543FGKr}4EfEDu>j z#E4l^7b#vyPEn%>P=W7vm(O;OZ6J&r_ibQy-u%!ek{Akj!ACC`|IZs$S(3v7ZWD@mf4aB}L+D}LAD1HM`5oPd|2D2;&0 z-~$>|2&J$SREE7rQWsiFVX>MqSJ=VJnoUqz4-$6(NgS9_XxLgQ#3Sp@7*6Acamob* zJM9dGc0yBlAdq-59FVt&Fqf_{!Aj}DMh3Hq5T~^cxN(w$S#idQ3{yf+kVa1Su9-!m zkV?>*Bv=i1tq$0kG)=IHNfR{LP7<|$?qb%R-L9Fjdw(-(bOH9De4szlJHaM_n4rl@ zk|=~N-Nc)$J9|icz>T5Wj#J&m+%Pg`Uq&C8v_*i+z)KJi<>sIzsAj$hu0$T>ZPY3(r3zkx2`at} z2rQFjfJaob`)wF#oQjEL&>5&9@a)$s1Q0J4xV6H=*$FYWER0qTiI`Cv;D;56Rn{}X zCI)3R8E#Dxv~)z zK4U-1k;FDL@SI(%U!~yz^dMEq90{i<^cYdt5c^9;9~cZ3Ad*JIv=>-uREz|QSE9*E zKEVVkKa?d!F{8-u5Mq-Jg|Ld+dRf@g1c$DjdS8OjIHANTjTVIxBqwfo!u}!x#7}PH@>{OHeQ1_Yc|7$o^IEh75mJO z{=~_*{0qPNnZ3V(b#%!ejB|9e55ob9*`_H#(uALfhId`J=`m+LpIk00%&5ae^08UA z)%S)ei%e6f>5?lH*>G>~CFRM5#+3cYGslpE8Fj~L8rg%F70s=<|3+*wv_veM`%Al| zp)fjewVw)S^UV_--_KfcKqVJ;K&G-&^iwwOcXC5RMEk%fQ$DzB+<AI&{Gs()8w`@;!G2q{4-Nj1fVzuw1mS46SvPO_QM*JY68E#K%?4p0mSbdR a*X_RzF@_lI`fA%p4z&@Uy?OKg)8apSa6P*K literal 0 HcmV?d00001 diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 92e79d97..475d730b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -54,7 +54,7 @@ final class TeamManageViewController: BaseViewController { chageTeamView.snp.makeConstraints { $0.top.equalToSuperview() $0.width.equalToSuperview() - $0.height.equalTo(375) // FIXME: 수치 바꿀것 + $0.height.equalTo(280) // FIXME: 수치 바꿀것 } scrollView.addSubview(dividerView) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 3da66e14..a7eaea83 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -12,7 +12,7 @@ import SnapKit final class ChangeTeamView: UIView { // MARK: - FIXME: 데이터 더미 입니다. - private let teamDataDummy: [String] = ["맛쟁이 사과처럼", "굿굿이에요", "테스트더미에요"] + private let teamDataDummy: [String] = [] // MARK: - property @@ -26,8 +26,8 @@ final class ChangeTeamView: UIView { private let collectionViewFlowLayout: UICollectionViewFlowLayout = { let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical - flowLayout.sectionInset = UIEdgeInsets(top: 12, left: SizeLiteral.leadingTrailingPadding, bottom: 16, right: SizeLiteral.leadingTrailingPadding) - flowLayout.itemSize = CGSize(width: 335, height: 59) + flowLayout.sectionInset = UIEdgeInsets(top: 12, left: 0 , bottom: 16, right: 0) + flowLayout.itemSize = CGSize(width: UIScreen.main.bounds.width - SizeLiteral.leadingTrailingPadding*2, height: 59) flowLayout.minimumLineSpacing = 8 return flowLayout }() @@ -39,6 +39,7 @@ final class ChangeTeamView: UIView { collectionView.backgroundColor = .white200 return collectionView }() + private lazy var emptyView = EmptyTeamView() // MARK: - life cycle @@ -61,6 +62,12 @@ final class ChangeTeamView: UIView { $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + teamDataDummy.isEmpty ? setLayoutEmptyView() : setLayoutTeamListView() + } + + // MARK: - function + + private func setLayoutTeamListView() { self.addSubview(teamCollectionView) teamCollectionView.snp.makeConstraints { $0.top.equalTo(titleLabel.snp.bottom) @@ -69,9 +76,14 @@ final class ChangeTeamView: UIView { } } - // MARK: - function - - + private func setLayoutEmptyView() { + self.addSubview(emptyView) + emptyView.snp.makeConstraints { + $0.top.equalTo(titleLabel.snp.bottom) + $0.directionalHorizontalEdges.equalToSuperview() + $0.height.equalToSuperview() + } + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/EmptyTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/EmptyTeamView.swift new file mode 100644 index 00000000..cddfb459 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/EmptyTeamView.swift @@ -0,0 +1,57 @@ +// +// EmptyTeamView.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/03/03. +// + +import UIKit + +import SnapKit + +final class EmptyTeamView: UIView { + + // MARK: - property + + private let emptyTeamImage: UIImageView = { + let imageView = UIImageView() + imageView.image = ImageLiterals.imgEmptyTeam + imageView.tintColor = .gray700 + return imageView + }() + private let emptyLabel: UILabel = { + let label = UILabel() + label.text = TextLiteral.teamManageViewControllerEmptyLabel + label.setLineSpacing(to: 4) + label.textAlignment = .center + label.numberOfLines = 2 + label.textColor = .gray700 + label.font = .body3 + return label + }() + + // MARK: - life cycle + + override init(frame: CGRect) { + super.init(frame: frame) + render() + } + + required init?(coder: NSCoder) { nil } + + private func render() { + self.addSubview(emptyTeamImage) + emptyTeamImage.snp.makeConstraints { + $0.centerY.equalToSuperview().offset(-60) + $0.centerX.equalToSuperview() + $0.width.equalTo(63) + $0.height.equalTo(30) + } + + self.addSubview(emptyLabel) + emptyLabel.snp.makeConstraints { + $0.top.equalTo(emptyTeamImage.snp.bottom).offset(20) + $0.centerX.equalToSuperview() + } + } +} From 4670442da71b16f6a72eef073d59f358c61166a9 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 3 Mar 2023 19:54:14 +0900 Subject: [PATCH 165/388] =?UTF-8?q?[CHORE]=20=EC=B0=B8=EC=97=AC=EC=A4=91?= =?UTF-8?q?=EC=9D=B8=20=ED=8C=80=20=EA=B0=AF=EC=88=98=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=EC=85=80=20UI=20=EB=B3=80=EA=B2=BD=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 3 ++- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 475d730b..20a3b3f2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -12,6 +12,7 @@ import SnapKit final class TeamManageViewController: BaseViewController { private var sections: [Section] = [] + private lazy var teamCount = chageTeamView.teamDataDummy.count // MARK: - property @@ -54,7 +55,7 @@ final class TeamManageViewController: BaseViewController { chageTeamView.snp.makeConstraints { $0.top.equalToSuperview() $0.width.equalToSuperview() - $0.height.equalTo(280) // FIXME: 수치 바꿀것 + teamCount == 0 ? $0.height.equalTo(280) : $0.height.equalTo(teamCount * 59 + (teamCount-1) * 8 + 80) } scrollView.addSubview(dividerView) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index a7eaea83..599aadc9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -12,7 +12,7 @@ import SnapKit final class ChangeTeamView: UIView { // MARK: - FIXME: 데이터 더미 입니다. - private let teamDataDummy: [String] = [] + let teamDataDummy: [String] = ["맛쟁이 사과처럼", "명예 소방관"] // MARK: - property @@ -31,7 +31,7 @@ final class ChangeTeamView: UIView { flowLayout.minimumLineSpacing = 8 return flowLayout }() - private lazy var teamCollectionView: UICollectionView = { + lazy var teamCollectionView: UICollectionView = { let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewFlowLayout) collectionView.delegate = self collectionView.dataSource = self From e7bf08feda11a431c9bb43b79ffa4e73cc259352 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sat, 4 Mar 2023 01:20:49 +0900 Subject: [PATCH 166/388] [CHORE] delete reflection feature added (#295) --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../EndPoint/CreateReflectionEndPoint.swift | 13 +++++ .../Response/DeleteReflectionResponse.swift | 16 ++++++ .../CreateReflectionViewController.swift | 56 +++++++++++++------ 4 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/DeleteReflectionResponse.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 06af6ddc..f239e758 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -87,6 +87,7 @@ 3E5195A42928C8FB00710A01 /* CreateReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */; }; 3E5195AB292B05BC00710A01 /* JoinReflectionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */; }; 3E5368992992461A000CBD48 /* DeleteButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5368982992461A000CBD48 /* DeleteButton.swift */; }; + 3E5368C629B24351000CBD48 /* DeleteReflectionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */; }; 3E557FC328FE7BBC00714E46 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */; }; 3E557FC528FE854600714E46 /* KeywordLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FC428FE854600714E46 /* KeywordLabel.swift */; }; 3E557FF82901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FF72901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift */; }; @@ -227,6 +228,7 @@ 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateReflectionEndPoint.swift; sourceTree = ""; }; 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinReflectionButton.swift; sourceTree = ""; }; 3E5368982992461A000CBD48 /* DeleteButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteButton.swift; sourceTree = ""; }; + 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteReflectionResponse.swift; sourceTree = ""; }; 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 3E557FC428FE854600714E46 /* KeywordLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordLabel.swift; sourceTree = ""; }; 3E557FF72901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordCollectionViewFlowLayout.swift; sourceTree = ""; }; @@ -694,6 +696,7 @@ 398474212925CF4800EDC139 /* TeamInfoResponse.swift */, 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */, 396334DA292DAE8300E74B77 /* UserResponse.swift */, + 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */, ); path = Response; sourceTree = ""; @@ -1198,6 +1201,7 @@ 52F2D1C12906F172009CBF89 /* SelectReflectionMemberViewController.swift in Sources */, 395C7E0328F945B500FC2FCA /* UIFont+Extension.swift in Sources */, 3E8052DF2906E09100A6449D /* KeywordSectionHeaderView.swift in Sources */, + 3E5368C629B24351000CBD48 /* DeleteReflectionResponse.swift in Sources */, 3EDED991293B8CE00000B4DC /* AddFeedbackContentViewController.swift in Sources */, 39436C182912A2E10083D77A /* Feedback.swift in Sources */, 7E2ECA102901136700A4D65C /* SetNicknameViewController.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/CreateReflectionEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/CreateReflectionEndPoint.swift index 1425cce8..9dc3b5f8 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/CreateReflectionEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/CreateReflectionEndPoint.swift @@ -9,11 +9,14 @@ import Alamofire enum CreateReflectionEndPoint { case patchReflectionDetail(reflectionId: Int, T) + case deleteReflectionDetail(reflectionId: Int) var address: String { switch self { case .patchReflectionDetail(let reflectionId, _): return "\(UrlLiteral.v2BaseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)" + case .deleteReflectionDetail(let reflectionId): + return "\(UrlLiteral.v2BaseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)" } } @@ -21,6 +24,8 @@ enum CreateReflectionEndPoint { switch self { case .patchReflectionDetail: return .patch + case .deleteReflectionDetail: + return .delete } } @@ -28,6 +33,8 @@ enum CreateReflectionEndPoint { switch self { case .patchReflectionDetail(_, let body): return body + case .deleteReflectionDetail(_): + return nil } } @@ -39,6 +46,12 @@ enum CreateReflectionEndPoint { "refresh_token": "\(UserDefaultStorage.refreshToken)" ] return HTTPHeaders(headers) + case .deleteReflectionDetail: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)" + ] + return HTTPHeaders(headers) } } } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/DeleteReflectionResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/DeleteReflectionResponse.swift new file mode 100644 index 00000000..3c447a39 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/Response/DeleteReflectionResponse.swift @@ -0,0 +1,16 @@ +// +// DeleteReflectionResponse.swift +// Maddori.Apple +// +// Created by 이성민 on 2023/03/04. +// + +import Foundation + +struct DeleteReflectionResponse: Decodable { + let id: Int + let reflection_name: String? + let date: String? + let state: String + let team_id: Int +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 3ad1a31c..5e950dfd 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -125,6 +125,7 @@ final class CreateReflectionViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() setupAddReflection() + setupDeleteReflection() setupNotificationCenter() } @@ -168,8 +169,15 @@ final class CreateReflectionViewController: BaseViewController { } override func setupNavigationBar() { - let item = makeBarButtonItem(with: closeButton) - navigationItem.rightBarButtonItem = item + if !isEditReflection { + let closeButton = makeBarButtonItem(with: closeButton) + navigationItem.rightBarButtonItem = closeButton + } else { + let closeButton = makeBarButtonItem(with: closeButton) + let deleteButton = makeBarButtonItem(with: deleteButton) + navigationItem.leftBarButtonItem = closeButton + navigationItem.rightBarButtonItem = deleteButton + } } // MARK: - setup @@ -200,22 +208,25 @@ final class CreateReflectionViewController: BaseViewController { mainButton.addAction(action, for: .touchUpInside) } - - private func setupEditReflection() { -// titleLabel.setTitleFont(text: TextLiteral.editReflectionViewControllerTitle) -// mainButton.title = TextLiteral.editReflectionViewControllerButtonText - guard let title = reflectionTitle, let date = reflectionDate else { return } - reflectionNameView.nameTextField.text = title - datePicker.date = date - timePicker.date = date - - let closeButton = makeBarButtonItem(with: closeButton) - let deleteButton = makeBarButtonItem(with: deleteButton) - navigationItem.leftBarButtonItem = closeButton - navigationItem.rightBarButtonItem = deleteButton + private func setupDeleteReflection() { + let action = UIAction { [weak self] _ in + guard let reflectionId = self?.reflectionId else { return } + + let alert = UIAlertController(title: "회고 일정 삭제하게", message: "회고 일정을 정말 삭제하시겠습니까?", preferredStyle: .alert) + let cancelAction = UIAlertAction(title: "취소", style: .cancel) + let deleteAction = UIAlertAction(title: "삭제", style: .destructive) { [weak self] _ in + self?.deleteReflectionDetail(type: .deleteReflectionDetail(reflectionId: reflectionId)) + self?.dismiss(animated: true) + } + + alert.addAction(cancelAction) + alert.addAction(deleteAction) + + self?.present(alert, animated: true) + } + deleteButton.addAction(action, for: .touchUpInside) } - // MARK: - func private func combineDateAndTime() -> Date { @@ -272,4 +283,17 @@ final class CreateReflectionViewController: BaseViewController { } } } + + private func deleteReflectionDetail(type: CreateReflectionEndPoint) { + AF.request(type.address, + method: type.method, + parameters: type.body, + encoder: JSONParameterEncoder.default, + headers: type.header + ).responseDecodable(of: BaseModel.self) { [weak self] json in + if let result = json.value { + dump(result) + } + } + } } From a36768932b6a7c03fd65bbf5e712e73b00391579 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Sat, 4 Mar 2023 09:53:42 +0900 Subject: [PATCH 167/388] =?UTF-8?q?[CHORE]=20=EC=B0=B8=EC=97=AC=EC=A4=91?= =?UTF-8?q?=EC=9D=B8=20=ED=8C=80=20=EB=86=92=EC=9D=B4=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 20a3b3f2..e5019558 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -55,7 +55,7 @@ final class TeamManageViewController: BaseViewController { chageTeamView.snp.makeConstraints { $0.top.equalToSuperview() $0.width.equalToSuperview() - teamCount == 0 ? $0.height.equalTo(280) : $0.height.equalTo(teamCount * 59 + (teamCount-1) * 8 + 80) + teamCount == 0 ? $0.height.equalTo(280) : $0.height.equalTo((teamCount * 59) + ((teamCount-1) * 8) + 80) } scrollView.addSubview(dividerView) From beb8fcade4496c3560ccdefb08b1decf39848568 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 01:46:11 +0900 Subject: [PATCH 168/388] =?UTF-8?q?[ADD]=20=EB=9D=84=EC=96=B4=EC=93=B0?= =?UTF-8?q?=EA=B8=B0=20=EC=88=98=EC=A0=95(#300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 9c7f60ad..2aee3228 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -119,7 +119,7 @@ enum TextLiteral { static let invitationCodeViewControllerTitleLabel = "초대코드를 공유하여\n팀원들을 초대해주세요" static let invitationCodeViewControllerCopyCodeButtonText = "코드 복사하기" static let invitationCodeViewControllerStartButtonText = "시작하기" - static let invitationCodeViewControllerSubLabelText = "초대코드는 팀관리 화면에서 공유할 수 있습니다" + static let invitationCodeViewControllerSubLabelText = "초대코드는 팀 관리 화면에서 공유할 수 있습니다" // MARK: - StartSuggestionView From c2ceb9af2f2e40c613e4fe4d95cd65c4929dd6a8 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 15:09:48 +0900 Subject: [PATCH 169/388] =?UTF-8?q?[CHORE]=20resetAttribute=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionViewCell.swift | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index d73bef65..9823788d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -13,11 +13,7 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { override var isSelected: Bool { didSet { - if isSelected { - applyAttribute() - } else { - resetAttribute() - } + applyAttribute() } } @@ -81,12 +77,4 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { self.roleLabel.textColor = .gray300 self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 1) } - - private func resetAttribute() { - self.backgroundColor = .white300 - self.profileImage.layer.opacity = 1 - self.nicknameLabel.textColor = .gray600 - self.roleLabel.textColor = .gray400 - self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 2) - } } From f333847f3e6dd622a3a8ec9c7f147ab0b73dfdd3 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 16:09:58 +0900 Subject: [PATCH 170/388] =?UTF-8?q?[ADD]=20=EC=95=A8=EB=B2=94=20=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=20=ED=97=88=EC=9A=A9=20=EC=97=90=EB=9F=AC=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 748ed3ca..5a2d8c91 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -311,7 +311,9 @@ final class SetNicknameViewController: BaseViewController { PHPhotoLibrary.requestAuthorization(for: .readWrite) { [weak self] status in switch status { case .limited, .authorized: - self?.openLibrary() + DispatchQueue.main.async { + self?.openLibrary() + } default: self?.showPermissionAlert() } From 4080ebb3245c24b279a2106894c60acceb8f3660 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 5 Mar 2023 16:38:15 +0900 Subject: [PATCH 171/388] [CHORE] deleting reflection detail edited (#295) --- .../Global/Literal/TextLiteral.swift | 4 +++- .../CreateReflectionViewController.swift | 15 ++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 8d4f021e..37ad23ec 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -39,9 +39,11 @@ enum TextLiteral { static let createReflectionViewControllerDateLabel = "회고 일시" static let createReflectionViewControllerButtonText = "추가하기" static let createReflectionAlertTitle = "회고 일정 설정 오류" - static let createReflectionAlertContent = "회고 일정은 현 시간보다 이전으로 설정할 수 없습니다." + static let createReflectionAlertContent = "회고 일정은 현 시간보다 이전으로\n설정할 수 없습니다." static let editReflectionViewControllerTitle = "회고 정보를 수정해 주세요" static let editReflectionViewControllerButtonText = "수정하기" + static let deleteReflectionAlertTitle = "회고 일정을 삭제하시겠습니까?" + static let deleteReflectionAlertDetail = "이미 작성된 피드백은 삭제되지 않고\n다음 회고에서 확인할 수 있습니다." // MARK: - SetNicknameViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 5e950dfd..334896a2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -45,11 +45,6 @@ final class CreateReflectionViewController: BaseViewController { }() private lazy var deleteButton: DeleteButton = { let button = DeleteButton(type: .system) - let action = UIAction { [weak self] _ in - // FIXME: Delete Reflection API 연결 - print("삭제") - } - button.addAction(action, for: .touchUpInside) return button }() private lazy var titleLabel: UILabel = { @@ -125,8 +120,10 @@ final class CreateReflectionViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() setupAddReflection() - setupDeleteReflection() setupNotificationCenter() + if isEditReflection { + setupDeleteReflection() + } } override func render() { @@ -212,7 +209,11 @@ final class CreateReflectionViewController: BaseViewController { let action = UIAction { [weak self] _ in guard let reflectionId = self?.reflectionId else { return } - let alert = UIAlertController(title: "회고 일정 삭제하게", message: "회고 일정을 정말 삭제하시겠습니까?", preferredStyle: .alert) + let alert = UIAlertController( + title: TextLiteral.deleteReflectionAlertTitle, + message: TextLiteral.deleteReflectionAlertDetail, + preferredStyle: .alert + ) let cancelAction = UIAlertAction(title: "취소", style: .cancel) let deleteAction = UIAlertAction(title: "삭제", style: .destructive) { [weak self] _ in self?.deleteReflectionDetail(type: .deleteReflectionDetail(reflectionId: reflectionId)) From 219d0bdaed1d1ab39f77ed542662dfffe434f176 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 5 Mar 2023 17:14:06 +0900 Subject: [PATCH 172/388] [CHORE] detail edited (#295) --- .../Global/Literal/TextLiteral.swift | 2 +- .../CreateReflectionViewController.swift | 25 ++++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 37ad23ec..1d1ed278 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -39,7 +39,7 @@ enum TextLiteral { static let createReflectionViewControllerDateLabel = "회고 일시" static let createReflectionViewControllerButtonText = "추가하기" static let createReflectionAlertTitle = "회고 일정 설정 오류" - static let createReflectionAlertContent = "회고 일정은 현 시간보다 이전으로\n설정할 수 없습니다." + static let createReflectionAlertContent = "회고 일정은 현 시간 이후로 설정해주세요." static let editReflectionViewControllerTitle = "회고 정보를 수정해 주세요" static let editReflectionViewControllerButtonText = "수정하기" static let deleteReflectionAlertTitle = "회고 일정을 삭제하시겠습니까?" diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 334896a2..6ba8f6c9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -96,7 +96,9 @@ final class CreateReflectionViewController: BaseViewController { let hideKeyboardAction = UIAction { [weak self] _ in self?.view.endEditing(true) } - if isEditReflection, let date = reflectionDate { + if !isEditReflection { + picker.date = Date(timeIntervalSinceNow: 1 * 60) + } else if isEditReflection, let date = reflectionDate { picker.date = date } picker.datePickerMode = .time @@ -111,6 +113,7 @@ final class CreateReflectionViewController: BaseViewController { }() private lazy var mainButton: MainButton = { let button = MainButton() + button.isDisabled = isEditReflection ? false : true button.title = isEditReflection ? TextLiteral.editReflectionViewControllerButtonText : TextLiteral.createReflectionViewControllerButtonText return button }() @@ -121,6 +124,7 @@ final class CreateReflectionViewController: BaseViewController { super.viewDidLoad() setupAddReflection() setupNotificationCenter() + setupTextfieldObserver() if isEditReflection { setupDeleteReflection() } @@ -184,6 +188,10 @@ final class CreateReflectionViewController: BaseViewController { NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil) } + private func setupTextfieldObserver() { + reflectionNameView.nameTextField.addTarget(self, action: #selector(texfieldHasContent), for: .editingChanged) + } + private func setupAddReflection() { let action = UIAction { [weak self] _ in guard let reflectionDate = self?.combineDateAndTime(), @@ -270,6 +278,15 @@ final class CreateReflectionViewController: BaseViewController { }) } + @objc private func texfieldHasContent() { + if reflectionNameView.nameTextField.hasText { + + mainButton.isDisabled = false + } else { + mainButton.isDisabled = true + } + } + // MARK: - api private func patchReflectionDetail(type: CreateReflectionEndPoint) { @@ -291,9 +308,9 @@ final class CreateReflectionViewController: BaseViewController { parameters: type.body, encoder: JSONParameterEncoder.default, headers: type.header - ).responseDecodable(of: BaseModel.self) { [weak self] json in - if let result = json.value { - dump(result) + ).responseDecodable(of: BaseModel.self) { json in + if let data = json.value { + dump(data) } } } From 0f58300f6fe197e536b23a723234799b2a749fa3 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 5 Mar 2023 18:00:17 +0900 Subject: [PATCH 173/388] [CHORE] add default profile image (#316) --- .../MyFeedbackMemberCollectionViewCell.swift | 28 +++++++++++++------ .../MyFeedback/MyFeedbackViewController.swift | 4 +-- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index ca16d18c..d65a0448 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -30,6 +30,10 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { view.makeShadow(color: .black, opacity: 0.25, offset: CGSize.zero, radius: 1) return view }() + let profileImageView: UIImageView = { + let view = UIImageView(image: ImageLiterals.imgProfileNone) + return view + }() private let memberNameLabel: UILabel = { let label = UILabel() label.font = .body2 @@ -48,12 +52,18 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { override func render() { self.addSubview(shadowView) shadowView.snp.makeConstraints { + $0.centerX.top.equalToSuperview() + $0.width.height.equalTo(60) + } + + shadowView.addSubview(profileImageView) + profileImageView.snp.makeConstraints { $0.edges.equalToSuperview() } self.addSubview(memberNameLabel) memberNameLabel.snp.makeConstraints { - $0.center.equalToSuperview() + $0.top.equalTo(shadowView.snp.bottom).offset(8) $0.leading.trailing.equalToSuperview().inset(4) } } @@ -61,18 +71,18 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { // MARK: - func private func setSelectedCellLayer() { - self.layer.cornerRadius = 30 - self.layer.borderColor = UIColor.blue200.cgColor - self.layer.borderWidth = 2 - self.layer.shadowOpacity = 0 + shadowView.layer.cornerRadius = 30 + shadowView.layer.borderColor = UIColor.blue200.cgColor + shadowView.layer.borderWidth = 2 + shadowView.layer.shadowOpacity = 0 memberNameLabel.textColor = .blue200 } private func setShadowLayer() { - self.layer.cornerRadius = 30 - self.layer.borderWidth = 0 - self.layer.borderColor = UIColor.clear.cgColor - self.makeShadow(color: .black, opacity: 0.25, offset: CGSize.zero, radius: 1) + shadowView.layer.cornerRadius = 30 + shadowView.layer.borderWidth = 0 + shadowView.layer.borderColor = UIColor.clear.cgColor + shadowView.makeShadow(color: .black, opacity: 0.25, offset: CGSize.zero, radius: 1) memberNameLabel.textColor = .gray400 } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift index 96880510..4be52291 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift @@ -45,7 +45,7 @@ final class MyFeedbackViewController: BaseViewController { left: Size.horizontalPadding, bottom: Size.verticalPadding, right: Size.horizontalPadding) - flowLayout.itemSize = CGSize(width: Size.cellSize, height: Size.cellSize) + flowLayout.itemSize = CGSize(width: Size.cellSize, height: Size.cellSize + 20) flowLayout.minimumLineSpacing = Size.minimumLineSpacing return flowLayout }() @@ -110,7 +110,7 @@ final class MyFeedbackViewController: BaseViewController { memberCollectionView.snp.makeConstraints { $0.top.equalTo(myFeedbackLabel.snp.bottom).offset(7) $0.leading.trailing.equalToSuperview() - $0.height.equalTo(100) + $0.height.equalTo(120) } view.addSubview(dividerView) From 343a316d35703303392832a881d788812c82ee7d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 18:09:06 +0900 Subject: [PATCH 174/388] =?UTF-8?q?[ADD]=20Endpoint=20&=20Response=20?= =?UTF-8?q?=EC=88=98=EC=A0=95(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/InProgressEndPoint.swift | 2 +- .../Network/Response/MemberResponse.swift | 12 ++++++++---- .../SelectReflectionMemberViewController.swift | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift index 0daa5d3f..1f10f0cd 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift @@ -17,7 +17,7 @@ enum InProgressEndPoint: EndPointable { var address: String { switch self { case .fetchTeamMembers: - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/members" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members" case .fetchTeamAndUserFeedback(let reflectionId, let memberId): return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/from-team?members=\(memberId)" case .patchEndReflection(let reflectionId): diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift index efe84201..d161f64e 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift @@ -9,11 +9,15 @@ import Foundation struct MemberResponse: Decodable { // MARK: - userLogin - let userId: Int? - let userName: String? + let id: Int? + let nickname: String? + let role: String? + let profileImagePath: String? enum CodingKeys: String, CodingKey { - case userId = "id" - case userName = "username" + case id + case nickname + case role + case profileImagePath = "profile_image_path" } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index 5a4d2008..c2bbf1b4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -137,6 +137,7 @@ final class SelectReflectionMemberViewController: BaseViewController { headers: type.headers ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { + dump(json) guard let fetchedMemberList = json.detail?.members else { return } DispatchQueue.main.async { self.memberCollectionView.memberList = fetchedMemberList From b44a757059538866862ef87e1f1ca17016cf9938 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 18:20:20 +0900 Subject: [PATCH 175/388] =?UTF-8?q?[ADD]=20v2=20ver=20api=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=ED=95=98=EB=8A=94=20=EC=A4=91(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/Response/CurrentMemberResponse.swift | 7 +++++++ .../Network/Response/MemberResponse.swift | 13 +++++++++++++ .../ReflectionMemberCollectionView.swift | 6 ++++++ .../SelectReflectionMemberViewController.swift | 4 ++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift index 76e60ce0..9e85c442 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift @@ -11,3 +11,10 @@ struct TeamMembersResponse: Decodable { // MARK: - getTeamMembers let members: [MemberResponse]? } + +// MARK: - TeamMembersResponse v2, conflict 방지용 + +struct MembersResponse: Decodable { + // MARK: - getTeamMembers + let members: [TeamMemberResponse]? +} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift index d161f64e..c8b9ea8d 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift @@ -8,6 +8,19 @@ import Foundation struct MemberResponse: Decodable { + // MARK: - userLogin + let userId: Int? + let userName: String? + + enum CodingKeys: String, CodingKey { + case userId = "id" + case userName = "username" + } +} + +// MARK: - MemberResponse v2 / conflict 방지용 + +struct TeamMemberResponse: Decodable { // MARK: - userLogin let id: Int? let nickname: String? diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 82e00a9b..b4117667 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -30,6 +30,12 @@ final class ReflectionMemberCollectionView: UIView { collectionView.reloadData() } } + // FIXME: - memberList v2, 전체적으로 다 이걸로 변경 + var teamMemberList: [TeamMemberResponse] = [] { + didSet { + collectionView.reloadData() + } + } var didTappedMember: ((MemberResponse, [Int]) -> ())? var selectedMemberList: [Int] = UserDefaultStorage.seenMemberIdList { willSet { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index c2bbf1b4..6bce5237 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -135,12 +135,12 @@ final class SelectReflectionMemberViewController: BaseViewController { AF.request(type.address, method: type.method, headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) guard let fetchedMemberList = json.detail?.members else { return } DispatchQueue.main.async { - self.memberCollectionView.memberList = fetchedMemberList + self.memberCollectionView.teamMemberList = fetchedMemberList self.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\(self.memberCollectionView.selectedMemberList.count)/\(self.memberCollectionView.memberList.count))" } } From 3933ffc4ef40c7b0d359bba64f922cb1e1f60b9e Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 18:30:07 +0900 Subject: [PATCH 176/388] =?UTF-8?q?[ADD]=20api=20=EC=97=B0=EA=B2=B0=20?= =?UTF-8?q?=EC=99=84=EB=A3=8C(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionView.swift | 18 ++++++------------ .../SelectReflectionMemberViewController.swift | 6 +++--- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index b4117667..09504476 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -25,18 +25,12 @@ final class ReflectionMemberCollectionView: UIView { right: collectionHorizontalSpacing) } - var memberList: [MemberResponse] = [] { + var memberList: [TeamMemberResponse] = [] { didSet { collectionView.reloadData() } } - // FIXME: - memberList v2, 전체적으로 다 이걸로 변경 - var teamMemberList: [TeamMemberResponse] = [] { - didSet { - collectionView.reloadData() - } - } - var didTappedMember: ((MemberResponse, [Int]) -> ())? + var didTappedMember: ((TeamMemberResponse, [Int]) -> ())? var selectedMemberList: [Int] = UserDefaultStorage.seenMemberIdList { willSet { UserDefaultHandler.appendSeenMemberIdList(memberIdList: newValue) @@ -87,8 +81,8 @@ final class ReflectionMemberCollectionView: UIView { extension ReflectionMemberCollectionView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let selectedMember = memberList[indexPath.item] - if !selectedMemberList.contains(where: { $0 == selectedMember.userId }) { - selectedMemberList.append(selectedMember.userId ?? 0) + if !selectedMemberList.contains(where: { $0 == selectedMember.id }) { + selectedMemberList.append(selectedMember.id ?? 0) } didTappedMember?(selectedMember, selectedMemberList) } @@ -105,10 +99,10 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { return UICollectionViewCell() } - cell.nicknameLabel.text = memberList[indexPath.item].userName + cell.nicknameLabel.text = memberList[indexPath.item].nickname // FIXME: - profile image, role 추가 - if let userId = memberList[indexPath.item].userId { + if let userId = memberList[indexPath.item].id { if selectedMemberList.contains(userId) { cell.applyAttribute() } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index 6bce5237..cf6c1b8b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -112,8 +112,8 @@ final class SelectReflectionMemberViewController: BaseViewController { private func didTappedMember() { memberCollectionView.didTappedMember = { [weak self] member, members in - guard let id = member.userId, - let username = member.userName, + guard let id = member.id, + let username = member.nickname, let reflectionId = self?.reflectionId else { return } let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) self?.navigationController?.pushViewController(viewController, animated: true) @@ -140,7 +140,7 @@ final class SelectReflectionMemberViewController: BaseViewController { dump(json) guard let fetchedMemberList = json.detail?.members else { return } DispatchQueue.main.async { - self.memberCollectionView.teamMemberList = fetchedMemberList + self.memberCollectionView.memberList = fetchedMemberList self.feedbackDoneButton.title = TextLiteral.selectReflectionMemberViewControllerDoneButtonText + "(\(self.memberCollectionView.selectedMemberList.count)/\(self.memberCollectionView.memberList.count))" } } From b637e9fc24a1d5fe37366d7986e48322a1b1827b Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 18:36:05 +0900 Subject: [PATCH 177/388] =?UTF-8?q?[ADD]=20role=20=EC=B6=94=EA=B0=80(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMember/ReflectionMemberCollectionView.swift | 2 ++ .../ReflectionMember/ReflectionMemberCollectionViewCell.swift | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 09504476..3a25932e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -100,6 +100,8 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { } cell.nicknameLabel.text = memberList[indexPath.item].nickname + cell.roleLabel.text = memberList[indexPath.item].role + // FIXME: - profile image, role 추가 if let userId = memberList[indexPath.item].id { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index 9823788d..87045029 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -31,9 +31,8 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { label.font = .label2 return label }() - private let roleLabel: UILabel = { + let roleLabel: UILabel = { let label = UILabel() - label.text = "PM / 개발자 / 디자이너" label.textColor = .gray400 label.font = .caption2 return label From b943c1924a0f11ad6e5b6bcb618f07063209d30c Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 19:07:06 +0900 Subject: [PATCH 178/388] =?UTF-8?q?[ADD]=20image=20=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=EC=A4=91..(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++++ .../Extension/UIImageView+Extension.swift | 22 +++++++++++++++++++ .../ReflectionMemberCollectionView.swift | 16 ++++++++++++++ .../ReflectionMemberCollectionViewCell.swift | 2 +- 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 7aee4e15..188812d6 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -115,6 +115,7 @@ 525E722128FFC9A800EF3FCB /* BackButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525E722028FFC9A800EF3FCB /* BackButton.swift */; }; 525E722528FFCFA600EF3FCB /* FeedbackTypeButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525E722428FFCFA600EF3FCB /* FeedbackTypeButtonView.swift */; }; 52988B742921EAD50044A77F /* MyReflectionFeedbackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52988B732921EAD50044A77F /* MyReflectionFeedbackViewController.swift */; }; + 52A53DDC29B49A3100C4BB4C /* UIImageView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A53DDB29B49A3100C4BB4C /* UIImageView+Extension.swift */; }; 52AED2DD29128532004D70B9 /* FeedbackFromMeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AED2DC29128532004D70B9 /* FeedbackFromMeModel.swift */; }; 52CD58BC297BE24B008567E0 /* ProfileImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */; }; 52DC9091291A98CC00904739 /* MyFeedbackEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52DC9090291A98CC00904739 /* MyFeedbackEditViewController.swift */; }; @@ -256,6 +257,7 @@ 525E722028FFC9A800EF3FCB /* BackButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackButton.swift; sourceTree = ""; }; 525E722428FFCFA600EF3FCB /* FeedbackTypeButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackTypeButtonView.swift; sourceTree = ""; }; 52988B732921EAD50044A77F /* MyReflectionFeedbackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionFeedbackViewController.swift; sourceTree = ""; }; + 52A53DDB29B49A3100C4BB4C /* UIImageView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+Extension.swift"; sourceTree = ""; }; 52AED2DC29128532004D70B9 /* FeedbackFromMeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackFromMeModel.swift; sourceTree = ""; }; 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileImageButton.swift; sourceTree = ""; }; 52DC9090291A98CC00904739 /* MyFeedbackEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackEditViewController.swift; sourceTree = ""; }; @@ -438,6 +440,7 @@ 3EB508912917585600FB77CB /* UICollectionView + Extension.swift */, 7E7F160E2921CD4A00C6BE96 /* UITabBar+Extension.swift */, 3EA341E72925E5EA005CBD1C /* String+Extension.swift */, + 52A53DDB29B49A3100C4BB4C /* UIImageView+Extension.swift */, ); path = Extension; sourceTree = ""; @@ -1215,6 +1218,7 @@ 7E2ECA102901136700A4D65C /* SetNicknameViewController.swift in Sources */, 3984742629264ACE00EDC139 /* MyFeedBackEndPoint.swift in Sources */, 39F52C4D29232E5D00B19A77 /* AddReflectionDTO.swift in Sources */, + 52A53DDC29B49A3100C4BB4C /* UIImageView+Extension.swift in Sources */, 7E3907012943545A003E9743 /* FeedbackContent.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift new file mode 100644 index 00000000..7ce6dce7 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift @@ -0,0 +1,22 @@ +// +// UIImageView+Extension.swift +// Maddori.Apple +// +// Created by 김유나 on 2023/03/05. +// + +import UIKit + +extension UIImageView { + func load(url: URL) { + DispatchQueue.global().async { [weak self] in + if let data = try? Data(contentsOf: url) { + if let image = UIImage(data: data) { + DispatchQueue.main.async { + self?.image = image + } + } + } + } + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 3a25932e..050f4454 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -99,6 +99,22 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { return UICollectionViewCell() } + if let profileImageURL = memberList[indexPath.item].profileImagePath { + // if let profileImageData = try? Data(contentsOf: URL(string: UrlLiteral.baseUrl2 + profileImageURL)!) { + // DispatchQueue.main.async { + // cell.profileImage.image = UIImage(data: profileImageData) + // } + // } + URLSession.shared.dataTask(with: NSURL(string: UrlLiteral.baseUrl2 + profileImageURL)! as URL, completionHandler: { (data, response, error) -> Void in + if error != nil { + return + } + DispatchQueue.main.async { + cell.profileImage.image = UIImage(data: data!) + } + }).resume() + } + cell.nicknameLabel.text = memberList[indexPath.item].nickname cell.roleLabel.text = memberList[indexPath.item].role diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index 87045029..c5fdb707 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -19,7 +19,7 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { // MARK: - property - private let profileImage: UIImageView = { + let profileImage: UIImageView = { let imageView = UIImageView() imageView.image = ImageLiterals.imgProfileNone imageView.layer.cornerRadius = 23 From 1f32c965ebd5de0e5de4c345d67211aff8cac478 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 5 Mar 2023 19:40:06 +0900 Subject: [PATCH 179/388] =?UTF-8?q?[ADD]=20image=20load=20=EC=84=B1?= =?UTF-8?q?=EA=B3=B5=E3=85=8E(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ---- .../Extension/UIImageView+Extension.swift | 22 ------------------- .../Global/Literal/UrlLiteral.swift | 1 + .../ReflectionMemberCollectionView.swift | 20 +++++++---------- ...SelectReflectionMemberViewController.swift | 1 - 5 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 188812d6..7aee4e15 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -115,7 +115,6 @@ 525E722128FFC9A800EF3FCB /* BackButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525E722028FFC9A800EF3FCB /* BackButton.swift */; }; 525E722528FFCFA600EF3FCB /* FeedbackTypeButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525E722428FFCFA600EF3FCB /* FeedbackTypeButtonView.swift */; }; 52988B742921EAD50044A77F /* MyReflectionFeedbackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52988B732921EAD50044A77F /* MyReflectionFeedbackViewController.swift */; }; - 52A53DDC29B49A3100C4BB4C /* UIImageView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A53DDB29B49A3100C4BB4C /* UIImageView+Extension.swift */; }; 52AED2DD29128532004D70B9 /* FeedbackFromMeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AED2DC29128532004D70B9 /* FeedbackFromMeModel.swift */; }; 52CD58BC297BE24B008567E0 /* ProfileImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */; }; 52DC9091291A98CC00904739 /* MyFeedbackEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52DC9090291A98CC00904739 /* MyFeedbackEditViewController.swift */; }; @@ -257,7 +256,6 @@ 525E722028FFC9A800EF3FCB /* BackButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackButton.swift; sourceTree = ""; }; 525E722428FFCFA600EF3FCB /* FeedbackTypeButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackTypeButtonView.swift; sourceTree = ""; }; 52988B732921EAD50044A77F /* MyReflectionFeedbackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionFeedbackViewController.swift; sourceTree = ""; }; - 52A53DDB29B49A3100C4BB4C /* UIImageView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+Extension.swift"; sourceTree = ""; }; 52AED2DC29128532004D70B9 /* FeedbackFromMeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackFromMeModel.swift; sourceTree = ""; }; 52CD58BB297BE24B008567E0 /* ProfileImageButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileImageButton.swift; sourceTree = ""; }; 52DC9090291A98CC00904739 /* MyFeedbackEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackEditViewController.swift; sourceTree = ""; }; @@ -440,7 +438,6 @@ 3EB508912917585600FB77CB /* UICollectionView + Extension.swift */, 7E7F160E2921CD4A00C6BE96 /* UITabBar+Extension.swift */, 3EA341E72925E5EA005CBD1C /* String+Extension.swift */, - 52A53DDB29B49A3100C4BB4C /* UIImageView+Extension.swift */, ); path = Extension; sourceTree = ""; @@ -1218,7 +1215,6 @@ 7E2ECA102901136700A4D65C /* SetNicknameViewController.swift in Sources */, 3984742629264ACE00EDC139 /* MyFeedBackEndPoint.swift in Sources */, 39F52C4D29232E5D00B19A77 /* AddReflectionDTO.swift in Sources */, - 52A53DDC29B49A3100C4BB4C /* UIImageView+Extension.swift in Sources */, 7E3907012943545A003E9743 /* FeedbackContent.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift deleted file mode 100644 index 7ce6dce7..00000000 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// UIImageView+Extension.swift -// Maddori.Apple -// -// Created by 김유나 on 2023/03/05. -// - -import UIKit - -extension UIImageView { - func load(url: URL) { - DispatchQueue.global().async { [weak self] in - if let data = try? Data(contentsOf: url) { - if let image = UIImage(data: data) { - DispatchQueue.main.async { - self?.image = image - } - } - } - } - } -} diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift index e6d933ec..b3f5048f 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift @@ -10,4 +10,5 @@ import Foundation enum UrlLiteral { static let baseUrl = "http://15.165.21.115:3001/api/v1" static let baseUrl2 = "http://15.165.21.115:3001/api/v2" + static let imageBaseURL = "http://15.165.21.115:3001" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 050f4454..e9273603 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -100,26 +100,22 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { } if let profileImageURL = memberList[indexPath.item].profileImagePath { - // if let profileImageData = try? Data(contentsOf: URL(string: UrlLiteral.baseUrl2 + profileImageURL)!) { - // DispatchQueue.main.async { - // cell.profileImage.image = UIImage(data: profileImageData) - // } - // } - URLSession.shared.dataTask(with: NSURL(string: UrlLiteral.baseUrl2 + profileImageURL)! as URL, completionHandler: { (data, response, error) -> Void in + URLSession.shared.dataTask(with: NSURL(string: UrlLiteral.imageBaseURL + profileImageURL)! as URL, completionHandler: { (data, response, error) -> Void in if error != nil { return - } - DispatchQueue.main.async { - cell.profileImage.image = UIImage(data: data!) + } else { + DispatchQueue.main.async { + cell.profileImage.image = UIImage(data: data!) + cell.profileImage.clipsToBounds = true + cell.profileImage.layer.cornerRadius = 23 + } } }).resume() } cell.nicknameLabel.text = memberList[indexPath.item].nickname cell.roleLabel.text = memberList[indexPath.item].role - - // FIXME: - profile image, role 추가 - + if let userId = memberList[indexPath.item].id { if selectedMemberList.contains(userId) { cell.applyAttribute() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index cf6c1b8b..141dae1c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -129,7 +129,6 @@ final class SelectReflectionMemberViewController: BaseViewController { } // MARK: - api - // FIXME: - fetchTeamMembers, patchEndReflection v2 api 로 변경하기 private func fetchTeamMembers(type: InProgressEndPoint) { AF.request(type.address, From 62f72ccec63caf9c216c90485e03ead0c75a7aec Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 6 Mar 2023 17:42:02 +0900 Subject: [PATCH 180/388] =?UTF-8?q?[ADD]=20=ED=9A=8C=EA=B3=A0=20=EC=A2=85?= =?UTF-8?q?=EB=A3=8C=20api=20=EC=97=B0=EA=B2=B0(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/InProgressEndPoint.swift | 2 +- .../SelectReflectionMemberViewController.swift | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift index 1f10f0cd..30c0ac52 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift @@ -21,7 +21,7 @@ enum InProgressEndPoint: EndPointable { case .fetchTeamAndUserFeedback(let reflectionId, let memberId): return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/from-team?members=\(memberId)" case .patchEndReflection(let reflectionId): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/end" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/end" } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index 141dae1c..fa135b21 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -36,12 +36,7 @@ final class SelectReflectionMemberViewController: BaseViewController { let button = MainButton() let action = UIAction { [weak self] _ in guard let reflectionId = self?.reflectionId else { return } - guard let isAdmin = self?.isAdmin else { return } - if isAdmin { - self?.patchEndReflection(type: .patchEndReflection(reflectionId: reflectionId)) - } else { - self?.dismiss(animated: true) - } + self?.patchEndReflection(type: .patchEndReflection(reflectionId: reflectionId)) UserDefaultHandler.setHasSeenAlert(to: false) } button.addAction(action, for: .touchUpInside) @@ -151,7 +146,8 @@ final class SelectReflectionMemberViewController: BaseViewController { method: type.method, headers: type.headers ).responseDecodable(of: BaseModel.self) { [weak self] json in - if let _ = json.value { + if let json = json.value { + dump(json) self?.dismiss(animated: true) } } From 9a89a8384fccdac1ea478390f64050eba306e31f Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 7 Mar 2023 13:42:13 +0900 Subject: [PATCH 181/388] [CHORE] user profile image api connected (#316) --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++++ .../Extension/UIImageView+Extension.swift | 22 +++++++++++++++++++ .../Global/Literal/UrlLiteral.swift | 2 ++ .../MemberCollectionView.swift | 12 +++++----- .../EndPoint/AddFeedBackEndPoint.swift | 4 ++-- .../Network/EndPoint/InProgressEndPoint.swift | 6 ++--- .../Network/EndPoint/MyFeedBackEndPoint.swift | 4 ++-- .../Response/CurrentMemberResponse.swift | 17 +++++++++++++- .../UIComponent/SelectMemberView.swift | 2 +- .../MyFeedbackMemberCollectionViewCell.swift | 19 +++++++++++++--- .../MyFeedback/MyFeedbackViewController.swift | 5 +++-- 11 files changed, 77 insertions(+), 20 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 93854eb6..927f6682 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -86,6 +86,7 @@ 39F909D7292679C400DAD0A3 /* EditFeedBackDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F909D6292679C400DAD0A3 /* EditFeedBackDTO.swift */; }; 3E5195A42928C8FB00710A01 /* CreateReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */; }; 3E5195AB292B05BC00710A01 /* JoinReflectionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */; }; + 3E5368C829B60B70000CBD48 /* UIImageView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5368C729B60B70000CBD48 /* UIImageView+Extension.swift */; }; 3E557FC328FE7BBC00714E46 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */; }; 3E557FC528FE854600714E46 /* KeywordLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FC428FE854600714E46 /* KeywordLabel.swift */; }; 3E557FF82901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FF72901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift */; }; @@ -225,6 +226,7 @@ 39F909D6292679C400DAD0A3 /* EditFeedBackDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditFeedBackDTO.swift; sourceTree = ""; }; 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateReflectionEndPoint.swift; sourceTree = ""; }; 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinReflectionButton.swift; sourceTree = ""; }; + 3E5368C729B60B70000CBD48 /* UIImageView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+Extension.swift"; sourceTree = ""; }; 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 3E557FC428FE854600714E46 /* KeywordLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordLabel.swift; sourceTree = ""; }; 3E557FF72901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordCollectionViewFlowLayout.swift; sourceTree = ""; }; @@ -434,6 +436,7 @@ 3EB508912917585600FB77CB /* UICollectionView + Extension.swift */, 7E7F160E2921CD4A00C6BE96 /* UITabBar+Extension.swift */, 3EA341E72925E5EA005CBD1C /* String+Extension.swift */, + 3E5368C729B60B70000CBD48 /* UIImageView+Extension.swift */, ); path = Extension; sourceTree = ""; @@ -1087,6 +1090,7 @@ 52CD58BC297BE24B008567E0 /* ProfileImageButton.swift in Sources */, 3EB5085C2912427600FB77CB /* MyReflectionViewController.swift in Sources */, 39257DEB28F9373900201E0B /* BaseViewController.swift in Sources */, + 3E5368C829B60B70000CBD48 /* UIImageView+Extension.swift in Sources */, 39436C1029127BBA0083D77A /* MyFeedbackCollectionView.swift in Sources */, 7E7F160F2921CD4A00C6BE96 /* UITabBar+Extension.swift in Sources */, 525E722128FFC9A800EF3FCB /* BackButton.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift new file mode 100644 index 00000000..0e43eaea --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift @@ -0,0 +1,22 @@ +// +// UIImageView+Extension.swift +// Maddori.Apple +// +// Created by 이성민 on 2023/03/06. +// + +import UIKit + +extension UIImageView { + func load(from url: URL) { + DispatchQueue.global().async { [weak self] in + if let data = try? Data(contentsOf: url) { + if let image = UIImage(data: data) { + DispatchQueue.main.async { + self?.image = image + } + } + } + } + } +} diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift index e6d933ec..49d7bfe6 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/UrlLiteral.swift @@ -10,4 +10,6 @@ import Foundation enum UrlLiteral { static let baseUrl = "http://15.165.21.115:3001/api/v1" static let baseUrl2 = "http://15.165.21.115:3001/api/v2" + + static let iamgeBaseUrl = "http://15.165.21.115:3001" } diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift index 4709c146..17d5dc4f 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift @@ -107,15 +107,15 @@ final class MemberCollectionView: UIView { var type: CollectionType var currentToUserId = 0 - var memberList: [MemberResponse] = [] { + var memberList: [MemberDetailResponse] = [] { didSet { collectionView.reloadData() } } - var didTappedMember: (([MemberResponse]) -> ())? - var didTappedFeedBackMember: ((MemberResponse) -> ())? - var selectedMember: MemberResponse? - private var selectedMemberList: [MemberResponse] = [] + var didTappedMember: (([MemberDetailResponse]) -> ())? + var didTappedFeedBackMember: ((MemberDetailResponse) -> ())? + var selectedMember: MemberDetailResponse? + private var selectedMemberList: [MemberDetailResponse] = [] var selectedMemberIdList: [Int] = UserDefaultStorage.seenMemberIdList { willSet { UserDefaultHandler.appendSeenMemberIdList(memberIdList: newValue) @@ -171,7 +171,7 @@ extension MemberCollectionView: UICollectionViewDelegate { didTappedFeedBackMember?(member) case .progressReflection: - let selectedItem: MemberResponse = memberList[indexPath.item] + let selectedItem: MemberDetailResponse = memberList[indexPath.item] if !selectedMemberList.contains(where: { $0.userName == selectedItem.userName } ) { selectedMemberList.append(selectedItem) } diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/AddFeedBackEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/AddFeedBackEndPoint.swift index 4da7359d..33671d77 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/AddFeedBackEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/AddFeedBackEndPoint.swift @@ -16,9 +16,9 @@ enum AddFeedBackEndPoint { var address: String { switch self { case .fetchCurrentTeamMember: - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/members" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members" case .dispatchAddFeedBack(let reflectionId, _): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks" } } diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift index 0daa5d3f..5bf99f7c 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/InProgressEndPoint.swift @@ -17,11 +17,11 @@ enum InProgressEndPoint: EndPointable { var address: String { switch self { case .fetchTeamMembers: - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/members" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members" case .fetchTeamAndUserFeedback(let reflectionId, let memberId): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/from-team?members=\(memberId)" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/from-team?members=\(memberId)" case .patchEndReflection(let reflectionId): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/end" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/end" } } diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift index 510c57b4..91d0a000 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift @@ -16,9 +16,9 @@ enum MyFeedBackEndPoint { var address: String { switch self { case .fetchCurrentTeamMember: - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/members" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members" case .fetchCertainMemberFeedBack(let memberId): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/current/feedbacks/from-me?members=\(memberId)" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/current/feedbacks/from-me?members=\(memberId)" case .deleteFeedBack(let reflectionId, let feedBackId): return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)" case .putEditFeedBack(let reflectionId, let feedBackId, _): diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift index 76e60ce0..5dd97e21 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift @@ -7,7 +7,22 @@ import Foundation +struct MemberDetailResponse: Decodable { + let userId: Int? + let userName: String? + let role: String? + let profileImagePath: String? + + enum CodingKeys: String, CodingKey { + case userId = "id" + case userName = "nickname" + case role = "role" + case profileImagePath = "profile_image_path" + } +} + + struct TeamMembersResponse: Decodable { // MARK: - getTeamMembers - let members: [MemberResponse]? + let members: [MemberDetailResponse]? } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift index aedef5b0..42bdb0c4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift @@ -12,7 +12,7 @@ import SnapKit final class SelectMemberView: UIStackView { - var didSelectedMemeber: ((MemberResponse) -> ())? + var didSelectedMemeber: ((MemberDetailResponse) -> ())? var isSelectedMember: ((Bool) -> ())? var isOpened: Bool = false { diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index d65a0448..30fbacfc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -30,9 +30,11 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { view.makeShadow(color: .black, opacity: 0.25, offset: CGSize.zero, radius: 1) return view }() - let profileImageView: UIImageView = { - let view = UIImageView(image: ImageLiterals.imgProfileNone) - return view + private let profileImageView: UIImageView = { + let imageView = UIImageView() + imageView.layer.cornerRadius = 30 + imageView.clipsToBounds = true + return imageView }() private let memberNameLabel: UILabel = { let label = UILabel() @@ -89,4 +91,15 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { func setMemberName(name: String) { memberNameLabel.text = name } + + func setMemberProfileImage(from path: String?) { + if let path = path { + if let fullImagePath = URL(string: UrlLiteral.iamgeBaseUrl + path) { + profileImageView.load(from: fullImagePath) + + } + } else { + profileImageView.image = ImageLiterals.imgProfileNone + } + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift index 4be52291..7f74b25f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift @@ -12,7 +12,7 @@ import SnapKit final class MyFeedbackViewController: BaseViewController { var selectedIndex: Int = 0 - private var memberList: [MemberResponse] = [] { + private var memberList: [MemberDetailResponse] = [] { didSet { if memberList.isEmpty { setLayoutEmptyView() @@ -143,7 +143,7 @@ final class MyFeedbackViewController: BaseViewController { headers: type.headers ).responseDecodable(of: BaseModel.self) { [weak self] json in if let data = json.value { - var memberArray: [MemberResponse] = [] + var memberArray: [MemberDetailResponse] = [] guard let members = json.value?.detail?.members else { return } members.forEach { if $0.userName != UserDefaultStorage.nickname { @@ -190,6 +190,7 @@ extension MyFeedbackViewController: UICollectionViewDataSource { return UICollectionViewCell() } cell.setMemberName(name: memberList[indexPath.item].userName ?? "") + cell.setMemberProfileImage(from: memberList[indexPath.item].profileImagePath) if indexPath.item == selectedIndex { cell.isSelected = true collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .init()) From 0c9fdace92e54d52bdc82d3cd14cea71a0e3dca5 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 7 Mar 2023 14:13:36 +0900 Subject: [PATCH 182/388] =?UTF-8?q?[CHORE]=20=EC=9E=90=EC=9E=98=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95=20(#316)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 30fbacfc..9e0f7c07 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -96,7 +96,6 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { if let path = path { if let fullImagePath = URL(string: UrlLiteral.iamgeBaseUrl + path) { profileImageView.load(from: fullImagePath) - } } else { profileImageView.image = ImageLiterals.imgProfileNone From f723b65f5616a8f33ce05f6cd224d2d7c8632bb9 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 13 Mar 2023 13:46:22 +0900 Subject: [PATCH 183/388] =?UTF-8?q?[CHORE]=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=95=A1=EC=85=98=20=ED=95=A8=EC=88=98=ED=99=94=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index e5019558..10c252fb 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -82,18 +82,38 @@ final class TeamManageViewController: BaseViewController { private func configureSettingModels() { sections.append(Section(options: [Option(title: "새로운 팀 합류하기", handler: { - print("새로운 팀 합류하기") + self.joinNewTeam() }), Option(title: "팀 생성하기", handler: { - print("팀 생성하기") + self.createTeam() })])) sections.append(Section(options: [Option(title: "로그아웃", handler: { - print("로그아웃") + self.logout() }), Option(title: "회원탈퇴", handler: { - print("회원탈퇴") + self.withdrawal() })])) } + + private func joinNewTeam() { + // FIXME: api 연결 + print("새로운 팀 합류하기") + } + + private func createTeam() { + // FIXME: api 연결 + print("팀 생성하기") + } + + private func logout() { + // FIXME: api 연결 + print("로그아웃") + } + + private func withdrawal() { + // FIXME: api 연결 + print("회원탈퇴") + } } extension TeamManageViewController: UITableViewDataSource { From 2a45ce3a27e121011d6044a994454f205aacc9f8 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 13 Mar 2023 14:09:42 +0900 Subject: [PATCH 184/388] =?UTF-8?q?[CHORE]=20TextLiteral=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Literal/TextLiteral.swift | 8 ++++++++ .../Screen/Home/Home/TeamManageViewController.swift | 8 ++++---- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index d46bea47..39d00ac7 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -238,4 +238,12 @@ enum TextLiteral { // MARK: - TeamManageViewController static let teamManageViewControllerEmptyLabel: String = "아직 팀에 합류한 팀원이 없습니다\n초대코드를 공유하여 팀원을 초대해주세요" + static let teamManageViewControllerJoinNewTeam: String = "새로운 팀 합류하기" + static let teamManageViewControllerCreateTeam: String = "팀 생성하기" + static let teamManageViewControllerLoggout: String = "로그아웃" + static let teamManageViewControllerWithdrawl: String = "회원탈퇴" + + // MARK: - ChangeTeamView + + static let changeTeamViewLabel: String = "참여 중인 팀" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 10c252fb..9e28a03e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -81,16 +81,16 @@ final class TeamManageViewController: BaseViewController { } private func configureSettingModels() { - sections.append(Section(options: [Option(title: "새로운 팀 합류하기", handler: { + sections.append(Section(options: [Option(title: TextLiteral.teamManageViewControllerJoinNewTeam, handler: { self.joinNewTeam() }), - Option(title: "팀 생성하기", handler: { + Option(title: TextLiteral.teamManageViewControllerCreateTeam, handler: { self.createTeam() })])) - sections.append(Section(options: [Option(title: "로그아웃", handler: { + sections.append(Section(options: [Option(title: TextLiteral.teamManageViewControllerLoggout, handler: { self.logout() }), - Option(title: "회원탈퇴", handler: { + Option(title: TextLiteral.teamManageViewControllerWithdrawl, handler: { self.withdrawal() })])) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 599aadc9..48460a33 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -19,7 +19,7 @@ final class ChangeTeamView: UIView { private let titleLabel: UILabel = { let label = UILabel() label.font = .label2 - label.text = "참여 중인 팀" + label.text = TextLiteral.changeTeamViewLabel label.textColor = .black100 return label }() From d5690264551e5a102502c824512bc8c5479c8a99 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Mon, 13 Mar 2023 14:28:50 +0900 Subject: [PATCH 185/388] [CHORE] build error fixed (#295) --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 42027a5e..f5892119 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -319,7 +319,7 @@ final class HomeViewController: BaseViewController { self.currentReflectionId = reflectionId self.reflectionTitle = reflectionTitle self.reflectionDate = reflectionDate - self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate) + self.joinReflectionButton.setupAttribute(reflectionStatus: reflectionStatus, title: reflectionTitle, date: reflectionDate, isPreview: false) self.setupJoinReflectionButtonAction(status: reflectionStatus) self.setupJoinReflectionButtonBackground(status: reflectionStatus) From 71f6c1ae47aa9b6d51c75e74f058f0ac8926a35f Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Mar 2023 16:10:11 +0900 Subject: [PATCH 186/388] =?UTF-8?q?[CHORE]=20person=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EB=B3=80=EA=B2=BD=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Person.imageset/Contents.json | 2 +- .../Assets.xcassets/Person.imageset/Person.pdf | Bin 0 -> 3974 bytes .../Assets.xcassets/Person.imageset/Person.svg | 3 --- 3 files changed, 1 insertion(+), 4 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Person.pdf delete mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Person.svg diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Contents.json b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Contents.json index 98ddda5a..97663565 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Contents.json +++ b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Person.svg", + "filename" : "Person.pdf", "idiom" : "universal" } ], diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Person.pdf b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Person.pdf new file mode 100644 index 0000000000000000000000000000000000000000..213497d90412e8b368e919e5c362db3b722139e8 GIT binary patch literal 3974 zcmeHKOK;pZ5We$Q@Dd<7gv;TZKwu#83q>2mwR;E<^srtlj#KZ-S;9mfL2t`nLD};9xR!aevtlo1V1W^@N=_ zU3H63qJR=#=Dew81jR(g1<;KB~7($6pj&92`z%e7b>HNW1hn)A~)^6+B*Yt@M_ zf_Cb~^vfcZcf5zqI*i-8l;mnHwDOi8fDeUkwGmc1@4Pp1vPW62g~eLHd5+!+ODY(v zwV$oEM!As4X_z;Zqp{LjrISu60t!AGf*S&0$TnCf;cZTlu+EJ!F%-2iHq0P4n`4fw zTGqjaPlm7#k`83NbSjgJL=ui9N;X6pl(E@F&#Fdgt6elQDj#gJSt7KQGifW6O4_C1 zrOC<}XM&YkWkl#LR83UbWgoO8Qbaj9k|rn$UfU=MhT%ch(!je2$uJg^OM}mbRE`1G zC0XS)_Cu6e1%i1oS;OV|-e7x< zIG$L$c!{=%I6LCt#S{(qJK{&8YuxB4>!L*rplQhvx4hFnfng<+z-$6jhMZ10uNbsF zD2T(#b2sl+I?iN7WNgtoIK*^kZ3_&0n-oDbXoE9c9Vf?Ai69YT$VrpoCJ(_zhwOu7 zUVDqU5H}?3w-OmV1JjTyB*;daGC0q@WKgAm=ESlzgS@iATO1=RQP-g|uma1~8VZPG z%Yj^VTa=o-LEpmZ;^06E3;($#r$8!sYRGe%;Z&HCQwdpTtL(ElwqO#57*+zkBp+fw}Va?cJy4Uz^^|j*o0GFb%sUl0Pzca4?1qW4rdn z6gbP&G$3Op8#DCp4V{HOMHuNHG|n}qe-#`CCHX)7ckNaW&>R^JNbb>Eh>G^me6;C9 zWVY?VGyaz9B~GjXnsJh$F$8w@` - - From 1255bd13600666be6c618639ebc6ad5f87ff0f65 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Mar 2023 16:30:55 +0900 Subject: [PATCH 187/388] =?UTF-8?q?[CHORE]=20person=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=9B=90=EB=9E=98=EB=8C=80=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Person.imageset/Contents.json | 2 +- .../Assets.xcassets/Person.imageset/Person.pdf | Bin 3974 -> 0 bytes .../Assets.xcassets/Person.imageset/Person.svg | 3 +++ 3 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Person.pdf create mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Person.svg diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Contents.json b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Contents.json index 97663565..98ddda5a 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Contents.json +++ b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Person.pdf", + "filename" : "Person.svg", "idiom" : "universal" } ], diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Person.pdf b/Maddori.Apple/Maddori.Apple/Global/Resource/Assets.xcassets/Person.imageset/Person.pdf deleted file mode 100644 index 213497d90412e8b368e919e5c362db3b722139e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3974 zcmeHKOK;pZ5We$Q@Dd<7gv;TZKwu#83q>2mwR;E<^srtlj#KZ-S;9mfL2t`nLD};9xR!aevtlo1V1W^@N=_ zU3H63qJR=#=Dew81jR(g1<;KB~7($6pj&92`z%e7b>HNW1hn)A~)^6+B*Yt@M_ zf_Cb~^vfcZcf5zqI*i-8l;mnHwDOi8fDeUkwGmc1@4Pp1vPW62g~eLHd5+!+ODY(v zwV$oEM!As4X_z;Zqp{LjrISu60t!AGf*S&0$TnCf;cZTlu+EJ!F%-2iHq0P4n`4fw zTGqjaPlm7#k`83NbSjgJL=ui9N;X6pl(E@F&#Fdgt6elQDj#gJSt7KQGifW6O4_C1 zrOC<}XM&YkWkl#LR83UbWgoO8Qbaj9k|rn$UfU=MhT%ch(!je2$uJg^OM}mbRE`1G zC0XS)_Cu6e1%i1oS;OV|-e7x< zIG$L$c!{=%I6LCt#S{(qJK{&8YuxB4>!L*rplQhvx4hFnfng<+z-$6jhMZ10uNbsF zD2T(#b2sl+I?iN7WNgtoIK*^kZ3_&0n-oDbXoE9c9Vf?Ai69YT$VrpoCJ(_zhwOu7 zUVDqU5H}?3w-OmV1JjTyB*;daGC0q@WKgAm=ESlzgS@iATO1=RQP-g|uma1~8VZPG z%Yj^VTa=o-LEpmZ;^06E3;($#r$8!sYRGe%;Z&HCQwdpTtL(ElwqO#57*+zkBp+fw}Va?cJy4Uz^^|j*o0GFb%sUl0Pzca4?1qW4rdn z6gbP&G$3Op8#DCp4V{HOMHuNHG|n}qe-#`CCHX)7ckNaW&>R^JNbb>Eh>G^me6;C9 zWVY?VGyaz9B~GjXnsJh$F$8w@` + + From ec298774e51b2d97fcb7e9328c0ab03eb4f0d530 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Mar 2023 16:54:50 +0900 Subject: [PATCH 188/388] =?UTF-8?q?[CHORE]=20full=20divider=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 3 ++- .../UIComponent/FullDividerView.swift | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 5c58696a..97644e52 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -129,6 +129,7 @@ final class TeamDetailViewController: BaseViewController { secondFullDividerView.snp.makeConstraints { $0.leading.trailing.equalToSuperview() $0.bottom.equalTo(teamLeaveButton.snp.top).offset(-20) + $0.height.equalTo(4) } view.addSubview(invitationCodeLabel) @@ -144,10 +145,10 @@ final class TeamDetailViewController: BaseViewController { } view.addSubview(firstFullDividerView) - firstFullDividerView.snp.makeConstraints { $0.leading.trailing.equalToSuperview() $0.bottom.equalTo(invitationCodeLabel.snp.top).offset(-20) + $0.height.equalTo(4) } view.addSubview(memberCollectionView) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift index 6288873c..ac86ea67 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift @@ -13,26 +13,27 @@ final class FullDividerView: UIView { // MARK: - property - let dividerView: UIView = { - let view = UIView() - view.backgroundColor = .gray300 - return view - }() +// let dividerView: UIView = { +// let view = UIView() +// view.backgroundColor = .gray300 +// return view +// }() // MARK: - life cycle override init(frame: CGRect) { super.init(frame: frame) - render() + self.backgroundColor = .gray300 +// render() } required init?(coder: NSCoder) { nil } - private func render() { - self.addSubview(dividerView) - dividerView.snp.makeConstraints { - $0.edges.equalToSuperview() - $0.height.equalTo(4) - } - } +// private func render() { +// self.addSubview(dividerView) +// dividerView.snp.makeConstraints { +// $0.edges.equalToSuperview() +// $0.height.equalTo(4) +// } +// } } From 0d9e19441c6d41cd8aa13b1a979f644432c439bb Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Mar 2023 16:55:34 +0900 Subject: [PATCH 189/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EB=82=98?= =?UTF-8?q?=EA=B0=80=EA=B8=B0=20alert=20=EB=AC=B8=EA=B5=AC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 1 + .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 9889422c..df2e93f2 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -18,6 +18,7 @@ enum TextLiteral { static let doneButtonNext = "다음" static let doneButtonComplete = "완료" static let actionSheetCancelTitle = "취소" + static let leaveTitle = "나가기" // MARK: - MainViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 97644e52..2b98141d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -194,6 +194,7 @@ final class TeamDetailViewController: BaseViewController { let action = UIAction { [weak self] _ in self?.makeRequestAlert(title: TextLiteral.teamDetailViewControllerLeaveTeamAlertTitle, message: TextLiteral.teamDetailViewControllerLeaveTeamAlertMessage, + okTitle: TextLiteral.leaveTitle, // FIXME: - 팀 나가기 API 연결 okAction: nil) } From ca3e8bd89c1ffdc4fa57864294793974369b075e Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Mar 2023 17:04:22 +0900 Subject: [PATCH 190/388] =?UTF-8?q?[CHORE]=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIComponent/FullDividerView.swift | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift index ac86ea67..4b2ecc84 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/FullDividerView.swift @@ -11,29 +11,12 @@ import SnapKit final class FullDividerView: UIView { - // MARK: - property - -// let dividerView: UIView = { -// let view = UIView() -// view.backgroundColor = .gray300 -// return view -// }() - // MARK: - life cycle override init(frame: CGRect) { super.init(frame: frame) self.backgroundColor = .gray300 -// render() } required init?(coder: NSCoder) { nil } - -// private func render() { -// self.addSubview(dividerView) -// dividerView.snp.makeConstraints { -// $0.edges.equalToSuperview() -// $0.height.equalTo(4) -// } -// } } From 4fc925c941f01a5041759fd189b75a49100ed7eb Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 13 Mar 2023 23:01:48 +0900 Subject: [PATCH 191/388] =?UTF-8?q?[ADD]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMember/ReflectionMemberCollectionView.swift | 2 +- .../ReflectionMember/ReflectionMemberCollectionViewCell.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 82e00a9b..103b8025 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -104,7 +104,7 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { if let userId = memberList[indexPath.item].userId { if selectedMemberList.contains(userId) { - cell.applyAttribute() + cell.applySelectedAttribute() } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index 9823788d..8ce7df34 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -13,7 +13,7 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { override var isSelected: Bool { didSet { - applyAttribute() + applySelectedAttribute() } } @@ -70,7 +70,7 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { // MARK: - func - func applyAttribute() { + func applySelectedAttribute() { self.backgroundColor = .white100 self.profileImage.layer.opacity = 0.5 self.nicknameLabel.textColor = .gray300 From 4739b37d5a6f8baf2a76f145669950e0acd1301c Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 13 Mar 2023 23:22:11 +0900 Subject: [PATCH 192/388] =?UTF-8?q?[ADD]=20deselect=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMember/ReflectionMemberCollectionView.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 103b8025..697a2f1a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -86,6 +86,14 @@ extension ReflectionMemberCollectionView: UICollectionViewDelegate { } didTappedMember?(selectedMember, selectedMemberList) } + + func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) { + let selectedMember = memberList[indexPath.item] + if !selectedMemberList.contains(where: { $0 == selectedMember.userId }) { + selectedMemberList.append(selectedMember.userId ?? 0) + } + didTappedMember?(selectedMember, selectedMemberList) + } } extension ReflectionMemberCollectionView: UICollectionViewDataSource { From 0532980581c9663d2ecea39a0a3ba803632e2144 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 14 Mar 2023 00:28:19 +0900 Subject: [PATCH 193/388] =?UTF-8?q?[ADD]=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 5a2d8c91..680b22d2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -327,8 +327,9 @@ final class SetNicknameViewController: BaseViewController { private func showPermissionAlert() { DispatchQueue.main.async { + guard let settingURL = URL(string: UIApplication.openSettingsURLString) else { return } self.makeAlert(title: TextLiteral.setNicknameViewControllerPermissionAlertTitle, message: TextLiteral.setNicknameViewControllerPermissionAlertMessage, okAction: { _ in - UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!) + UIApplication.shared.open(settingURL) }) } } @@ -357,14 +358,20 @@ final class SetNicknameViewController: BaseViewController { private func dispatchCreateTeam(type: SetupEndPoint, teamName: String, nickname: String, role: String?) { AF.upload(multipartFormData: { multipartFormData in - let teamInfo: Dictionary = ["team_name": teamName, "nickname": nickname, "role": role] + let teamInfo: Dictionary = ["team_name": teamName, + "nickname": nickname, + "role": role] for (key, value) in teamInfo { if let value = value { - multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") + guard let data = "\(value)".data(using: .utf8) else { return } + multipartFormData.append(data, withName: key, mimeType: "text/plain") } } if let profileURL = self.profileURL { - multipartFormData.append(profileURL, withName: "profile_image", fileName: ".png", mimeType: "image/png") + multipartFormData.append(profileURL, + withName: "profile_image", + fileName: ".png", + mimeType: "image/png") } }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let json = json.value { @@ -392,11 +399,15 @@ final class SetNicknameViewController: BaseViewController { let profileInfo: Dictionary = ["nickname": nickname, "role": role] for (key, value) in profileInfo { if let value = value { - multipartFormData.append("\(value)".data(using: .utf8)!, withName: key, mimeType: "text/plain") + guard let data = "\(value)".data(using: .utf8) else { return } + multipartFormData.append(data, withName: key, mimeType: "text/plain") } } if let profileURL = self.profileURL { - multipartFormData.append(profileURL, withName: "profile_image", fileName: ".png", mimeType: "image/png") + multipartFormData.append(profileURL, + withName: "profile_image", + fileName: ".png", + mimeType: "image/png") } }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let json = json.value { From 8649d407f55ba6514b16ea6cfa40e32ea4f55f28 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:08:00 +0900 Subject: [PATCH 194/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 9e28a03e..ca44dc91 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -12,11 +12,11 @@ import SnapKit final class TeamManageViewController: BaseViewController { private var sections: [Section] = [] - private lazy var teamCount = chageTeamView.teamDataDummy.count + private lazy var teamCount = changeTeamView.teamDataDummy.count // MARK: - property - private let chageTeamView = ChangeTeamView() + private let changeTeamView = ChangeTeamView() private let dividerView: UIView = { let view = UIView() view.backgroundColor = .gray100 @@ -51,8 +51,8 @@ final class TeamManageViewController: BaseViewController { $0.edges.equalToSuperview() } - scrollView.addSubview(chageTeamView) - chageTeamView.snp.makeConstraints { + scrollView.addSubview(changeTeamView) + changeTeamView.snp.makeConstraints { $0.top.equalToSuperview() $0.width.equalToSuperview() teamCount == 0 ? $0.height.equalTo(280) : $0.height.equalTo((teamCount * 59) + ((teamCount-1) * 8) + 80) @@ -60,7 +60,7 @@ final class TeamManageViewController: BaseViewController { scrollView.addSubview(dividerView) dividerView.snp.makeConstraints { - $0.top.equalTo(chageTeamView.snp.bottom) + $0.top.equalTo(changeTeamView.snp.bottom) $0.width.equalToSuperview() $0.height.equalTo(6) } From b2f7d70240de2b97b2210e55e561b2e7fb35ec1f Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:16:31 +0900 Subject: [PATCH 195/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/UIComponent/TeamChangeCollectionViewCell.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift index 1c5b94ed..882652f6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift @@ -57,10 +57,8 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { } private func applyAttribute() { - if isSelected { - self.layer.borderWidth = 2 - self.layer.borderColor = UIColor.blue200.cgColor - } + self.layer.borderWidth = 2 + self.layer.borderColor = UIColor.blue200.cgColor } private func resetAttribute() { From de20b711ce5216e9147ffdc2b20a281dc7f0a52c Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:22:01 +0900 Subject: [PATCH 196/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#204)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/UIComponent/TeamChangeCollectionViewCell.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift index 882652f6..cea13e8c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift @@ -59,9 +59,11 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { private func applyAttribute() { self.layer.borderWidth = 2 self.layer.borderColor = UIColor.blue200.cgColor + self.makeShadow(color: .black100, opacity: 0.3, offset: CGSize(width: 0, height: 0), radius: 0) } private func resetAttribute() { self.layer.borderWidth = 0 + self.makeShadow(color: .black100, opacity: 0.3, offset: CGSize(width: 0, height: 0), radius: 1) } } From a4b24a88f77b54899e0c1586dad85b80f3c0ae93 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:26:14 +0900 Subject: [PATCH 197/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index b9a20350..ad00105d 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -246,7 +246,7 @@ enum TextLiteral { // MARK: - TeamManageViewController - static let teamManageViewControllerEmptyLabel: String = "아직 팀에 합류한 팀원이 없습니다\n초대코드를 공유하여 팀원을 초대해주세요" + static let teamManageViewControllerEmptyLabel: String = "참여 중인 팀이 없습니다\n팀에 합류하거나 팀을 생성해주세요" static let teamManageViewControllerJoinNewTeam: String = "새로운 팀 합류하기" static let teamManageViewControllerCreateTeam: String = "팀 생성하기" static let teamManageViewControllerLoggout: String = "로그아웃" From 95c8d47ec7075b5f5e9a817e5b45d8a2689f3518 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:32:45 +0900 Subject: [PATCH 198/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 4 +--- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index ca44dc91..629fd071 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -44,8 +44,6 @@ final class TeamManageViewController: BaseViewController { } override func render() { - - view.addSubview(scrollView) scrollView.snp.makeConstraints { $0.edges.equalToSuperview() @@ -55,7 +53,7 @@ final class TeamManageViewController: BaseViewController { changeTeamView.snp.makeConstraints { $0.top.equalToSuperview() $0.width.equalToSuperview() - teamCount == 0 ? $0.height.equalTo(280) : $0.height.equalTo((teamCount * 59) + ((teamCount-1) * 8) + 80) + teamCount == 0 ? $0.height.equalTo(220) : $0.height.equalTo((teamCount * 59) + ((teamCount-1) * 8) + 80) } scrollView.addSubview(dividerView) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 48460a33..d71a0e75 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -12,7 +12,7 @@ import SnapKit final class ChangeTeamView: UIView { // MARK: - FIXME: 데이터 더미 입니다. - let teamDataDummy: [String] = ["맛쟁이 사과처럼", "명예 소방관"] + let teamDataDummy: [String] = [] // MARK: - property @@ -58,7 +58,7 @@ final class ChangeTeamView: UIView { private func render() { self.addSubview(titleLabel) titleLabel.snp.makeConstraints { - $0.top.equalTo(safeAreaLayoutGuide.snp.top).inset(26) + $0.top.equalTo(safeAreaLayoutGuide.snp.top).inset(34) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } From 9cdb6ce4a4f7ec4d0c6144f2b60e06e3d0fca434 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 14 Mar 2023 22:01:05 +0900 Subject: [PATCH 199/388] =?UTF-8?q?[ADD]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 680b22d2..1ad3e49f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -20,7 +20,7 @@ final class SetNicknameViewController: BaseViewController { } private let cameraPicker = UIImagePickerController() private let teamName: String = UserDefaultStorage.teamName - var profileURL: URL? + private var profileURL: URL? // MARK: - property From bdafae45b5f95b7a49ecf75241793c3a884c5bf2 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 15 Mar 2023 00:22:40 +0900 Subject: [PATCH 200/388] =?UTF-8?q?[ADD]=20response=20=ED=98=95=EC=8B=9D?= =?UTF-8?q?=20=EC=88=98=EC=A0=95(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMember/ReflectionMemberCollectionView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index c386918f..9b6f0a56 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -89,8 +89,8 @@ extension ReflectionMemberCollectionView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) { let selectedMember = memberList[indexPath.item] - if !selectedMemberList.contains(where: { $0 == selectedMember.userId }) { - selectedMemberList.append(selectedMember.userId ?? 0) + if !selectedMemberList.contains(where: { $0 == selectedMember.id }) { + selectedMemberList.append(selectedMember.id ?? 0) } didTappedMember?(selectedMember, selectedMemberList) } From 57b9ef3c4074de701eabb3af22e15e0bfcabec85 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 15 Mar 2023 01:14:21 +0900 Subject: [PATCH 201/388] =?UTF-8?q?[ADD]=20imageView=20clipsToBound=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMember/ReflectionMemberCollectionView.swift | 2 -- .../ReflectionMember/ReflectionMemberCollectionViewCell.swift | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index 9b6f0a56..da08f3ed 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -114,8 +114,6 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { } else { DispatchQueue.main.async { cell.profileImage.image = UIImage(data: data!) - cell.profileImage.clipsToBounds = true - cell.profileImage.layer.cornerRadius = 23 } } }).resume() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index 64e8c642..f4ccc653 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -23,6 +23,7 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { let imageView = UIImageView() imageView.image = ImageLiterals.imgProfileNone imageView.layer.cornerRadius = 23 + imageView.clipsToBounds = true return imageView }() let nicknameLabel: UILabel = { From 7550eb74fef34740dddd4702e11601bafc9a1da0 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 15 Mar 2023 02:38:58 +0900 Subject: [PATCH 202/388] [ADD] image crop(#311) --- .../SetNicknameViewController.swift | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 1ad3e49f..b69e1f6d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -334,6 +334,20 @@ final class SetNicknameViewController: BaseViewController { } } + private func cropSquare(_ image: UIImage) -> UIImage? { + let imageSize = image.size + let shortLength = imageSize.width < imageSize.height ? imageSize.width : imageSize.height + print(imageSize.width, imageSize.height, shortLength) + let origin = CGPoint( + x: imageSize.width / 2 - shortLength / 2, + y: imageSize.height / 2 - shortLength / 2 + ) + let size = CGSize(width: shortLength, height: shortLength) + let square = CGRect(origin: origin, size: size) + guard let squareImage = image.cgImage?.cropping(to: square) else { return nil } + return UIImage(cgImage: squareImage, scale: shortLength, orientation: .up) + } + // MARK: - selector @objc private func keyboardWillShow(notification: NSNotification) { @@ -455,8 +469,9 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { DispatchQueue.main.async { self.profileImageButton.profileImage.image = image as? UIImage } - let profileImage = image as? UIImage - if let data = profileImage?.pngData() { + guard let profileImage = image as? UIImage else { return } + let cropImage = self.cropSquare(profileImage) + if let data = cropImage?.pngData() { let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] let url = documents.appendingPathComponent(".png") do { @@ -479,8 +494,11 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate, UINavigati cameraPicker.dismiss(animated: true) if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { - self.profileImageButton.profileImage.image = image - if let data = image.pngData() { + DispatchQueue.main.async { + self.profileImageButton.profileImage.image = image + } + let cropImage = self.cropSquare(image) + if let data = cropImage?.pngData() { let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] let url = documents.appendingPathComponent(".png") do { From a7ed9afba46801dba92c7801cec5d778b4727d57 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 15 Mar 2023 19:54:34 +0900 Subject: [PATCH 203/388] [CHORE] imagecache added (#316) --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++++ .../Global/Extension/UIImageView+Extension.swift | 14 ++++++++++++-- .../Network/Storage/ImageCacheManager.swift | 14 ++++++++++++++ .../Cell/MyFeedbackMemberCollectionViewCell.swift | 6 +++--- 4 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Network/Storage/ImageCacheManager.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index a229795b..8de497e0 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -97,6 +97,7 @@ 3E5580072906A7B200714E46 /* InProgressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5580062906A7B200714E46 /* InProgressViewController.swift */; }; 3E66777529419C8300BB5670 /* KeywordTextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E66777429419C8300BB5670 /* KeywordTextFieldView.swift */; }; 3E8052DF2906E09100A6449D /* KeywordSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E8052DE2906E09100A6449D /* KeywordSectionHeaderView.swift */; }; + 3E953A9529C1CE7D0073302F /* ImageCacheManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E953A9429C1CE7D0073302F /* ImageCacheManager.swift */; }; 3EA341C129221998005CBD1C /* ToastContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA341C029221998005CBD1C /* ToastContentView.swift */; }; 3EA341E62924E2AD005CBD1C /* HomeEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA341E52924E2AD005CBD1C /* HomeEndPoint.swift */; }; 3EA341E82925E5EA005CBD1C /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA341E72925E5EA005CBD1C /* String+Extension.swift */; }; @@ -240,6 +241,7 @@ 3E5580062906A7B200714E46 /* InProgressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressViewController.swift; sourceTree = ""; }; 3E66777429419C8300BB5670 /* KeywordTextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordTextFieldView.swift; sourceTree = ""; }; 3E8052DE2906E09100A6449D /* KeywordSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordSectionHeaderView.swift; sourceTree = ""; }; + 3E953A9429C1CE7D0073302F /* ImageCacheManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCacheManager.swift; sourceTree = ""; }; 3EA341C029221998005CBD1C /* ToastContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastContentView.swift; sourceTree = ""; }; 3EA341E52924E2AD005CBD1C /* HomeEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeEndPoint.swift; sourceTree = ""; }; 3EA341E72925E5EA005CBD1C /* String+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = ""; }; @@ -602,6 +604,7 @@ children = ( 397E49592924F871004220D6 /* UserDefaultStorage.swift */, 397E495B2924F8A2004220D6 /* UserDefaultHandler.swift */, + 3E953A9429C1CE7D0073302F /* ImageCacheManager.swift */, ); path = Storage; sourceTree = ""; @@ -1083,6 +1086,7 @@ files = ( 525E721C28FF0F5B00EF3FCB /* MemberCollectionView.swift in Sources */, 395C7E2028FED7B500FC2FCA /* ReflectionNameView.swift in Sources */, + 3E953A9529C1CE7D0073302F /* ImageCacheManager.swift in Sources */, 39F52C44292329BA00B19A77 /* BaseModel.swift in Sources */, 522D99BF29041B51009CBD95 /* CustomTextView.swift in Sources */, 3EA341C129221998005CBD1C /* ToastContentView.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift index 0e43eaea..cf589a5d 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImageView+Extension.swift @@ -5,14 +5,24 @@ // Created by 이성민 on 2023/03/06. // +import Foundation import UIKit extension UIImageView { - func load(from url: URL) { + func load(from url: String) { + + let cacheKey = NSString(string: url) + if let cachedImage = ImageCacheManager.shared.object(forKey: cacheKey) { + self.image = cachedImage + return + } + DispatchQueue.global().async { [weak self] in - if let data = try? Data(contentsOf: url) { + if let imageUrl = URL(string: url), + let data = try? Data(contentsOf: imageUrl) { if let image = UIImage(data: data) { DispatchQueue.main.async { + ImageCacheManager.shared.setObject(image, forKey: cacheKey) self?.image = image } } diff --git a/Maddori.Apple/Maddori.Apple/Network/Storage/ImageCacheManager.swift b/Maddori.Apple/Maddori.Apple/Network/Storage/ImageCacheManager.swift new file mode 100644 index 00000000..6c660f7d --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/Storage/ImageCacheManager.swift @@ -0,0 +1,14 @@ +// +// ImageCacheManager.swift +// Maddori.Apple +// +// Created by 이성민 on 2023/03/15. +// + +import Foundation +import UIKit + +class ImageCacheManager { + static let shared = NSCache() + private init() {} +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 9e0f7c07..462eb60c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -94,9 +94,9 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { func setMemberProfileImage(from path: String?) { if let path = path { - if let fullImagePath = URL(string: UrlLiteral.iamgeBaseUrl + path) { - profileImageView.load(from: fullImagePath) - } + let fullImagePath = UrlLiteral.iamgeBaseUrl + path + profileImageView.load(from: fullImagePath) + } else { profileImageView.image = ImageLiterals.imgProfileNone } From 60c4a65326b30a3327d8866dd804cbfa7eedf0ee Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 15 Mar 2023 20:14:21 +0900 Subject: [PATCH 204/388] [CHORE] image scale aspect to fill (#316) --- .../MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 462eb60c..033967a6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -32,6 +32,7 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { }() private let profileImageView: UIImageView = { let imageView = UIImageView() + imageView.contentMode = .scaleAspectFill imageView.layer.cornerRadius = 30 imageView.clipsToBounds = true return imageView From 6b32642f9f7b8d3b55f112f2151c07ac2c10a77b Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 15 Mar 2023 20:41:54 +0900 Subject: [PATCH 205/388] =?UTF-8?q?[CHORE]=20guel-git=20review=20=EB=B0=98?= =?UTF-8?q?=EC=98=81=20(#316)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 033967a6..81578d7d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -56,7 +56,7 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { self.addSubview(shadowView) shadowView.snp.makeConstraints { $0.centerX.top.equalToSuperview() - $0.width.height.equalTo(60) + $0.width.height.equalTo(59) } shadowView.addSubview(profileImageView) From 74208733434aa3de95dc7c61bb77c1c0d42507ef Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 15 Mar 2023 20:44:18 +0900 Subject: [PATCH 206/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#316)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 81578d7d..76ba9f1c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -39,7 +39,7 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { }() private let memberNameLabel: UILabel = { let label = UILabel() - label.font = .body2 + label.font = .toast label.textColor = .gray400 label.lineBreakMode = .byTruncatingTail label.textAlignment = .center From dedadad7305da59f1c852e57e2da415ed2c882c9 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 15 Mar 2023 20:52:06 +0900 Subject: [PATCH 207/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#316)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 76ba9f1c..18d956a7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -94,7 +94,7 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { } func setMemberProfileImage(from path: String?) { - if let path = path { + if let path { let fullImagePath = UrlLiteral.iamgeBaseUrl + path profileImageView.load(from: fullImagePath) From efcf1715be8aea18c8334f147512fe088a0eed2b Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 15 Mar 2023 20:52:25 +0900 Subject: [PATCH 208/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#316)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 18d956a7..5f9e6a75 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -94,7 +94,7 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { } func setMemberProfileImage(from path: String?) { - if let path { + if let pathg { let fullImagePath = UrlLiteral.iamgeBaseUrl + path profileImageView.load(from: fullImagePath) From 9dab9ff8e7ee0bf84310450dba12c0de17dc428e Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 15 Mar 2023 20:53:05 +0900 Subject: [PATCH 209/388] =?UTF-8?q?[CHORE]=20=EC=9D=B4=EC=83=81=ED=95=9C?= =?UTF-8?q?=20=EC=8B=A4=EC=88=98=20=EC=88=98=EC=A0=95=20(#316)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 5f9e6a75..18d956a7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -94,7 +94,7 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { } func setMemberProfileImage(from path: String?) { - if let pathg { + if let path { let fullImagePath = UrlLiteral.iamgeBaseUrl + path profileImageView.load(from: fullImagePath) From a2dc9449706ee3e03b8c5facbf7d7424d3523c34 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 15:43:50 +0900 Subject: [PATCH 210/388] =?UTF-8?q?[CHORE]=20=EC=8A=A4=ED=81=AC=EB=A1=A4?= =?UTF-8?q?=20=EC=95=88=EB=90=98=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 629fd071..fc336056 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -34,6 +34,7 @@ final class TeamManageViewController: BaseViewController { return tableView }() private let scrollView: UIScrollView = UIScrollView() + private let contentView: UIView = UIView() // MARK: - life cycle @@ -49,25 +50,37 @@ final class TeamManageViewController: BaseViewController { $0.edges.equalToSuperview() } - scrollView.addSubview(changeTeamView) + scrollView.addSubview(contentView) + contentView.snp.makeConstraints { + $0.edges.equalTo(scrollView.contentLayoutGuide) + $0.width.equalTo(scrollView.frameLayoutGuide) + } + + contentView.addSubview(changeTeamView) changeTeamView.snp.makeConstraints { $0.top.equalToSuperview() $0.width.equalToSuperview() - teamCount == 0 ? $0.height.equalTo(220) : $0.height.equalTo((teamCount * 59) + ((teamCount-1) * 8) + 80) + if changeTeamView.teamDataDummy.isEmpty { + $0.height.equalTo(150) + } + else { + $0.height.equalTo((teamCount * 59) + ((teamCount - 1) * 8) + 28) + } } - scrollView.addSubview(dividerView) + contentView.addSubview(dividerView) dividerView.snp.makeConstraints { - $0.top.equalTo(changeTeamView.snp.bottom) + $0.top.equalTo(changeTeamView.snp.bottom).offset(50) $0.width.equalToSuperview() $0.height.equalTo(6) } - scrollView.addSubview(settingTableView) + contentView.addSubview(settingTableView) settingTableView.snp.makeConstraints { $0.top.equalTo(dividerView.snp.bottom) $0.width.equalTo(UIScreen.main.bounds.width) - $0.height.equalTo(1000) // FIXME: 수치 바꿀것 + $0.bottom.equalToSuperview() + $0.height.equalTo(252) // FIXME: 수치 바꿀것 } } From a66482327d4def2db322bb8ea2057ee212e89dbd Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:10:33 +0900 Subject: [PATCH 211/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20-=20Size=20enum=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 10 ++++++++-- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index fc336056..d540a088 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -11,6 +11,12 @@ import SnapKit final class TeamManageViewController: BaseViewController { + private enum Size { + static let teamSectionHeight = 59 + static let teamSectionSpacing = 8 + static let teamSectionPadding = 28 + } + private var sections: [Section] = [] private lazy var teamCount = changeTeamView.teamDataDummy.count @@ -64,7 +70,7 @@ final class TeamManageViewController: BaseViewController { $0.height.equalTo(150) } else { - $0.height.equalTo((teamCount * 59) + ((teamCount - 1) * 8) + 28) + $0.height.equalTo((teamCount * Size.teamSectionHeight) + ((teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding) } } @@ -80,7 +86,7 @@ final class TeamManageViewController: BaseViewController { $0.top.equalTo(dividerView.snp.bottom) $0.width.equalTo(UIScreen.main.bounds.width) $0.bottom.equalToSuperview() - $0.height.equalTo(252) // FIXME: 수치 바꿀것 + $0.height.equalTo(252) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index d71a0e75..c1420402 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -12,7 +12,7 @@ import SnapKit final class ChangeTeamView: UIView { // MARK: - FIXME: 데이터 더미 입니다. - let teamDataDummy: [String] = [] + let teamDataDummy: [String] = ["1","1","1","1","1","1","1","1","1","1","1","1"] // MARK: - property @@ -79,7 +79,7 @@ final class ChangeTeamView: UIView { private func setLayoutEmptyView() { self.addSubview(emptyView) emptyView.snp.makeConstraints { - $0.top.equalTo(titleLabel.snp.bottom) + $0.top.equalTo(titleLabel.snp.bottom).offset(28) $0.directionalHorizontalEdges.equalToSuperview() $0.height.equalToSuperview() } From a2b65e4d8f69bb5b8fe91a0aab7a8d105761c568 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:12:21 +0900 Subject: [PATCH 212/388] =?UTF-8?q?[CHORE]=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index c1420402..eb856251 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -79,7 +79,7 @@ final class ChangeTeamView: UIView { private func setLayoutEmptyView() { self.addSubview(emptyView) emptyView.snp.makeConstraints { - $0.top.equalTo(titleLabel.snp.bottom).offset(28) + $0.top.equalTo(titleLabel.snp.bottom) $0.directionalHorizontalEdges.equalToSuperview() $0.height.equalToSuperview() } From 58fb548dcbf1ccc9f3aa0b5376f899fca9d4b153 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:14:31 +0900 Subject: [PATCH 213/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index eb856251..3db897b5 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -27,7 +27,7 @@ final class ChangeTeamView: UIView { let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical flowLayout.sectionInset = UIEdgeInsets(top: 12, left: 0 , bottom: 16, right: 0) - flowLayout.itemSize = CGSize(width: UIScreen.main.bounds.width - SizeLiteral.leadingTrailingPadding*2, height: 59) + flowLayout.itemSize = CGSize(width: UIScreen.main.bounds.width - SizeLiteral.leadingTrailingPadding * 2, height: 59) flowLayout.minimumLineSpacing = 8 return flowLayout }() From f4f1ca9c5afe820b6581992c2211b5efe77e8aff Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:16:48 +0900 Subject: [PATCH 214/388] =?UTF-8?q?[CHORE]=20lazy=20=EC=82=AD=EC=A0=9C=20(?= =?UTF-8?q?#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 3db897b5..b98adf16 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -39,7 +39,7 @@ final class ChangeTeamView: UIView { collectionView.backgroundColor = .white200 return collectionView }() - private lazy var emptyView = EmptyTeamView() + private let emptyView = EmptyTeamView() // MARK: - life cycle From d6394333ee8f042679fe3a91f71a6d869d4a7578 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:17:37 +0900 Subject: [PATCH 215/388] =?UTF-8?q?[CHORE]=20=EB=B9=88=EC=B9=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index b98adf16..f9c6b4e1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -97,8 +97,6 @@ extension ChangeTeamView: UICollectionViewDataSource { cell.teamNameLabel.text = teamDataDummy[indexPath.item] return cell } - - } extension ChangeTeamView: UICollectionViewDelegate { From 9d96fed1c5f38242aac9d65c4eabbaa17da32b4b Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:21:17 +0900 Subject: [PATCH 216/388] =?UTF-8?q?[CHORE]=20=EC=97=A0=ED=8B=B0=20?= =?UTF-8?q?=EB=B7=B0=20=EB=86=92=EC=9D=B4=20=EC=88=98=EC=A0=95=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index f9c6b4e1..1baa90b3 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -12,7 +12,7 @@ import SnapKit final class ChangeTeamView: UIView { // MARK: - FIXME: 데이터 더미 입니다. - let teamDataDummy: [String] = ["1","1","1","1","1","1","1","1","1","1","1","1"] + let teamDataDummy: [String] = [] // MARK: - property @@ -79,7 +79,7 @@ final class ChangeTeamView: UIView { private func setLayoutEmptyView() { self.addSubview(emptyView) emptyView.snp.makeConstraints { - $0.top.equalTo(titleLabel.snp.bottom) + $0.top.equalTo(titleLabel.snp.bottom).offset(28) $0.directionalHorizontalEdges.equalToSuperview() $0.height.equalToSuperview() } From 5ffa8a116e1f3c0094843dc8eb0da84a884972d1 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:37:10 +0900 Subject: [PATCH 217/388] =?UTF-8?q?[ADD]=20TeamInfoEndPoint=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../Network/EndPoint/TeamInfoEndPoint.swift | 44 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index bbdb752b..f31826d2 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -137,6 +137,7 @@ 7EE38BAD2925DDD200FD738D /* EncodeDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */; }; 7EE38BB3292623F500FD738D /* MyReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */; }; D702278A297F99510027EF64 /* TeamManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7022789297F99500027EF64 /* TeamManageViewController.swift */; }; + D70AF89729C2FDF6003A500C /* TeamInfoEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = D70AF89629C2FDF6003A500C /* TeamInfoEndPoint.swift */; }; D7195FBC299223F6002526E7 /* TeamChangeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7195FBB299223F6002526E7 /* TeamChangeCollectionViewCell.swift */; }; D724790C28FEC8C900D67B50 /* BaseTextFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */; }; D724790E28FEEEC300D67B50 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D724790D28FEEEC300D67B50 /* CustomTextField.swift */; }; @@ -288,6 +289,7 @@ 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncodeDTO.swift; sourceTree = ""; }; 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionEndPoint.swift; sourceTree = ""; }; D7022789297F99500027EF64 /* TeamManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamManageViewController.swift; sourceTree = ""; }; + D70AF89629C2FDF6003A500C /* TeamInfoEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamInfoEndPoint.swift; sourceTree = ""; }; D7195FBB299223F6002526E7 /* TeamChangeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamChangeCollectionViewCell.swift; sourceTree = ""; }; D724790B28FEC8C900D67B50 /* BaseTextFieldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTextFieldViewController.swift; sourceTree = ""; }; D724790D28FEEEC300D67B50 /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = ""; }; @@ -750,6 +752,7 @@ 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */, 3EA341E52924E2AD005CBD1C /* HomeEndPoint.swift */, 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */, + D70AF89629C2FDF6003A500C /* TeamInfoEndPoint.swift */, ); path = EndPoint; sourceTree = ""; @@ -1134,6 +1137,7 @@ 39F52C44292329BA00B19A77 /* BaseModel.swift in Sources */, 522D99BF29041B51009CBD95 /* CustomTextView.swift in Sources */, 3EA341C129221998005CBD1C /* ToastContentView.swift in Sources */, + D70AF89729C2FDF6003A500C /* TeamInfoEndPoint.swift in Sources */, 39F1A13529125762005E3456 /* MyFeedbackViewController.swift in Sources */, 39F52C702924747600B19A77 /* AllCertainTypeFeedBackResponse.swift in Sources */, 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift new file mode 100644 index 00000000..0ef96bfe --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift @@ -0,0 +1,44 @@ +// +// TeamInfoEndPoint.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/03/16. +// + +import Alamofire + +enum TeamInfoEndPoint: EndPointable { + case fetchUserTeamList + + var address: String { + switch self { + case .fetchUserTeamList: + return "http://15.165.21.115:3001/api/v2/users/teams" + } + } + + var method: Alamofire.HTTPMethod { + switch self { + case .fetchUserTeamList: + return .get + } + } + + var body: T? { + switch self { + case .fetchUserTeamList: + return nil + } + } + + var headers: Alamofire.HTTPHeaders? { + switch self { + case .fetchUserTeamList: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)" + ] + return HTTPHeaders(headers) + } + } +} From 0938d7953a52363b2c1dc361a7ba946e1feeb550 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:38:05 +0900 Subject: [PATCH 218/388] =?UTF-8?q?[CHORE]=20Alamofire=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index d540a088..9dcebe86 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -7,6 +7,7 @@ import UIKit +import Alamofire import SnapKit final class TeamManageViewController: BaseViewController { From 9bd7cc210bf41f55746c680f54cf79d3e2910c7b Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 17:04:31 +0900 Subject: [PATCH 219/388] =?UTF-8?q?[FEAT]=20api=20=EC=97=B0=EA=B2=B0=20(#3?= =?UTF-8?q?20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 26 +++++++++++++++++-- .../Home/UIComponent/ChangeTeamView.swift | 11 ++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 9dcebe86..5ed25e13 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -19,7 +19,13 @@ final class TeamManageViewController: BaseViewController { } private var sections: [Section] = [] - private lazy var teamCount = changeTeamView.teamDataDummy.count + private lazy var teamCount = 0 { + didSet { + changeTeamView.snp.updateConstraints { + $0.height.equalTo((teamCount * Size.teamSectionHeight) + ((teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding) + } + } + } // MARK: - property @@ -49,6 +55,7 @@ final class TeamManageViewController: BaseViewController { super.viewDidLoad() setupDelegate() configureSettingModels() + fetchUserTeamList(type: .fetchUserTeamList) } override func render() { @@ -77,7 +84,7 @@ final class TeamManageViewController: BaseViewController { contentView.addSubview(dividerView) dividerView.snp.makeConstraints { - $0.top.equalTo(changeTeamView.snp.bottom).offset(50) + $0.top.equalTo(changeTeamView.snp.bottom).offset(55) $0.width.equalToSuperview() $0.height.equalTo(6) } @@ -132,6 +139,21 @@ final class TeamManageViewController: BaseViewController { // FIXME: api 연결 print("회원탈퇴") } + + // MARK: - api + private func fetchUserTeamList(type: TeamInfoEndPoint) { + AF.request(type.address, + method: type.method, + headers: type.headers + ).responseDecodable(of: BaseModel<[TeamInfoResponse]>.self) { json in + if let json = json.value { + guard let teamCount = json.detail?.count else { return } + self.teamCount = teamCount + guard let team = json.detail else { return } + self.changeTeamView.teamDataDummy = team + } + } + } } extension TeamManageViewController: UITableViewDataSource { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 1baa90b3..e72effa7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -11,8 +11,11 @@ import SnapKit final class ChangeTeamView: UIView { - // MARK: - FIXME: 데이터 더미 입니다. - let teamDataDummy: [String] = [] + var teamDataDummy: [TeamInfoResponse] = [] { + didSet { + teamDataDummy.isEmpty ? setLayoutEmptyView() : setLayoutTeamListView() + } + } // MARK: - property @@ -61,8 +64,6 @@ final class ChangeTeamView: UIView { $0.top.equalTo(safeAreaLayoutGuide.snp.top).inset(34) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } - - teamDataDummy.isEmpty ? setLayoutEmptyView() : setLayoutTeamListView() } // MARK: - function @@ -94,7 +95,7 @@ extension ChangeTeamView: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TeamChangeCollectionViewCell.className, for: indexPath) as? TeamChangeCollectionViewCell else { return UICollectionViewCell() } - cell.teamNameLabel.text = teamDataDummy[indexPath.item] + cell.teamNameLabel.text = teamDataDummy[indexPath.item].teamName return cell } } From 773610fa735b6cd571fef6898a50187a6d34f5c9 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 16 Mar 2023 18:17:41 +0900 Subject: [PATCH 220/388] =?UTF-8?q?[ADD]=20=EC=98=A4=ED=83=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift index 18d956a7..f8064914 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/Cell/MyFeedbackMemberCollectionViewCell.swift @@ -95,7 +95,7 @@ final class MyFeedbackMemberCollectionViewCell: BaseCollectionViewCell { func setMemberProfileImage(from path: String?) { if let path { - let fullImagePath = UrlLiteral.iamgeBaseUrl + path + let fullImagePath = UrlLiteral.imageBaseURL + path profileImageView.load(from: fullImagePath) } else { From b2469b4d3cd89ab3ce145ddf1e8f772b7f175b59 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Thu, 16 Mar 2023 18:23:50 +0900 Subject: [PATCH 221/388] =?UTF-8?q?[ADD]=20image=20cache=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionView.swift | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index da08f3ed..fb568211 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -107,16 +107,9 @@ extension ReflectionMemberCollectionView: UICollectionViewDataSource { return UICollectionViewCell() } - if let profileImageURL = memberList[indexPath.item].profileImagePath { - URLSession.shared.dataTask(with: NSURL(string: UrlLiteral.imageBaseURL + profileImageURL)! as URL, completionHandler: { (data, response, error) -> Void in - if error != nil { - return - } else { - DispatchQueue.main.async { - cell.profileImage.image = UIImage(data: data!) - } - } - }).resume() + if let imagePath = memberList[indexPath.item].profileImagePath { + let fullImagePath = UrlLiteral.imageBaseURL + imagePath + cell.profileImage.load(from: fullImagePath) } cell.nicknameLabel.text = memberList[indexPath.item].nickname From a715e4593499d5cba72336fa3f4748ab03dda530 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 18:35:47 +0900 Subject: [PATCH 222/388] =?UTF-8?q?[FEAT]=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83,=20=ED=9A=8C=EC=9B=90=ED=83=88=ED=87=B4=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 2 + .../Home/Home/TeamManageViewController.swift | 48 +++++++++++++++++-- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index f5892119..63923108 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -157,6 +157,8 @@ final class HomeViewController: BaseViewController { // MARK: - func private func presentTeamModal() { +// guard let navigationController = self.navigationController else { return } +// let teamViewController = TeamManageViewController(navigationController: navigationController) let teamViewController = TeamManageViewController() teamViewController.modalPresentationStyle = .pageSheet diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 5ed25e13..20d80575 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -26,6 +26,8 @@ final class TeamManageViewController: BaseViewController { } } } + // MARK: - 1 + // var navigation: UINavigationController? // MARK: - property @@ -51,6 +53,16 @@ final class TeamManageViewController: BaseViewController { // MARK: - life cycle + // MARK: - 1 +// required init(navigationController: UINavigationController?) { +// navigation = navigationController +// super.init() +// } +// +// required init?(coder: NSCoder) { +// fatalError("init(coder:) has not been implemented") +// } + override func viewDidLoad() { super.viewDidLoad() setupDelegate() @@ -122,7 +134,12 @@ final class TeamManageViewController: BaseViewController { private func joinNewTeam() { // FIXME: api 연결 - print("새로운 팀 합류하기") + // MARK: - 1 +// let joinViewController = JoinTeamViewController() +// dismiss(animated: true) { +// self.navigation?.pushViewController(joinViewController, animated: true) +// } +// print("새로운 팀 합류하기") } private func createTeam() { @@ -131,13 +148,19 @@ final class TeamManageViewController: BaseViewController { } private func logout() { - // FIXME: api 연결 - print("로그아웃") + self.logoutUser() } private func withdrawal() { - // FIXME: api 연결 - print("회원탈퇴") + self.deleteUser(type: .deleteUser) + } + + private func logoutUser() { + makeRequestAlert(title: TextLiteral.myReflectionViewControllerLogOutMessage, message: "", okTitle: "확인", cancelTitle: "취소") { _ in + guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate + as? SceneDelegate else { return } + sceneDelegate.logout() + } } // MARK: - api @@ -154,6 +177,21 @@ final class TeamManageViewController: BaseViewController { } } } + + private func deleteUser(type: MyReflectionEndPoint) { + AF.request(type.address, + method: type.method, + headers: type.headers + ) + .responseDecodable(of: BaseModel.self) { json in + if let _ = json.value { + UserDefaultHandler.clearAllData() + guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate + as? SceneDelegate else { return } + sceneDelegate.logout() + } + } + } } extension TeamManageViewController: UITableViewDataSource { From 4ef7915e8ac7259db2f017fd77d7b72753561c04 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 18:38:49 +0900 Subject: [PATCH 223/388] =?UTF-8?q?[CHORE]=20=EC=95=8C=EB=9F=BF=EC=B0=BD?= =?UTF-8?q?=20=EB=9D=84=EC=9A=B0=EA=B8=B0=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 20d80575..7759c177 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -152,7 +152,9 @@ final class TeamManageViewController: BaseViewController { } private func withdrawal() { - self.deleteUser(type: .deleteUser) + self.makeRequestAlert(title: TextLiteral.myReflectionViewControllerDeleteUserAlertTitle, message: TextLiteral.myReflectionViewControllerDeleteUserAlertMessage, okAction: { [weak self] _ in + self?.deleteUser(type: .deleteUser) + }) } private func logoutUser() { From 7310b62759c0e204f4e091948026a62346862d30 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 18:40:09 +0900 Subject: [PATCH 224/388] =?UTF-8?q?[CHORE]=20=EA=B0=9C=ED=96=89=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 7759c177..c918c23a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -152,13 +152,18 @@ final class TeamManageViewController: BaseViewController { } private func withdrawal() { - self.makeRequestAlert(title: TextLiteral.myReflectionViewControllerDeleteUserAlertTitle, message: TextLiteral.myReflectionViewControllerDeleteUserAlertMessage, okAction: { [weak self] _ in + self.makeRequestAlert(title: TextLiteral.myReflectionViewControllerDeleteUserAlertTitle, + message: TextLiteral.myReflectionViewControllerDeleteUserAlertMessage, + okAction: { [weak self] _ in self?.deleteUser(type: .deleteUser) }) } private func logoutUser() { - makeRequestAlert(title: TextLiteral.myReflectionViewControllerLogOutMessage, message: "", okTitle: "확인", cancelTitle: "취소") { _ in + makeRequestAlert(title: TextLiteral.myReflectionViewControllerLogOutMessage, + message: "", + okTitle: "확인", + cancelTitle: "취소") { _ in guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate else { return } sceneDelegate.logout() @@ -166,6 +171,7 @@ final class TeamManageViewController: BaseViewController { } // MARK: - api + private func fetchUserTeamList(type: TeamInfoEndPoint) { AF.request(type.address, method: type.method, From 6a9bc08ada2c116d8f725f8907898c73bd20d6e0 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 16 Mar 2023 19:29:27 +0900 Subject: [PATCH 225/388] =?UTF-8?q?[CHORE]=20=EC=97=B0=EA=B2=B0=20?= =?UTF-8?q?=EC=A3=BC=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index c918c23a..93d5f5b5 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -140,6 +140,12 @@ final class TeamManageViewController: BaseViewController { // self.navigation?.pushViewController(joinViewController, animated: true) // } // print("새로운 팀 합류하기") + let rootView = presentingViewController + dismiss(animated: true) { + let joinViewController = JoinTeamViewController() + joinViewController.modalPresentationStyle = .fullScreen + rootView?.present(joinViewController, animated: true) + } } private func createTeam() { From 95ee23970ff98f489799218706ca795634240350 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 17 Mar 2023 16:16:42 +0900 Subject: [PATCH 226/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=83=81=EC=84=B8?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=20TableView=20Header,=20Cell=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 +++-- .../TeamDetailMemberTableHeaderView.swift | 47 +++++++++++++++++++ .../Cell/TeamDetailMemberTableViewCell.swift | 26 ++++++++++ .../Cell/TeamDetailMembersCell.swift | 23 --------- 4 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift delete mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index e9b8a598..c7012e01 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; + 391D38DB29C449DE00A6BFED /* TeamDetailMemberTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D38DA29C449DE00A6BFED /* TeamDetailMemberTableViewCell.swift */; }; + 391D38DD29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D38DC29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift */; }; 39257DC528F8FEBD00201E0B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DC428F8FEBD00201E0B /* AppDelegate.swift */; }; 39257DC728F8FEBD00201E0B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DC628F8FEBD00201E0B /* SceneDelegate.swift */; }; 39257DCE28F8FEBE00201E0B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 39257DCD28F8FEBE00201E0B /* Assets.xcassets */; }; @@ -23,7 +25,6 @@ 39257DF528F93E4700201E0B /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DF428F93E4700201E0B /* UIColor+Extension.swift */; }; 39307CF52917DA9300789AB6 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39307CF42917DA9300789AB6 /* LoginViewController.swift */; }; 39341E0A298BA419006C1727 /* TeamDetailMembersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */; }; - 39341E0D298BC354006C1727 /* TeamDetailMembersCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */; }; 39341E0F29921181006C1727 /* MemberInformationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E0E29921181006C1727 /* MemberInformationView.swift */; }; 39341E1129922D17006C1727 /* FullDividerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39341E1029922D17006C1727 /* FullDividerView.swift */; }; 39436C1029127BBA0083D77A /* MyFeedbackCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */; }; @@ -161,6 +162,8 @@ 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; + 391D38DA29C449DE00A6BFED /* TeamDetailMemberTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMemberTableViewCell.swift; sourceTree = ""; }; + 391D38DC29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMemberTableHeaderView.swift; sourceTree = ""; }; 39257DC128F8FEBD00201E0B /* Maddori.Apple.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Maddori.Apple.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39257DC428F8FEBD00201E0B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39257DC628F8FEBD00201E0B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -175,7 +178,6 @@ 39257DF428F93E4700201E0B /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = ""; }; 39307CF42917DA9300789AB6 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; 39341E09298BA419006C1727 /* TeamDetailMembersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersView.swift; sourceTree = ""; }; - 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMembersCell.swift; sourceTree = ""; }; 39341E0E29921181006C1727 /* MemberInformationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberInformationView.swift; sourceTree = ""; }; 39341E1029922D17006C1727 /* FullDividerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullDividerView.swift; sourceTree = ""; }; 39436C0F29127BBA0083D77A /* MyFeedbackCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackCollectionView.swift; sourceTree = ""; }; @@ -504,7 +506,8 @@ 39341E0B298BC344006C1727 /* Cell */ = { isa = PBXGroup; children = ( - 39341E0C298BC354006C1727 /* TeamDetailMembersCell.swift */, + 391D38DA29C449DE00A6BFED /* TeamDetailMemberTableViewCell.swift */, + 391D38DC29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift */, ); path = Cell; sourceTree = ""; @@ -1177,7 +1180,6 @@ 39F15C0C296D371500952D02 /* EmptyPersonView.swift in Sources */, 52DC9091291A98CC00904739 /* MyFeedbackEditViewController.swift in Sources */, 3E66777529419C8300BB5670 /* KeywordTextFieldView.swift in Sources */, - 39341E0D298BC354006C1727 /* TeamDetailMembersCell.swift in Sources */, 3EA341E82925E5EA005CBD1C /* String+Extension.swift in Sources */, D7AFB7C72916FF9400E998B7 /* CustomSegmentControl.swift in Sources */, 7E8CDC67292E19B000984742 /* SettingButton.swift in Sources */, @@ -1200,6 +1202,7 @@ 39F52C652923369000B19A77 /* EditFeedBackResponse.swift in Sources */, 525E722528FFCFA600EF3FCB /* FeedbackTypeButtonView.swift in Sources */, 39A64ACE2905885F001DB020 /* StartSuggestionView.swift in Sources */, + 391D38DD29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift in Sources */, D7AFB7C52916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift in Sources */, 520FEC44292234C0009FC1F2 /* FeedbackToMeModel.swift in Sources */, 3E5195AB292B05BC00710A01 /* JoinReflectionButton.swift in Sources */, @@ -1234,6 +1237,7 @@ 39F52C68292472EB00B19A77 /* AllFeedBackResponse.swift in Sources */, 3975CEAF293EEDD6002D4F1A /* KeywordView.swift in Sources */, 39257DF128F93C2A00201E0B /* ImageLiteral.swift in Sources */, + 391D38DB29C449DE00A6BFED /* TeamDetailMemberTableViewCell.swift in Sources */, 395C7E252900E74700FC2FCA /* StartReflectionViewController.swift in Sources */, 3E557FF82901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift in Sources */, 39847424292603B000EDC139 /* AddFeedBackEndPoint.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift new file mode 100644 index 00000000..88558eee --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift @@ -0,0 +1,47 @@ +// +// TeamDetailMemberTableHeaderView.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/03/17. +// + +import UIKit + +import SnapKit + +final class TeamDetailMemberTableHeaderView: UITableViewHeaderFooterView { + + // MARK: - property + + private let memberInformationView = MemberInformationView(nickname: "이드", role: "디자인 리드 / 개발자") + private let dividerView: UIView = { + let view = UIView() + view.layer.borderWidth = 0.5 + view.layer.borderColor = UIColor.gray300.cgColor + return view + }() + + // MARK: - life cycle + + override init(reuseIdentifier: String?) { + super.init(reuseIdentifier: reuseIdentifier) + render() + } + + required init?(coder: NSCoder) { nil } + + private func render() { + self.addSubview(memberInformationView) + memberInformationView.snp.makeConstraints { + $0.top.leading.trailing.equalToSuperview() + $0.height.equalTo(46) + } + + self.addSubview(dividerView) + dividerView.snp.makeConstraints { + $0.top.equalTo(memberInformationView.snp.bottom).offset(24) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(1) + } + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift new file mode 100644 index 00000000..111cc4f5 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift @@ -0,0 +1,26 @@ +// +// TeamDetailMemberTableViewCell.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/03/17. +// + +import UIKit + +import SnapKit + +final class TeamDetailMemberTableViewCell: BaseTableViewCell { + + // MARK: - property + + private let memberInfoView = MemberInformationView(nickname: "nickname test", role: "role test") + + // MARK: - life cycle + + override func render() { + self.addSubview(memberInfoView) + memberInfoView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift deleted file mode 100644 index c492fba6..00000000 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMembersCell.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// TeamDetailMembersCell.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2023/02/02. -// - -import UIKit - -import SnapKit - -final class TeamDetailMembersCell: BaseCollectionViewCell { - - // MARK: - property - - private let memberInformationView = MemberInformationView(nickname: "익명", role: "팀원") - - // MARK: - life cycle - - override func render() { - self.addSubview(memberInformationView) - } -} From 5e1d5e59748bc710dba33f53043a4f4806202177 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 17 Mar 2023 16:18:07 +0900 Subject: [PATCH 227/388] =?UTF-8?q?[CHORE]=20default=20Image=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/UIComponent/MemberInformationView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift index 53621e64..f5125663 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift @@ -18,7 +18,7 @@ final class MemberInformationView: UIView { private let profileImageView: UIImageView = { let imageView = UIImageView() imageView.layer.cornerRadius = 23 - imageView.image = ImageLiterals.imgPersonTab + imageView.image = ImageLiterals.imgProfileNone return imageView }() private lazy var profileNicknameLabel: UILabel = { From cbeaf5b6474056f8076e8a29eaaf106a12883f74 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 17 Mar 2023 16:18:33 +0900 Subject: [PATCH 228/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EB=A9=A4?= =?UTF-8?q?=EB=B2=84=20=EC=83=81=EC=84=B8=EC=A0=95=EB=B3=B4=20TableView?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIComponent/TeamDetailMembersView.swift | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index 8878bcc9..85695f8b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -11,21 +11,19 @@ import SnapKit final class TeamDetailMembersView: UIView { - private let cellWidth = UIScreen.main.bounds.width - (SizeLiteral.leadingTrailingPadding * 2) + let members: [String] = Array(repeating: "", count: 2) // MARK: - property - private lazy var flowLayout: UICollectionViewFlowLayout = { - let flowLayout = UICollectionViewFlowLayout() - flowLayout.scrollDirection = .vertical - flowLayout.itemSize = CGSize(width: cellWidth, height: 46) - flowLayout.minimumLineSpacing = 20 - return flowLayout - }() - private lazy var memberCollectionView: UICollectionView = { - let collectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) - collectionView.register(TeamDetailMembersCell.self, forCellWithReuseIdentifier: TeamDetailMembersCell.className) - return collectionView + private let memberTableView: UITableView = { + let tableView = UITableView(frame: .zero, style: .grouped) + tableView.backgroundColor = .backgroundWhite + tableView.showsVerticalScrollIndicator = false + tableView.isScrollEnabled = false + tableView.separatorStyle = .none + tableView.register(TeamDetailMemberTableHeaderView.self, forHeaderFooterViewReuseIdentifier: TeamDetailMemberTableHeaderView.className) + tableView.register(TeamDetailMemberTableViewCell.self, forCellReuseIdentifier: TeamDetailMemberTableViewCell.className) + return tableView }() // MARK: - life cycle @@ -41,30 +39,44 @@ final class TeamDetailMembersView: UIView { // MARK: - func private func render() { - self.addSubview(memberCollectionView) - memberCollectionView.snp.makeConstraints { + self.addSubview(memberTableView) + memberTableView.snp.makeConstraints { $0.edges.equalToSuperview() } } private func setupDelegation() { - memberCollectionView.delegate = self - memberCollectionView.dataSource = self + memberTableView.delegate = self + memberTableView.dataSource = self } } -extension TeamDetailMembersView: UICollectionViewDataSource { - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - // FIXME: - 임시 확인 값 - return 3 +// MARK: - extension + +extension TeamDetailMembersView: UITableViewDelegate { + +} + +extension TeamDetailMembersView: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return members.count } - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TeamDetailMembersCell.className, for: indexPath) as? TeamDetailMembersCell else { return UICollectionViewCell() } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: TeamDetailMemberTableViewCell.className, for: indexPath) as? TeamDetailMemberTableViewCell else { return UITableViewCell() } return cell } -} - -extension TeamDetailMembersView: UICollectionViewDelegate { + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 66 + } + + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + guard let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: TeamDetailMemberTableHeaderView.className) as? TeamDetailMemberTableHeaderView else { return UITableViewHeaderFooterView() } + return headerView + } + + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + return 70 + 24 + } } From bf52d7e8fb3c1d1f3e3f6532e4e2be5e916e2fe0 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 17 Mar 2023 16:18:47 +0900 Subject: [PATCH 229/388] =?UTF-8?q?[CHORE]=20Auot=20Layout=20=EC=9E=AC?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 101 ++++++++++-------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 2b98141d..1c912b43 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -11,6 +11,16 @@ import SnapKit final class TeamDetailViewController: BaseViewController { + private enum PropertySize { + static let headerViewHeight: CGFloat = 70 + static let cellSize: CGFloat = 46 + static let cellSpacing: CGFloat = 20 + static let navigationBarHeight: CGFloat = 44 + static let homeIndicatorHeight: CGFloat = 34 + static let tableViewTopProperty: CGFloat = 86 + static let tableViewBottomProperty: CGFloat = 120 + } + // MARK: - property private lazy var backButton = BackButton(type: .system) @@ -30,6 +40,8 @@ final class TeamDetailViewController: BaseViewController { button.setUnderline() return button }() + private let scrollView = UIScrollView() + private let contentView = UIView() private let memberTitleLabel: UILabel = { let label = UILabel() label.text = TextLiteral.teamDetailViewControllerMemberTitleLabel @@ -37,14 +49,7 @@ final class TeamDetailViewController: BaseViewController { label.font = .label2 return label }() - private let memberInformationView = MemberInformationView(nickname: "이드", role: "디자인 리드 / 개발자") - private let dividerView: UIView = { - let view = UIView() - view.layer.borderWidth = 0.5 - view.layer.borderColor = UIColor.gray300.cgColor - return view - }() - private let memberCollectionView = TeamDetailMembersView() + private let memberTableView = TeamDetailMembersView() private let firstFullDividerView = FullDividerView() private let codeShareButton: UIButton = { let button = UIButton(type: .system) @@ -99,63 +104,71 @@ final class TeamDetailViewController: BaseViewController { $0.width.height.equalTo(44) } - view.addSubview(memberTitleLabel) - memberTitleLabel.snp.makeConstraints { + view.addSubview(scrollView) + scrollView.snp.makeConstraints { $0.top.equalTo(titleLabel.snp.bottom).offset(SizeLiteral.topComponentPadding) - $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.leading.trailing.bottom.equalToSuperview() } - view.addSubview(memberInformationView) - memberInformationView.snp.makeConstraints { - $0.top.equalTo(memberTitleLabel.snp.bottom).offset(20) - $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.height.equalTo(46) + scrollView.addSubview(contentView) + contentView.snp.makeConstraints { + $0.edges.equalToSuperview() + $0.width.equalTo(view.snp.width) + $0.height.equalTo(view.snp.height).priority(.low) } - view.addSubview(dividerView) - dividerView.snp.makeConstraints { - $0.top.equalTo(memberInformationView.snp.bottom).offset(25) - $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.height.equalTo(1) + contentView.addSubview(memberTitleLabel) + memberTitleLabel.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.height.equalTo(16) } - view.addSubview(teamLeaveButton) - teamLeaveButton.snp.makeConstraints { - $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(20) + let topInset: CGFloat = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.size.height + let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height + let bottomInset: CGFloat = hasHomeIndicator ? 34 : 0 + let minHeight = view.frame.size.height - topInset - PropertySize.navigationBarHeight - PropertySize.tableViewTopProperty - PropertySize.tableViewBottomProperty - bottomInset - 60 + let currentHeight = (PropertySize.cellSize + PropertySize.cellSpacing) * CGFloat(memberTableView.members.count) + PropertySize.headerViewHeight + PropertySize.cellSpacing + let height = max(minHeight, currentHeight) + + contentView.addSubview(memberTableView) + memberTableView.snp.makeConstraints { + $0.top.equalTo(memberTitleLabel.snp.bottom).offset(20) + $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.height.equalTo(height) } - view.addSubview(secondFullDividerView) - secondFullDividerView.snp.makeConstraints { + contentView.addSubview(firstFullDividerView) + firstFullDividerView.snp.makeConstraints { + $0.top.equalTo(memberTableView.snp.bottom) $0.leading.trailing.equalToSuperview() - $0.bottom.equalTo(teamLeaveButton.snp.top).offset(-20) $0.height.equalTo(4) } - view.addSubview(invitationCodeLabel) - invitationCodeLabel.snp.makeConstraints { - $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.bottom.equalTo(secondFullDividerView.snp.top).offset(-20) - } - - view.addSubview(codeShareButton) + contentView.addSubview(codeShareButton) codeShareButton.snp.makeConstraints { - $0.centerY.equalTo(invitationCodeLabel.snp.centerY) + $0.top.equalTo(firstFullDividerView.snp.bottom).offset(20) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } - view.addSubview(firstFullDividerView) - firstFullDividerView.snp.makeConstraints { + contentView.addSubview(invitationCodeLabel) + invitationCodeLabel.snp.makeConstraints { + $0.centerY.equalTo(codeShareButton.snp.centerY) + $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + + contentView.addSubview(secondFullDividerView) + secondFullDividerView.snp.makeConstraints { + $0.top.equalTo(invitationCodeLabel.snp.bottom).offset(20) $0.leading.trailing.equalToSuperview() - $0.bottom.equalTo(invitationCodeLabel.snp.top).offset(-20) $0.height.equalTo(4) } - view.addSubview(memberCollectionView) - memberCollectionView.snp.makeConstraints { - $0.top.equalTo(dividerView.snp.bottom).offset(24) - $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.bottom.equalTo(firstFullDividerView.snp.top) + contentView.addSubview(teamLeaveButton) + teamLeaveButton.snp.makeConstraints { + $0.top.equalTo(secondFullDividerView.snp.bottom).offset(20) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + $0.bottom.equalToSuperview() } } From d7f403b71098c4ce8fdcd34431b749dab73c1fb5 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 17 Mar 2023 16:20:36 +0900 Subject: [PATCH 230/388] =?UTF-8?q?[CHORE]=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift | 2 ++ .../Home/TeamDetail/UIComponent/MemberInformationView.swift | 2 ++ .../Home/TeamDetail/UIComponent/TeamDetailMembersView.swift | 1 + 3 files changed, 5 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift index 88558eee..16d8aa37 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift @@ -30,6 +30,8 @@ final class TeamDetailMemberTableHeaderView: UITableViewHeaderFooterView { required init?(coder: NSCoder) { nil } + // MARK: - func + private func render() { self.addSubview(memberInformationView) memberInformationView.snp.makeConstraints { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift index f5125663..6a45158f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift @@ -47,6 +47,8 @@ final class MemberInformationView: UIView { required init?(coder: NSCoder) { nil } + // MARK: - func + private func render() { self.addSubview(profileImageView) profileImageView.snp.makeConstraints { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index 85695f8b..1b9cabfc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -11,6 +11,7 @@ import SnapKit final class TeamDetailMembersView: UIView { + // FIXME: - API연결 후 수정 let members: [String] = Array(repeating: "", count: 2) // MARK: - property From ff9e0050052ba21d8a7d012a329b13fcff31604c Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 17 Mar 2023 16:26:20 +0900 Subject: [PATCH 231/388] =?UTF-8?q?[CHORE]=20Property=20Size=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 24 +++++++++---------- .../UIComponent/TeamDetailMembersView.swift | 14 +++++++++-- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 1c912b43..46a7f787 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -11,15 +11,15 @@ import SnapKit final class TeamDetailViewController: BaseViewController { - private enum PropertySize { - static let headerViewHeight: CGFloat = 70 - static let cellSize: CGFloat = 46 - static let cellSpacing: CGFloat = 20 - static let navigationBarHeight: CGFloat = 44 - static let homeIndicatorHeight: CGFloat = 34 - static let tableViewTopProperty: CGFloat = 86 - static let tableViewBottomProperty: CGFloat = 120 - } +// private enum PropertySize { +// static let headerViewHeight: CGFloat = 70 +// static let cellSize: CGFloat = 46 +// static let cellSpacing: CGFloat = 20 +// static let navigationBarHeight: CGFloat = 44 +// static let homeIndicatorHeight: CGFloat = 34 +// static let tableViewTopProperty: CGFloat = 86 +// static let tableViewBottomProperty: CGFloat = 120 +// } // MARK: - property @@ -123,12 +123,12 @@ final class TeamDetailViewController: BaseViewController { $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) $0.height.equalTo(16) } - + let size = TeamDetailMembersView.PropertySize.self let topInset: CGFloat = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.size.height let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height let bottomInset: CGFloat = hasHomeIndicator ? 34 : 0 - let minHeight = view.frame.size.height - topInset - PropertySize.navigationBarHeight - PropertySize.tableViewTopProperty - PropertySize.tableViewBottomProperty - bottomInset - 60 - let currentHeight = (PropertySize.cellSize + PropertySize.cellSpacing) * CGFloat(memberTableView.members.count) + PropertySize.headerViewHeight + PropertySize.cellSpacing + let minHeight = view.frame.size.height - topInset - size.navigationBarHeight - size.tableViewTopProperty - size.tableViewBottomProperty - bottomInset - 60 + let currentHeight = (size.cellSize + size.cellSpacing) * CGFloat(memberTableView.members.count) + size.headerViewHeight + size.cellSpacing let height = max(minHeight, currentHeight) contentView.addSubview(memberTableView) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index 1b9cabfc..c4fbdb71 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -14,6 +14,16 @@ final class TeamDetailMembersView: UIView { // FIXME: - API연결 후 수정 let members: [String] = Array(repeating: "", count: 2) + enum PropertySize { + static let headerViewHeight: CGFloat = 70 + static let cellSize: CGFloat = 46 + static let cellSpacing: CGFloat = 20 + static let navigationBarHeight: CGFloat = 44 + static let homeIndicatorHeight: CGFloat = 34 + static let tableViewTopProperty: CGFloat = 86 + static let tableViewBottomProperty: CGFloat = 120 + } + // MARK: - property private let memberTableView: UITableView = { @@ -69,7 +79,7 @@ extension TeamDetailMembersView: UITableViewDataSource { } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return 66 + return PropertySize.cellSize + PropertySize.cellSpacing } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { @@ -78,6 +88,6 @@ extension TeamDetailMembersView: UITableViewDataSource { } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { - return 70 + 24 + return PropertySize.headerViewHeight + PropertySize.cellSpacing } } From d77a333c2cc2ab0486929ee6d5d480151842406b Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 17 Mar 2023 16:33:59 +0900 Subject: [PATCH 232/388] =?UTF-8?q?[CHORE]=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 46a7f787..ebb42a11 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -11,16 +11,6 @@ import SnapKit final class TeamDetailViewController: BaseViewController { -// private enum PropertySize { -// static let headerViewHeight: CGFloat = 70 -// static let cellSize: CGFloat = 46 -// static let cellSpacing: CGFloat = 20 -// static let navigationBarHeight: CGFloat = 44 -// static let homeIndicatorHeight: CGFloat = 34 -// static let tableViewTopProperty: CGFloat = 86 -// static let tableViewBottomProperty: CGFloat = 120 -// } - // MARK: - property private lazy var backButton = BackButton(type: .system) From 70f7d5e5d85a96bf7be1489faf8c5cdfb3f88606 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 17 Mar 2023 16:34:15 +0900 Subject: [PATCH 233/388] =?UTF-8?q?[CHORE]=20cell=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=ED=9A=A8=EA=B3=BC=20=EC=A0=9C=EA=B1=B0=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/UIComponent/TeamDetailMembersView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index c4fbdb71..53c553b0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -65,7 +65,6 @@ final class TeamDetailMembersView: UIView { // MARK: - extension extension TeamDetailMembersView: UITableViewDelegate { - } extension TeamDetailMembersView: UITableViewDataSource { @@ -75,6 +74,7 @@ extension TeamDetailMembersView: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: TeamDetailMemberTableViewCell.className, for: indexPath) as? TeamDetailMemberTableViewCell else { return UITableViewCell() } + cell.selectionStyle = .none return cell } From c6ef891214df7f825c08d33b1629b24d8e477bc5 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 22 Mar 2023 15:51:29 +0900 Subject: [PATCH 234/388] [CHORE] loading indicator added --- .../UIComponent/Button/MainButton.swift | 33 ++++++++++++++++++- .../JoinTeam/JoinTeamViewController.swift | 6 ++++ .../SetNicknameViewController.swift | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift index 858eaafd..744c7f5c 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift @@ -15,6 +15,12 @@ final class MainButton: UIButton { static let height: CGFloat = 54 } + var isLoading: Bool = false { + didSet { updateLoadingView() } + // 다른거 네이밍이 setup으로 시작되는데 + // didSet 다음에 오는거라면 update가 맞지 않을까? + } + var title: String? { didSet { setupAttribute() } } @@ -23,6 +29,8 @@ final class MainButton: UIButton { didSet { setupAttribute() } } + private var spinner = UIActivityIndicatorView() + // MARK: - life cycle override init(frame: CGRect) { @@ -41,6 +49,7 @@ final class MainButton: UIButton { setTitleColor(.white, for: .disabled) setBackgroundColor(.blue200, for: .normal) setBackgroundColor(.gray200, for: .disabled) + configLoadingIndicator() } private func render() { @@ -48,6 +57,11 @@ final class MainButton: UIButton { $0.width.equalTo(Size.width) $0.height.equalTo(Size.height) } + + self.addSubview(spinner) + spinner.snp.makeConstraints { + $0.center.equalTo(self.snp.center) + } } // MARK: - func @@ -56,7 +70,24 @@ final class MainButton: UIButton { if let title = title { setTitle(title, for: .normal) } - isEnabled = !isDisabled } + + private func configLoadingIndicator() { + spinner.hidesWhenStopped = true + spinner.color = .gray600 + spinner.style = .medium + } + + func updateLoadingView() { + if isLoading { + spinner.startAnimating() + titleLabel?.alpha = 0 + isEnabled = false + } else { + spinner.stopAnimating() + titleLabel?.alpha = 1 + isEnabled = true + } + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index a0bac7c8..08baa090 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -89,6 +89,11 @@ final class JoinTeamViewController: BaseTextFieldViewController { setupSkipButton() } + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + doneButton.isLoading = false + } + override func render() { super.render() @@ -118,6 +123,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { private func setupDoneButton() { let action = UIAction { [weak self] _ in guard let invitationCode = self?.kigoTextField.text else { return } + self?.doneButton.isLoading = true self?.fetchCertainTeam(type: .fetchCertainTeam(invitationCode: invitationCode)) } super.doneButton.addAction(action, for: .touchUpInside) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 0a614c2f..ddf3fe02 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -100,6 +100,7 @@ final class SetNicknameViewController: BaseViewController { button.isDisabled = true let action = UIAction { [weak self] _ in self?.didTappedDoneButton() + button.isLoading = true } button.addAction(action, for: .touchUpInside) return button From 9abb9f3cf50ab3215a2380d9cd9523ec6b5b5359 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 22 Mar 2023 15:59:07 +0900 Subject: [PATCH 235/388] =?UTF-8?q?[CHORE]=20=EC=9E=90=EC=9E=98=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95=20(#323)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index ddf3fe02..ac362e2a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -114,6 +114,11 @@ final class SetNicknameViewController: BaseViewController { setupNotificationCenter() } + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + doneButton.isLoading = false + } + override func render() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { From e694df640bad44c162679395b188d91fd5551787 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 22 Mar 2023 16:45:00 +0900 Subject: [PATCH 236/388] =?UTF-8?q?[CHORE]=20=EC=9E=90=EC=9E=98=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD=20(#323)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/CreateTeam/CreateTeamViewController.swift | 6 ++++++ .../Screen/Setup/JoinTeam/JoinTeamViewController.swift | 1 + 2 files changed, 7 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index f0c9a4b4..7e7ec455 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -70,6 +70,11 @@ final class CreateTeamViewController: BaseTextFieldViewController { setupDoneButton() } + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + doneButton.isLoading = false + } + override func setupNavigationBar() { super.setupNavigationBar() @@ -84,6 +89,7 @@ final class CreateTeamViewController: BaseTextFieldViewController { private func setupDoneButton() { let action = UIAction { [weak self] _ in + self?.doneButton.isLoading = true if let teamName = self?.kigoTextField.text { if teamName.hasSpecialCharacters() { DispatchQueue.main.async { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index 08baa090..c971b339 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -178,6 +178,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { } else { DispatchQueue.main.async { self.makeAlert(title: TextLiteral.joinTeamViewControllerAlertTitle, message: TextLiteral.joinTeamViewControllerAlertMessage) + self.doneButton.isLoading = false } } } From a2584bc7cd4d2735d1bd925f29a742c40ef6c933 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Mon, 27 Mar 2023 16:32:41 +0900 Subject: [PATCH 237/388] =?UTF-8?q?[CHORE]=20=EC=9E=90=EC=9E=98=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/UIComponent/Button/MainButton.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift index 744c7f5c..965e2597 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift @@ -17,8 +17,6 @@ final class MainButton: UIButton { var isLoading: Bool = false { didSet { updateLoadingView() } - // 다른거 네이밍이 setup으로 시작되는데 - // didSet 다음에 오는거라면 update가 맞지 않을까? } var title: String? { @@ -79,7 +77,7 @@ final class MainButton: UIButton { spinner.style = .medium } - func updateLoadingView() { + private func updateLoadingView() { if isLoading { spinner.startAnimating() titleLabel?.alpha = 0 From 753e032f93ac069524c096a24f7f9e4286eb84ab Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 29 Mar 2023 20:26:34 +0900 Subject: [PATCH 238/388] =?UTF-8?q?[ADD]=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=ED=9A=8C=EC=A0=84=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0!(#?= =?UTF-8?q?311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 +++ .../Global/Extension/UIImage+Extension.swift | 25 +++++++++++++++++++ .../SetNicknameViewController.swift | 10 ++++---- 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Extension/UIImage+Extension.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 9f8354a6..4ea158ad 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -110,6 +110,7 @@ 3EDED995293C81EC0000B4DC /* AddFeedbackKeywordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EDED994293C81EC0000B4DC /* AddFeedbackKeywordViewController.swift */; }; 520FEC44292234C0009FC1F2 /* FeedbackToMeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 520FEC43292234C0009FC1F2 /* FeedbackToMeModel.swift */; }; 522D99BF29041B51009CBD95 /* CustomTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522D99BE29041B51009CBD95 /* CustomTextView.swift */; }; + 523EDFB329D451590033F9A5 /* UIImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 523EDFB229D451590033F9A5 /* UIImage+Extension.swift */; }; 525E721A28FF0F1900EF3FCB /* MemberCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525E721928FF0F1900EF3FCB /* MemberCollectionViewCell.swift */; }; 525E721C28FF0F5B00EF3FCB /* MemberCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525E721B28FF0F5B00EF3FCB /* MemberCollectionView.swift */; }; 525E722128FFC9A800EF3FCB /* BackButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525E722028FFC9A800EF3FCB /* BackButton.swift */; }; @@ -249,6 +250,7 @@ 3EDED994293C81EC0000B4DC /* AddFeedbackKeywordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedbackKeywordViewController.swift; sourceTree = ""; }; 520FEC43292234C0009FC1F2 /* FeedbackToMeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackToMeModel.swift; sourceTree = ""; }; 522D99BE29041B51009CBD95 /* CustomTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextView.swift; sourceTree = ""; }; + 523EDFB229D451590033F9A5 /* UIImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extension.swift"; sourceTree = ""; }; 525E721928FF0F1900EF3FCB /* MemberCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberCollectionViewCell.swift; sourceTree = ""; }; 525E721B28FF0F5B00EF3FCB /* MemberCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberCollectionView.swift; sourceTree = ""; }; 525E722028FFC9A800EF3FCB /* BackButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackButton.swift; sourceTree = ""; }; @@ -434,6 +436,7 @@ 3EB508912917585600FB77CB /* UICollectionView + Extension.swift */, 7E7F160E2921CD4A00C6BE96 /* UITabBar+Extension.swift */, 3EA341E72925E5EA005CBD1C /* String+Extension.swift */, + 523EDFB229D451590033F9A5 /* UIImage+Extension.swift */, ); path = Extension; sourceTree = ""; @@ -1144,6 +1147,7 @@ 3EB50866291350BB00FB77CB /* TotalReflectionCell.swift in Sources */, 7E7F160B2921CC4800C6BE96 /* CustomTabBarController.swift in Sources */, 395C7E1D28FEC8C400FC2FCA /* CloseButton.swift in Sources */, + 523EDFB329D451590033F9A5 /* UIImage+Extension.swift in Sources */, 39F52C572923317500B19A77 /* CreateTeamResponse.swift in Sources */, 398474222925CF4800EDC139 /* TeamInfoResponse.swift in Sources */, 3EDED995293C81EC0000B4DC /* AddFeedbackKeywordViewController.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIImage+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImage+Extension.swift new file mode 100644 index 00000000..13930496 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIImage+Extension.swift @@ -0,0 +1,25 @@ +// +// UIImage+Extension.swift +// Maddori.Apple +// +// Created by 김유나 on 2023/03/29. +// + +import UIKit + +extension UIImage { + func fixOrientation() -> UIImage { + if (self.imageOrientation == .up) { + return self + } + UIGraphicsBeginImageContextWithOptions(self.size, false, self.scale) + + let rect = CGRect(x: 0, y: 0, width: self.size.width, height: self.size.height) + self.draw(in: rect) + + let normalizedImage = UIGraphicsGetImageFromCurrentImageContext()! + UIGraphicsEndImageContext() + + return normalizedImage + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index b69e1f6d..ef9271a9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -466,11 +466,11 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { let itemProvider = results.first?.itemProvider if let itemProvider = itemProvider, itemProvider.canLoadObject(ofClass: UIImage.self) { itemProvider.loadObject(ofClass: UIImage.self) { (image, error) in + guard let profileImage = image as? UIImage else { return } DispatchQueue.main.async { - self.profileImageButton.profileImage.image = image as? UIImage + self.profileImageButton.profileImage.image = profileImage.fixOrientation() } - guard let profileImage = image as? UIImage else { return } - let cropImage = self.cropSquare(profileImage) + let cropImage = self.cropSquare(profileImage.fixOrientation()) if let data = cropImage?.pngData() { let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] let url = documents.appendingPathComponent(".png") @@ -495,9 +495,9 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate, UINavigati if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { DispatchQueue.main.async { - self.profileImageButton.profileImage.image = image + self.profileImageButton.profileImage.image = image.fixOrientation() } - let cropImage = self.cropSquare(image) + let cropImage = self.cropSquare(image.fixOrientation()) if let data = cropImage?.pngData() { let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] let url = documents.appendingPathComponent(".png") From 9b4fd8c704ad1fd11fea01f26104aa4f152525cc Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 29 Mar 2023 20:32:41 +0900 Subject: [PATCH 239/388] =?UTF-8?q?[ADD]=20image=20crop=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=82=AD=EC=A0=9C(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index ef9271a9..09b0337b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -334,20 +334,6 @@ final class SetNicknameViewController: BaseViewController { } } - private func cropSquare(_ image: UIImage) -> UIImage? { - let imageSize = image.size - let shortLength = imageSize.width < imageSize.height ? imageSize.width : imageSize.height - print(imageSize.width, imageSize.height, shortLength) - let origin = CGPoint( - x: imageSize.width / 2 - shortLength / 2, - y: imageSize.height / 2 - shortLength / 2 - ) - let size = CGSize(width: shortLength, height: shortLength) - let square = CGRect(origin: origin, size: size) - guard let squareImage = image.cgImage?.cropping(to: square) else { return nil } - return UIImage(cgImage: squareImage, scale: shortLength, orientation: .up) - } - // MARK: - selector @objc private func keyboardWillShow(notification: NSNotification) { @@ -470,8 +456,7 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { DispatchQueue.main.async { self.profileImageButton.profileImage.image = profileImage.fixOrientation() } - let cropImage = self.cropSquare(profileImage.fixOrientation()) - if let data = cropImage?.pngData() { + if let data = profileImage.fixOrientation().pngData() { let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] let url = documents.appendingPathComponent(".png") do { @@ -497,8 +482,7 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate, UINavigati DispatchQueue.main.async { self.profileImageButton.profileImage.image = image.fixOrientation() } - let cropImage = self.cropSquare(image.fixOrientation()) - if let data = cropImage?.pngData() { + if let data = image.fixOrientation().pngData() { let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] let url = documents.appendingPathComponent(".png") do { From a27ce7703ec119ce5cc73aca8656b871e40e5a8f Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 29 Mar 2023 20:57:24 +0900 Subject: [PATCH 240/388] =?UTF-8?q?[ADD]=20prepareForReuse=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReflectionMemberCollectionViewCell.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift index f4ccc653..f5ccc46a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionViewCell.swift @@ -68,6 +68,22 @@ final class ReflectionMemberCollectionViewCell: BaseCollectionViewCell { self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 2) } + override func prepareForReuse() { + if isSelected { + self.backgroundColor = .white100 + self.profileImage.layer.opacity = 0.5 + self.nicknameLabel.textColor = .gray300 + self.roleLabel.textColor = .gray300 + self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 1) + } else { + self.backgroundColor = .white300 + self.profileImage.layer.opacity = 1 + self.nicknameLabel.textColor = .gray600 + self.roleLabel.textColor = .gray400 + self.makeShadow(color: .black, opacity: 0.2, offset: CGSize.zero, radius: 2) + } + } + // MARK: - func func applySelectedAttribute() { From 6f9b89bb626aeaeef3ca627857c9bd9d2751cb64 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 30 Mar 2023 12:51:08 +0900 Subject: [PATCH 241/388] =?UTF-8?q?[CHORE]=20=EC=BC=80=EB=AF=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81(#323)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/CreateTeam/CreateTeamViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index 7e7ec455..c282adf8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -96,6 +96,7 @@ final class CreateTeamViewController: BaseTextFieldViewController { self?.makeAlert(title: TextLiteral.createTeamViewControllerAlertTitle, message: TextLiteral.createTeamViewControllerAlertMessage) } } else { + self?.doneButton.isLoading = true UserDefaultHandler.setTeamName(teamName: teamName) self?.pushSetNicknameViewController() } From f1d7be61e2f8f7b22472ec0aea6eff2fec4ff539 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 30 Mar 2023 12:52:34 +0900 Subject: [PATCH 242/388] =?UTF-8?q?[CHORE]=20=EC=BC=80=EB=AF=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81(#323)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/UIComponent/Button/MainButton.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift index 965e2597..83f353bd 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift @@ -27,7 +27,7 @@ final class MainButton: UIButton { didSet { setupAttribute() } } - private var spinner = UIActivityIndicatorView() + lazy private var spinner = UIActivityIndicatorView() // MARK: - life cycle From 2c492a681f15e57e550b32a8b6c680d722dd1bf7 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Thu, 30 Mar 2023 13:08:07 +0900 Subject: [PATCH 243/388] =?UTF-8?q?[CHORE]=20=EC=BC=80=EB=AF=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#3?= =?UTF-8?q?23)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/CreateTeam/CreateTeamViewController.swift | 2 +- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index c282adf8..7dff520a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -94,9 +94,9 @@ final class CreateTeamViewController: BaseTextFieldViewController { if teamName.hasSpecialCharacters() { DispatchQueue.main.async { self?.makeAlert(title: TextLiteral.createTeamViewControllerAlertTitle, message: TextLiteral.createTeamViewControllerAlertMessage) + self?.doneButton.isLoading = false } } else { - self?.doneButton.isLoading = true UserDefaultHandler.setTeamName(teamName: teamName) self?.pushSetNicknameViewController() } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index ac362e2a..7f2afc1b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -354,6 +354,7 @@ final class SetNicknameViewController: BaseViewController { } else { DispatchQueue.main.async { self.makeAlert(title: TextLiteral.setNicknameViewControllerCreateTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) + self.doneButton.isLoading = false } } } @@ -379,6 +380,7 @@ final class SetNicknameViewController: BaseViewController { } else { DispatchQueue.main.async { self.makeAlert(title: TextLiteral.setNicknameViewControllerJoinTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) + self.doneButton.isLoading = false } } } From 73b3fda16d2cfc5eea76403a578096b331d4b14e Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 30 Mar 2023 15:16:38 +0900 Subject: [PATCH 244/388] =?UTF-8?q?[CHORE]=20=EB=B7=B0=20=EC=BB=A8?= =?UTF-8?q?=ED=8A=B8=EB=A1=A4=EB=9F=AC=20=EC=97=B0=EA=B2=B0=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 93d5f5b5..543b1468 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -142,7 +142,7 @@ final class TeamManageViewController: BaseViewController { // print("새로운 팀 합류하기") let rootView = presentingViewController dismiss(animated: true) { - let joinViewController = JoinTeamViewController() + let joinViewController = UINavigationController(rootViewController: CreateTeamViewController()) joinViewController.modalPresentationStyle = .fullScreen rootView?.present(joinViewController, animated: true) } From cc2c833648e51431645a8303c64e5a679f20a245 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 30 Mar 2023 15:18:06 +0900 Subject: [PATCH 245/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20-=20=EB=B9=88=20=EC=A4=84=20?= =?UTF-8?q?=EC=97=86=EC=95=A0=EA=B8=B0=20(#280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 1baa90b3..401b3c60 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -84,7 +84,6 @@ final class ChangeTeamView: UIView { $0.height.equalToSuperview() } } - } extension ChangeTeamView: UICollectionViewDataSource { @@ -104,6 +103,5 @@ extension ChangeTeamView: UICollectionViewDelegate { // MARK: - FIXME let selectedTeamName = teamDataDummy[indexPath.item] print(selectedTeamName) - } } From a29a969815f2ebb826b700a916537526115fd797 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 15:45:33 +0900 Subject: [PATCH 246/388] =?UTF-8?q?[CHORE]=20TeamDetail=20Endpoint=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++ .../Network/EndPoint/TeamDetailEndPoint.swift | 44 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 74c79a1a..3e8e4d8b 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; 391D38DB29C449DE00A6BFED /* TeamDetailMemberTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D38DA29C449DE00A6BFED /* TeamDetailMemberTableViewCell.swift */; }; 391D38DD29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D38DC29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift */; }; + 391D38F529D54CBA00A6BFED /* TeamDetailEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D38F429D54CBA00A6BFED /* TeamDetailEndPoint.swift */; }; 39257DC528F8FEBD00201E0B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DC428F8FEBD00201E0B /* AppDelegate.swift */; }; 39257DC728F8FEBD00201E0B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DC628F8FEBD00201E0B /* SceneDelegate.swift */; }; 39257DCE28F8FEBE00201E0B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 39257DCD28F8FEBE00201E0B /* Assets.xcassets */; }; @@ -166,6 +167,7 @@ 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; 391D38DA29C449DE00A6BFED /* TeamDetailMemberTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMemberTableViewCell.swift; sourceTree = ""; }; 391D38DC29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailMemberTableHeaderView.swift; sourceTree = ""; }; + 391D38F429D54CBA00A6BFED /* TeamDetailEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailEndPoint.swift; sourceTree = ""; }; 39257DC128F8FEBD00201E0B /* Maddori.Apple.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Maddori.Apple.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39257DC428F8FEBD00201E0B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39257DC628F8FEBD00201E0B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -760,6 +762,7 @@ 7EE38BB2292623F500FD738D /* MyReflectionEndPoint.swift */, 3EA341E52924E2AD005CBD1C /* HomeEndPoint.swift */, 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */, + 391D38F429D54CBA00A6BFED /* TeamDetailEndPoint.swift */, ); path = EndPoint; sourceTree = ""; @@ -1271,6 +1274,7 @@ D7AFB7C32916EAB100E998B7 /* MyReflectionDetailViewController.swift in Sources */, 39F52C632923357700B19A77 /* FeedBackInfoResponse.swift in Sources */, 39F52C5D292332EA00B19A77 /* AddReflectionResponse.swift in Sources */, + 391D38F529D54CBA00A6BFED /* TeamDetailEndPoint.swift in Sources */, 3960864129811E3C003AB4F8 /* TeamDetailViewController.swift in Sources */, D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */, 39257DF328F93D8900201E0B /* TextLiteral.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift new file mode 100644 index 00000000..837a8991 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -0,0 +1,44 @@ +// +// TeamDetailEndPoint.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/03/30. +// + +import Alamofire + +enum TeamDetailEndPoint: EndPointable { + case fetchTeamMember + + var address: String { + switch self { + case .fetchTeamMember: + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members" + } + } + + var method: Alamofire.HTTPMethod { + switch self { + case .fetchTeamMember: + return .get + } + } + + var body: T? { + switch self { + case .fetchTeamMember: + return nil + } + } + + var headers: Alamofire.HTTPHeaders? { + switch self { + case .fetchTeamMember: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)" + ] + return HTTPHeaders(headers) + } + } +} From b11f93f47287d4b1058d24d66c49315ebb2a53bc Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 15:53:02 +0900 Subject: [PATCH 247/388] =?UTF-8?q?[CHORE]=20TableView=20cell=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cell/TeamDetailMemberTableHeaderView.swift | 2 +- .../Cell/TeamDetailMemberTableViewCell.swift | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift index 16d8aa37..cdd4dda9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift @@ -13,7 +13,7 @@ final class TeamDetailMemberTableHeaderView: UITableViewHeaderFooterView { // MARK: - property - private let memberInformationView = MemberInformationView(nickname: "이드", role: "디자인 리드 / 개발자") + private let memberInformationView = MemberInformationView() private let dividerView: UIView = { let view = UIView() view.layer.borderWidth = 0.5 diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift index 111cc4f5..51c16934 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift @@ -11,9 +11,7 @@ import SnapKit final class TeamDetailMemberTableViewCell: BaseTableViewCell { - // MARK: - property - - private let memberInfoView = MemberInformationView(nickname: "nickname test", role: "role test") + private let memberInfoView = MemberInformationView() // MARK: - life cycle @@ -23,4 +21,11 @@ final class TeamDetailMemberTableViewCell: BaseTableViewCell { $0.edges.equalToSuperview() } } + + // MARK: - func + + func setupLayoutInfoView(nickname: String, role: String) { + memberInfoView.profileNicknameLabel.text = nickname + memberInfoView.profileRoleLabel.text = role + } } From 7e5b76d1353208b82586fa9f5926f0c9381e52b6 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 15:53:49 +0900 Subject: [PATCH 248/388] =?UTF-8?q?[CHORE]=20MemberInfoView=20=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=20=EC=A0=9C=EC=96=B4=20=EC=88=98=EC=A0=95=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIComponent/MemberInformationView.swift | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift index 6a45158f..0c4844fc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift @@ -10,27 +10,23 @@ import UIKit import SnapKit final class MemberInformationView: UIView { - let nickname: String - let role: String // MARK: - property - private let profileImageView: UIImageView = { + let profileImageView: UIImageView = { let imageView = UIImageView() imageView.layer.cornerRadius = 23 imageView.image = ImageLiterals.imgProfileNone return imageView }() - private lazy var profileNicknameLabel: UILabel = { + let profileNicknameLabel: UILabel = { let label = UILabel() - label.text = nickname label.font = .label2 label.textColor = .gray600 return label }() - private lazy var profileRoleLabel: UILabel = { + let profileRoleLabel: UILabel = { let label = UILabel() - label.text = role label.font = .caption2 label.textColor = .gray400 return label @@ -38,10 +34,8 @@ final class MemberInformationView: UIView { // MARK: - life cycle - init(nickname: String, role: String) { - self.nickname = nickname - self.role = role - super.init(frame: .zero) + override init(frame: CGRect) { + super.init(frame: frame) render() } From 65ad376a41323ffecf35fcf048df45badd42f50d Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 15:54:05 +0900 Subject: [PATCH 249/388] =?UTF-8?q?[FEAT]=20API=20=ED=86=B5=EC=8B=A0=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 36 +++++++++++++++++-- .../UIComponent/TeamDetailMembersView.swift | 11 +++++- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index ebb42a11..abb9c043 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -7,6 +7,7 @@ import UIKit +import Alamofire import SnapKit final class TeamDetailViewController: BaseViewController { @@ -72,6 +73,7 @@ final class TeamDetailViewController: BaseViewController { setupBackButton() setupEditButton() setupExitButton() + fetchTeamDetailMember(type: .fetchTeamMember) } override func configUI() { @@ -118,14 +120,12 @@ final class TeamDetailViewController: BaseViewController { let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height let bottomInset: CGFloat = hasHomeIndicator ? 34 : 0 let minHeight = view.frame.size.height - topInset - size.navigationBarHeight - size.tableViewTopProperty - size.tableViewBottomProperty - bottomInset - 60 - let currentHeight = (size.cellSize + size.cellSpacing) * CGFloat(memberTableView.members.count) + size.headerViewHeight + size.cellSpacing - let height = max(minHeight, currentHeight) contentView.addSubview(memberTableView) memberTableView.snp.makeConstraints { $0.top.equalTo(memberTitleLabel.snp.bottom).offset(20) $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.height.equalTo(height) + $0.height.equalTo(minHeight) } contentView.addSubview(firstFullDividerView) @@ -203,4 +203,34 @@ final class TeamDetailViewController: BaseViewController { } teamLeaveButton.addAction(action, for: .touchUpInside) } + + private func updateLayout() { + let size = TeamDetailMembersView.PropertySize.self + let topInset: CGFloat = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.size.height + let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height + let bottomInset: CGFloat = hasHomeIndicator ? 34 : 0 + let minHeight = view.frame.size.height - topInset - size.navigationBarHeight - size.tableViewTopProperty - size.tableViewBottomProperty - bottomInset - 60 + let currentHeight = (size.cellSize + size.cellSpacing) * CGFloat(memberTableView.members.count) + size.headerViewHeight + size.cellSpacing + let height = max(minHeight, currentHeight) + + memberTableView.snp.updateConstraints { + $0.height.equalTo(height) + } + } + + // MARK: - api + + private func fetchTeamDetailMember(type: TeamDetailEndPoint) { + AF.request(type.address, + method: type.method, + headers: type.headers).responseDecodable(of: BaseModel.self) { json in + if let json = json.value { + guard let members = json.detail?.members else { return } + self.memberTableView.loadData(data: members) + DispatchQueue.main.async { + self.updateLayout() + } + } + } + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index 53c553b0..4345ed00 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -12,7 +12,7 @@ import SnapKit final class TeamDetailMembersView: UIView { // FIXME: - API연결 후 수정 - let members: [String] = Array(repeating: "", count: 2) + var members: [MemberDetailResponse] = [] enum PropertySize { static let headerViewHeight: CGFloat = 70 @@ -60,6 +60,11 @@ final class TeamDetailMembersView: UIView { memberTableView.delegate = self memberTableView.dataSource = self } + + func loadData(data: [MemberDetailResponse]) { + self.members = data + memberTableView.reloadData() + } } // MARK: - extension @@ -74,6 +79,10 @@ extension TeamDetailMembersView: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: TeamDetailMemberTableViewCell.className, for: indexPath) as? TeamDetailMemberTableViewCell else { return UITableViewCell() } + if let username = members[indexPath.item].userName, + let role = members[indexPath.item].role { + cell.setupLayoutInfoView(nickname: username, role: role) + } cell.selectionStyle = .none return cell } From 5c6c56f1c0a1763bf72ab6c7d49f011c0bfea160 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 17:14:45 +0900 Subject: [PATCH 250/388] =?UTF-8?q?[CHORE]=20TeamDetail=20HeaderView=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=ED=95=A8=EC=88=98=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift | 8 ++++++++ .../TeamDetail/UIComponent/MemberInformationView.swift | 1 + 2 files changed, 9 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift index cdd4dda9..c16da8bb 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift @@ -46,4 +46,12 @@ final class TeamDetailMemberTableHeaderView: UITableViewHeaderFooterView { $0.height.equalTo(1) } } + + func setupMemberInfoView(nickname: String, role: String, imagePath: String?) { + memberInformationView.profileNicknameLabel.text = nickname + memberInformationView.profileRoleLabel.text = role + if let imagePath { + memberInformationView.profileImageView.load(from: UrlLiteral.iamgeBaseUrl + imagePath) + } + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift index 0c4844fc..78b0bf64 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/MemberInformationView.swift @@ -16,6 +16,7 @@ final class MemberInformationView: UIView { let profileImageView: UIImageView = { let imageView = UIImageView() imageView.layer.cornerRadius = 23 + imageView.clipsToBounds = true imageView.image = ImageLiterals.imgProfileNone return imageView }() From ee4d9f6e9da627285c3255dda403a4eb8e09fa24 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 17:15:16 +0900 Subject: [PATCH 251/388] =?UTF-8?q?[CHORE]=20=EB=82=B4=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=B7=B0=EC=97=90=20=EA=B7=B8=EB=A6=AC=EB=8A=94=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIComponent/TeamDetailMembersView.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index 4345ed00..a0d0d936 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -13,6 +13,7 @@ final class TeamDetailMembersView: UIView { // FIXME: - API연결 후 수정 var members: [MemberDetailResponse] = [] + var currentMember: MemberDetailResponse? enum PropertySize { static let headerViewHeight: CGFloat = 70 @@ -62,7 +63,13 @@ final class TeamDetailMembersView: UIView { } func loadData(data: [MemberDetailResponse]) { - self.members = data + data.forEach { + if $0.userId == UserDefaultStorage.userId { + currentMember = $0 + } else { + members.append($0) + } + } memberTableView.reloadData() } } @@ -93,6 +100,9 @@ extension TeamDetailMembersView: UITableViewDataSource { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { guard let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: TeamDetailMemberTableHeaderView.className) as? TeamDetailMemberTableHeaderView else { return UITableViewHeaderFooterView() } + headerView.setupMemberInfoView(nickname: currentMember?.userName ?? UserDefaultStorage.nickname, + role: currentMember?.role ?? "", + imagePath: currentMember?.profileImagePath ?? "") return headerView } From 3fe448da07661bfc8cbf0da604fe9ce68868e0e5 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 17:15:35 +0900 Subject: [PATCH 252/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A0=95=EB=B3=B4=20API=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index abb9c043..6fca4e26 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -19,8 +19,7 @@ final class TeamDetailViewController: BaseViewController { let label = UILabel() label.font = .title label.textColor = .black100 - // FIXME: - API 연결 후 삭제 - label.text = "맛쟁이 사과처럼" + label.text = UserDefaultStorage.teamName return label }() private let editButton: UIButton = { @@ -226,8 +225,8 @@ final class TeamDetailViewController: BaseViewController { headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let json = json.value { guard let members = json.detail?.members else { return } - self.memberTableView.loadData(data: members) DispatchQueue.main.async { + self.memberTableView.loadData(data: members) self.updateLayout() } } From ff8d8e90b36534195f656abf00602f31059268f3 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 17:21:19 +0900 Subject: [PATCH 253/388] =?UTF-8?q?[CHORE]=20TeamDetail=20Cell=EC=97=90=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=B6=94=EA=B0=80=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift | 5 ++++- .../Home/TeamDetail/UIComponent/TeamDetailMembersView.swift | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift index 51c16934..a932f95e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift @@ -24,8 +24,11 @@ final class TeamDetailMemberTableViewCell: BaseTableViewCell { // MARK: - func - func setupLayoutInfoView(nickname: String, role: String) { + func setupLayoutInfoView(nickname: String, role: String, imagePath: String?) { memberInfoView.profileNicknameLabel.text = nickname memberInfoView.profileRoleLabel.text = role + if let imagePath { + memberInfoView.profileImageView.load(from: UrlLiteral.iamgeBaseUrl + imagePath) + } } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index a0d0d936..c534f6dc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -86,9 +86,8 @@ extension TeamDetailMembersView: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: TeamDetailMemberTableViewCell.className, for: indexPath) as? TeamDetailMemberTableViewCell else { return UITableViewCell() } - if let username = members[indexPath.item].userName, - let role = members[indexPath.item].role { - cell.setupLayoutInfoView(nickname: username, role: role) + if let username = members[indexPath.item].userName { + cell.setupLayoutInfoView(nickname: username, role: members[indexPath.item].role ?? "", imagePath: members[indexPath.item].profileImagePath) } cell.selectionStyle = .none return cell From f29afaa8434eb4aa337bd33408cd5e1af9d7540a Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 17:48:05 +0900 Subject: [PATCH 254/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20API=20=EC=B6=94=EA=B0=80=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamDetailEndPoint.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift index 837a8991..326fe98b 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -9,11 +9,15 @@ import Alamofire enum TeamDetailEndPoint: EndPointable { case fetchTeamMember + case fetchTeamInformation var address: String { switch self { case .fetchTeamMember: return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/members" + + case .fetchTeamInformation: + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)" } } @@ -21,6 +25,9 @@ enum TeamDetailEndPoint: EndPointable { switch self { case .fetchTeamMember: return .get + + case .fetchTeamInformation: + return .get } } @@ -28,6 +35,9 @@ enum TeamDetailEndPoint: EndPointable { switch self { case .fetchTeamMember: return nil + + case .fetchTeamInformation: + return nil } } @@ -39,6 +49,13 @@ enum TeamDetailEndPoint: EndPointable { "refresh_token": "\(UserDefaultStorage.refreshToken)" ] return HTTPHeaders(headers) + + case .fetchTeamInformation: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)" + ] + return HTTPHeaders(headers) } } } From 4c1ec1f1d2d61e10d1b039410d014b48fcc5d9fc Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 17:48:44 +0900 Subject: [PATCH 255/388] =?UTF-8?q?[FEAT]=20=ED=8C=80=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 6fca4e26..d0211ab9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -11,6 +11,7 @@ import Alamofire import SnapKit final class TeamDetailViewController: BaseViewController { + private var invitationCode: String? // MARK: - property @@ -72,7 +73,9 @@ final class TeamDetailViewController: BaseViewController { setupBackButton() setupEditButton() setupExitButton() + setupCodeShareButton() fetchTeamDetailMember(type: .fetchTeamMember) + fetchTeamInformation(type: .fetchTeamInformation) } override func configUI() { @@ -203,6 +206,14 @@ final class TeamDetailViewController: BaseViewController { teamLeaveButton.addAction(action, for: .touchUpInside) } + private func setupCodeShareButton() { + let action = UIAction { [weak self] _ in + print(self?.invitationCode) + UIPasteboard.general.string = self?.invitationCode + } + codeShareButton.addAction(action, for: .touchUpInside) + } + private func updateLayout() { let size = TeamDetailMembersView.PropertySize.self let topInset: CGFloat = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.size.height @@ -223,8 +234,8 @@ final class TeamDetailViewController: BaseViewController { AF.request(type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in - if let json = json.value { - guard let members = json.detail?.members else { return } + if let data = json.value { + guard let members = data.detail?.members else { return } DispatchQueue.main.async { self.memberTableView.loadData(data: members) self.updateLayout() @@ -232,4 +243,20 @@ final class TeamDetailViewController: BaseViewController { } } } + + private func fetchTeamInformation(type: TeamDetailEndPoint) { + AF.request(type.address, + method: type.method, + headers: type.headers).responseDecodable(of: BaseModel.self) { json in + if let data = json.value { + guard let teamName = data.detail?.teamName, + let invitationCode = data.detail?.invitationCode + else { return } + self.invitationCode = invitationCode + DispatchQueue.main.async { + self.titleLabel.text = teamName + } + } + } + } } From 86a9457926443f438fbfbbde656a084eb2a421ea Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 30 Mar 2023 21:02:00 +0900 Subject: [PATCH 256/388] =?UTF-8?q?[FEAT]=20=ED=98=84=EC=9E=AC=20=ED=8C=80?= =?UTF-8?q?=20=ED=85=8C=EB=91=90=EB=A6=AC=20=EC=84=A4=EC=A0=95=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 9 ++--- .../Home/Home/TeamManageViewController.swift | 33 +++++++++---------- .../Home/UIComponent/ChangeTeamView.swift | 7 ++++ .../TeamChangeCollectionViewCell.swift | 10 +----- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 63923108..c61f2b08 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -30,6 +30,7 @@ final class HomeViewController: BaseViewController { var reflectionDate: String = "" var isAdmin: Bool = false + var currentTeamId: Int = 0 // MARK: - property @@ -157,9 +158,7 @@ final class HomeViewController: BaseViewController { // MARK: - func private func presentTeamModal() { -// guard let navigationController = self.navigationController else { return } -// let teamViewController = TeamManageViewController(navigationController: navigationController) - let teamViewController = TeamManageViewController() + let teamViewController = TeamManageViewController(teamId: currentTeamId) teamViewController.modalPresentationStyle = .pageSheet @@ -289,9 +288,11 @@ final class HomeViewController: BaseViewController { ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { guard let isAdmin = json.detail?.admin, - let teamName = json.detail?.teamName + let teamName = json.detail?.teamName, + let teamId = json.detail?.teamId else { return } self.isAdmin = isAdmin + self.currentTeamId = teamId DispatchQueue.main.async { self.teamButton.setTitle(teamName + " ", for: .normal) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 543b1468..296e4ecc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -26,8 +26,6 @@ final class TeamManageViewController: BaseViewController { } } } - // MARK: - 1 - // var navigation: UINavigationController? // MARK: - property @@ -51,17 +49,18 @@ final class TeamManageViewController: BaseViewController { private let scrollView: UIScrollView = UIScrollView() private let contentView: UIView = UIView() + private var currentTeamId: Int + // MARK: - life cycle - // MARK: - 1 -// required init(navigationController: UINavigationController?) { -// navigation = navigationController -// super.init() -// } -// -// required init?(coder: NSCoder) { -// fatalError("init(coder:) has not been implemented") -// } + init(teamId: Int) { + self.currentTeamId = teamId + super.init() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } override func viewDidLoad() { super.viewDidLoad() @@ -112,6 +111,10 @@ final class TeamManageViewController: BaseViewController { // MARK: - func + private func setCurrentTeam() { + changeTeamView.currentTeamId = currentTeamId + } + private func setupDelegate() { settingTableView.delegate = self settingTableView.dataSource = self @@ -133,13 +136,6 @@ final class TeamManageViewController: BaseViewController { } private func joinNewTeam() { - // FIXME: api 연결 - // MARK: - 1 -// let joinViewController = JoinTeamViewController() -// dismiss(animated: true) { -// self.navigation?.pushViewController(joinViewController, animated: true) -// } -// print("새로운 팀 합류하기") let rootView = presentingViewController dismiss(animated: true) { let joinViewController = UINavigationController(rootViewController: CreateTeamViewController()) @@ -188,6 +184,7 @@ final class TeamManageViewController: BaseViewController { self.teamCount = teamCount guard let team = json.detail else { return } self.changeTeamView.teamDataDummy = team + self.setCurrentTeam() } } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index eb084313..38bf9a8a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -16,6 +16,7 @@ final class ChangeTeamView: UIView { teamDataDummy.isEmpty ? setLayoutEmptyView() : setLayoutTeamListView() } } + var currentTeamId: Int? // MARK: - property @@ -95,6 +96,12 @@ extension ChangeTeamView: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TeamChangeCollectionViewCell.className, for: indexPath) as? TeamChangeCollectionViewCell else { return UICollectionViewCell() } cell.teamNameLabel.text = teamDataDummy[indexPath.item].teamName + if let currentTeamId = self.currentTeamId { + if teamDataDummy[indexPath.item].id == currentTeamId { + cell.isSelected = true + } + } + return cell } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift index cea13e8c..9153b4d2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift @@ -27,9 +27,6 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { if isSelected { applyAttribute() } - else { - resetAttribute() - } } } @@ -56,14 +53,9 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { self.layer.borderWidth = width } - private func applyAttribute() { + func applyAttribute() { self.layer.borderWidth = 2 self.layer.borderColor = UIColor.blue200.cgColor self.makeShadow(color: .black100, opacity: 0.3, offset: CGSize(width: 0, height: 0), radius: 0) } - - private func resetAttribute() { - self.layer.borderWidth = 0 - self.makeShadow(color: .black100, opacity: 0.3, offset: CGSize(width: 0, height: 0), radius: 1) - } } From 18acf74b47254beda56631500d72f9ad667d4597 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 30 Mar 2023 22:09:00 +0900 Subject: [PATCH 257/388] =?UTF-8?q?[FEAT]=20=EC=83=88=20=ED=8C=80=20?= =?UTF-8?q?=ED=95=A9=EB=A5=98=ED=95=98=EA=B8=B0=20=EC=97=B0=EA=B2=B0=20(#3?= =?UTF-8?q?20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 2 +- .../JoinTeam/JoinTeamViewController.swift | 57 ++++++++++++++++--- .../Setup/Login/LoginViewController.swift | 2 +- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 296e4ecc..d817eb9c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -138,7 +138,7 @@ final class TeamManageViewController: BaseViewController { private func joinNewTeam() { let rootView = presentingViewController dismiss(animated: true) { - let joinViewController = UINavigationController(rootViewController: CreateTeamViewController()) + let joinViewController = UINavigationController(rootViewController: JoinTeamViewController(from: .teamManageView)) joinViewController.modalPresentationStyle = .fullScreen rootView?.present(joinViewController, animated: true) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index a0bac7c8..6be6b2e4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -12,6 +12,13 @@ import SnapKit final class JoinTeamViewController: BaseTextFieldViewController { + enum ViewType { + case loginView + case teamManageView + } + + private var fromView: ViewType + override var titleText: String { get { return TextLiteral.joinTeamViewControllerTitleLabel @@ -60,14 +67,16 @@ final class JoinTeamViewController: BaseTextFieldViewController { self?.navigationController?.popViewController(animated: true) } button.addAction(action, for: .touchUpInside) + button.isHidden = fromView == .loginView ? false : true return button }() - private let skipButton: UIButton = { + private lazy var skipButton: UIButton = { let button = UIButton() button.setTitle(TextLiteral.joinTeamViewControllerSkipButtonText, for: .normal) button.setTitleColor(.gray500, for: .normal) button.titleLabel?.font = .toast button.frame = CGRect(x: 0, y: 0, width: 49, height: 44) + button.isHidden = fromView == .loginView ? false : true return button }() private lazy var createView: LabelButtonView = { @@ -77,11 +86,31 @@ final class JoinTeamViewController: BaseTextFieldViewController { view.buttonAction = { [weak self] in self?.presentCreateTeamViewController() } + view.isHidden = fromView == .loginView ? false : true return view }() + private lazy var closeButton: CloseButton = { + let button = CloseButton() + let action = UIAction { [weak self] _ in + self?.dismiss(animated: true) + } + button.addAction(action, for: .touchUpInside) + button.isHidden = fromView == .teamManageView ? false : true + return button + }() // MARK: - life cycle + init(from: ViewType) { + self.fromView = from + super.init() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override func viewDidLoad() { super.viewDidLoad() setupDoneButton() @@ -102,15 +131,25 @@ final class JoinTeamViewController: BaseTextFieldViewController { override func setupNavigationBar() { super.setupNavigationBar() + if fromView == .loginView { + let button = removeBarButtonItemOffset(with: backButton, offsetX: 10) + let backButton = makeBarButtonItem(with: button) + let skipButton = makeBarButtonItem(with: skipButton) + + navigationController?.navigationBar.prefersLargeTitles = false + navigationItem.largeTitleDisplayMode = .never + navigationItem.leftBarButtonItem = backButton + navigationItem.rightBarButtonItem = skipButton + } + else if fromView == .teamManageView { + let button = removeBarButtonItemOffset(with: closeButton, offsetX: -10) + let closeButton = makeBarButtonItem(with: button) - let button = removeBarButtonItemOffset(with: backButton, offsetX: 10) - let backButton = makeBarButtonItem(with: button) - let skipButton = makeBarButtonItem(with: skipButton) - - navigationController?.navigationBar.prefersLargeTitles = false - navigationItem.largeTitleDisplayMode = .never - navigationItem.leftBarButtonItem = backButton - navigationItem.rightBarButtonItem = skipButton + navigationController?.navigationBar.prefersLargeTitles = false + navigationItem.largeTitleDisplayMode = .never + navigationItem.rightBarButtonItem = closeButton + + } } // MARK: - setup diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift index 933604be..77634655 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/Login/LoginViewController.swift @@ -127,7 +127,7 @@ final class LoginViewController: BaseViewController { let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate sceneDelegate?.changeRootViewCustomTabBarView() } else { - self?.presentViewController(viewController: JoinTeamViewController()) + self?.presentViewController(viewController: JoinTeamViewController(from: .loginView)) } } } From 66de6e5a83d63a418d26621f4e26c1597e68382e Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 23:34:09 +0900 Subject: [PATCH 258/388] =?UTF-8?q?[FEAT]=20=ED=8C=80=20=EB=82=98=EA=B0=80?= =?UTF-8?q?=EA=B8=B0=20API=20=EC=B6=94=EA=B0=80=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamDetailEndPoint.swift | 17 +++++++++++++++++ .../TeamDetail/TeamDetailViewController.swift | 17 ++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift index 326fe98b..ec976963 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -10,6 +10,7 @@ import Alamofire enum TeamDetailEndPoint: EndPointable { case fetchTeamMember case fetchTeamInformation + case deleteLeaveTeam var address: String { switch self { @@ -18,6 +19,9 @@ enum TeamDetailEndPoint: EndPointable { case .fetchTeamInformation: return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)" + + case .deleteLeaveTeam: + return "\(UrlLiteral.baseUrl2)/users/team/\(UserDefaultStorage.teamId)/leave" } } @@ -28,6 +32,9 @@ enum TeamDetailEndPoint: EndPointable { case .fetchTeamInformation: return .get + + case .deleteLeaveTeam: + return .delete } } @@ -38,6 +45,9 @@ enum TeamDetailEndPoint: EndPointable { case .fetchTeamInformation: return nil + + case .deleteLeaveTeam: + return nil } } @@ -56,6 +66,13 @@ enum TeamDetailEndPoint: EndPointable { "refresh_token": "\(UserDefaultStorage.refreshToken)" ] return HTTPHeaders(headers) + + case .deleteLeaveTeam: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)" + ] + return HTTPHeaders(headers) } } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index d0211ab9..16778be1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -200,15 +200,15 @@ final class TeamDetailViewController: BaseViewController { self?.makeRequestAlert(title: TextLiteral.teamDetailViewControllerLeaveTeamAlertTitle, message: TextLiteral.teamDetailViewControllerLeaveTeamAlertMessage, okTitle: TextLiteral.leaveTitle, - // FIXME: - 팀 나가기 API 연결 - okAction: nil) + okAction: { _ in + self?.deleteLeaveTeam(type: .deleteLeaveTeam) + }) } teamLeaveButton.addAction(action, for: .touchUpInside) } private func setupCodeShareButton() { let action = UIAction { [weak self] _ in - print(self?.invitationCode) UIPasteboard.general.string = self?.invitationCode } codeShareButton.addAction(action, for: .touchUpInside) @@ -259,4 +259,15 @@ final class TeamDetailViewController: BaseViewController { } } } + + private func deleteLeaveTeam(type: TeamDetailEndPoint) { + AF.request(type.address, + method: type.method, + headers: type.headers).responseDecodable(of: BaseModel.self) { json in + if let _ = json.value { + self.navigationController?.popViewController(animated: true) + UserDefaultHandler.setTeamId(teamId: 0) + } + } + } } From ed31b14caaed23e6585a338c0792765e45a4f1f5 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 23:39:53 +0900 Subject: [PATCH 259/388] =?UTF-8?q?[CHORE]=20=EC=B4=88=EB=8C=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20Label=20=EB=B0=98=EC=98=81=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 16778be1..4f3d4078 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -51,8 +51,6 @@ final class TeamDetailViewController: BaseViewController { }() private let invitationCodeLabel: UILabel = { let label = UILabel() - // FIXME: - APi 연결 후 삭제 - label.text = "1BCDEF" label.font = .label2 label.textColor = .gray600 return label @@ -254,6 +252,7 @@ final class TeamDetailViewController: BaseViewController { else { return } self.invitationCode = invitationCode DispatchQueue.main.async { + self.invitationCodeLabel.text = invitationCode self.titleLabel.text = teamName } } From ac776f3dc9ca1cf8ffe6518924a71cf956f08c53 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 30 Mar 2023 23:46:12 +0900 Subject: [PATCH 260/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=97=86=EC=9D=84?= =?UTF-8?q?=20=EB=95=8C=20Alert=20=EC=B6=94=EA=B0=80=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 4f3d4078..b851516d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -68,12 +68,20 @@ final class TeamDetailViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - setupBackButton() - setupEditButton() - setupExitButton() - setupCodeShareButton() - fetchTeamDetailMember(type: .fetchTeamMember) - fetchTeamInformation(type: .fetchTeamInformation) + if UserDefaultStorage.teamId != 0 { + setupBackButton() + setupEditButton() + setupExitButton() + setupCodeShareButton() + fetchTeamDetailMember(type: .fetchTeamMember) + fetchTeamInformation(type: .fetchTeamInformation) + } else { + makeAlert(title: "팀 없음", + message: "현재 속한 팀이 없습니다.\n 팀을 생성하거나, 참가 해 주세요.", + okAction: { [weak self] _ in + self?.navigationController?.popViewController(animated: true) + }) + } } override func configUI() { From 7a682a7e71495b617342840b78f3a94a168c4eb4 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 30 Mar 2023 23:51:35 +0900 Subject: [PATCH 261/388] =?UTF-8?q?[FEAT]=20=EC=83=88=EB=A1=9C=EC=9A=B4=20?= =?UTF-8?q?=EB=B0=A9=20=EC=83=9D=EC=84=B1=20=EC=97=B0=EA=B2=B0=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 8 ++++-- .../CreateTeam/CreateTeamViewController.swift | 2 +- .../JoinTeam/JoinTeamViewController.swift | 2 +- .../SetNicknameViewController.swift | 28 +++++++++++++++++-- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index d817eb9c..768bda51 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -145,8 +145,12 @@ final class TeamManageViewController: BaseViewController { } private func createTeam() { - // FIXME: api 연결 - print("팀 생성하기") + let rootView = presentingViewController + dismiss(animated: true) { + let createTeamViewController = UINavigationController(rootViewController: CreateTeamViewController()) + createTeamViewController.modalPresentationStyle = .fullScreen + rootView?.present(createTeamViewController, animated: true) + } } private func logout() { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index f0c9a4b4..cbfa8480 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -101,7 +101,7 @@ final class CreateTeamViewController: BaseTextFieldViewController { // MARK: - func private func pushSetNicknameViewController() { - let viewController = SetNicknameViewController() + let viewController = SetNicknameViewController(from: .createView) navigationController?.pushViewController(viewController, animated: true) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index 6be6b2e4..244d0b86 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -184,7 +184,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { } private func pushSetNicknameViewController() { - let viewController = SetNicknameViewController() + let viewController = SetNicknameViewController(from: .joinView) navigationController?.pushViewController(viewController, animated: true) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 0a614c2f..258a8032 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -13,6 +13,10 @@ import SnapKit final class SetNicknameViewController: BaseViewController { + enum ViewType { + case createView + case joinView + } private enum TextLength { static let totalMin: Int = 0 static let nicknameMax: Int = 6 @@ -20,6 +24,7 @@ final class SetNicknameViewController: BaseViewController { } private let cameraPicker = UIImagePickerController() private let teamName: String = UserDefaultStorage.teamName + private let fromView: ViewType // MARK: - property @@ -107,6 +112,16 @@ final class SetNicknameViewController: BaseViewController { // MARK: - life cycle + init(from: ViewType) { + self.fromView = from + super.init() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override func viewDidLoad() { super.viewDidLoad() setupDelegate() @@ -289,13 +304,22 @@ final class SetNicknameViewController: BaseViewController { guard let role = roleTextField.text else { return } // FIXME: - 이미지 데이터 추가 - if UserDefaultStorage.teamId == 0 { + if fromView == .createView { let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) dispatchCreateTeam(type: .dispatchCreateTeam(dto)) - } else { + } + else if fromView == .joinView { let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) } + // FIXME: 진저가 확인 후 코드리뷰 시 삭제 예정 +// if UserDefaultStorage.teamId == 0 { +// let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) +// dispatchCreateTeam(type: .dispatchCreateTeam(dto)) +// } else { +// let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) +// dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) +// } nicknameTextField.resignFirstResponder() roleTextField.resignFirstResponder() From 1ae99e748dcf923e8ac1a2a27f2d11c079ca07bd Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 00:02:41 +0900 Subject: [PATCH 262/388] =?UTF-8?q?[CHORE]=20emptyView=20=EB=8A=94=20lazy?= =?UTF-8?q?=20=EB=A1=9C=20=EC=84=A4=EC=A0=95=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 38bf9a8a..7a46228a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -43,7 +43,7 @@ final class ChangeTeamView: UIView { collectionView.backgroundColor = .white200 return collectionView }() - private let emptyView = EmptyTeamView() + private lazy var emptyView = EmptyTeamView() // MARK: - life cycle From f20831650efa50ad3a800dba14194d70d1abe76e Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 01:34:20 +0900 Subject: [PATCH 263/388] =?UTF-8?q?[FEAT]=20=ED=8C=80=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ++++ .../Extension/NotificationName+Extension.swift | 12 ++++++++++++ .../Screen/Home/Home/HomeViewController.swift | 16 ++++++++++++++++ .../Home/Home/TeamManageViewController.swift | 12 ++++++++++++ .../Home/Home/UIComponent/ChangeTeamView.swift | 9 ++++++--- 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 Maddori.Apple/Maddori.Apple/Global/Extension/NotificationName+Extension.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 53d6919b..0125688b 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -155,6 +155,7 @@ D7A585272990DAFC00E1F4EE /* Section.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585262990DAFC00E1F4EE /* Section.swift */; }; D7A585292990DB0D00E1F4EE /* Option.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A585282990DB0D00E1F4EE /* Option.swift */; }; D7A5852B2990DCE700E1F4EE /* ChangeTeamView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */; }; + D7A6C63829D5EC6A0096D466 /* NotificationName+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A6C63729D5EC6A0096D466 /* NotificationName+Extension.swift */; }; D7AFB7C32916EAB100E998B7 /* MyReflectionDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C22916EAB100E998B7 /* MyReflectionDetailViewController.swift */; }; D7AFB7C52916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C42916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift */; }; D7AFB7C72916FF9400E998B7 /* CustomSegmentControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7AFB7C62916FF9400E998B7 /* CustomSegmentControl.swift */; }; @@ -311,6 +312,7 @@ D7A585262990DAFC00E1F4EE /* Section.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Section.swift; sourceTree = ""; }; D7A585282990DB0D00E1F4EE /* Option.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Option.swift; sourceTree = ""; }; D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeTeamView.swift; sourceTree = ""; }; + D7A6C63729D5EC6A0096D466 /* NotificationName+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationName+Extension.swift"; sourceTree = ""; }; D7AFB7C22916EAB100E998B7 /* MyReflectionDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionDetailViewController.swift; sourceTree = ""; }; D7AFB7C42916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReflectionDetailTableViewCell.swift; sourceTree = ""; }; D7AFB7C62916FF9400E998B7 /* CustomSegmentControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSegmentControl.swift; sourceTree = ""; }; @@ -469,6 +471,7 @@ 7E7F160E2921CD4A00C6BE96 /* UITabBar+Extension.swift */, 3EA341E72925E5EA005CBD1C /* String+Extension.swift */, 3E5368C729B60B70000CBD48 /* UIImageView+Extension.swift */, + D7A6C63729D5EC6A0096D466 /* NotificationName+Extension.swift */, ); path = Extension; sourceTree = ""; @@ -1248,6 +1251,7 @@ D7A585272990DAFC00E1F4EE /* Section.swift in Sources */, D7A5852B2990DCE700E1F4EE /* ChangeTeamView.swift in Sources */, 3E557FC528FE854600714E46 /* KeywordLabel.swift in Sources */, + D7A6C63829D5EC6A0096D466 /* NotificationName+Extension.swift in Sources */, 39F52C53292330D200B19A77 /* MemberResponse.swift in Sources */, 39F52C6A292473A800B19A77 /* ReflectionInfoResponse.swift in Sources */, D702278A297F99510027EF64 /* TeamManageViewController.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/NotificationName+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/NotificationName+Extension.swift new file mode 100644 index 00000000..92cf6cc1 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/NotificationName+Extension.swift @@ -0,0 +1,12 @@ +// +// NotificationName.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/03/31. +// + +import Foundation + +extension Notification.Name { + static let chagneNotification = Notification.Name("changeTeamNotification") +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index c61f2b08..3aaa7eba 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -106,6 +106,7 @@ final class HomeViewController: BaseViewController { super.viewWillAppear(animated) fetchCertainTeamDetail(type: .fetchCertainTeamDetail) fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) + setupNotification() } override func configUI() { @@ -157,6 +158,10 @@ final class HomeViewController: BaseViewController { // MARK: - func + private func setupNotification() { + NotificationCenter.default.addObserver(self, selector: #selector(reloadHomeViewController(_:)), name: .chagneNotification, object: nil) + } + private func presentTeamModal() { let teamViewController = TeamManageViewController(teamId: currentTeamId) @@ -279,6 +284,17 @@ final class HomeViewController: BaseViewController { self.navigationController?.pushViewController(viewController, animated: true) } + // MARK: - selector + + @objc + private func reloadHomeViewController(_ sender: Notification) { + if let teamId = sender.object as? Int { + UserDefaultHandler.setTeamId(teamId: teamId) + fetchCertainTeamDetail(type: .fetchCertainTeamDetail) + fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) + } + } + // MARK: - api private func fetchCertainTeamDetail(type: HomeEndPoint) { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 768bda51..c8c08072 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -67,6 +67,7 @@ final class TeamManageViewController: BaseViewController { setupDelegate() configureSettingModels() fetchUserTeamList(type: .fetchUserTeamList) + setChangeTeamViewDelegate() } override func render() { @@ -111,6 +112,10 @@ final class TeamManageViewController: BaseViewController { // MARK: - func + private func setChangeTeamViewDelegate() { + changeTeamView.delegate = self + } + private func setCurrentTeam() { changeTeamView.currentTeamId = currentTeamId } @@ -264,3 +269,10 @@ extension TeamManageViewController: UITableViewDelegate { model.handler() } } + +extension TeamManageViewController: ChangeTeamViewDelegate { + func chagneTeam(teamId: Int) { + NotificationCenter.default.post(name: .chagneNotification, object: teamId) + dismiss(animated: true) + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 7a46228a..757cbec3 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -9,6 +9,10 @@ import UIKit import SnapKit +protocol ChangeTeamViewDelegate: AnyObject { + func chagneTeam(teamId: Int) +} + final class ChangeTeamView: UIView { var teamDataDummy: [TeamInfoResponse] = [] { @@ -17,6 +21,7 @@ final class ChangeTeamView: UIView { } } var currentTeamId: Int? + weak var delegate: ChangeTeamViewDelegate? // MARK: - property @@ -108,8 +113,6 @@ extension ChangeTeamView: UICollectionViewDataSource { extension ChangeTeamView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - // MARK: - FIXME - let selectedTeamName = teamDataDummy[indexPath.item] - print(selectedTeamName) + self.delegate?.chagneTeam(teamId: teamDataDummy[indexPath.item].id!) } } From c07dd95320b7d4c94df6b82de846422de2221fa1 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 13:33:16 +0900 Subject: [PATCH 264/388] =?UTF-8?q?[CHORE]=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/TeamManageViewController.swift | 14 +++++--------- .../Home/Home/UIComponent/ChangeTeamView.swift | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index c8c08072..468af5da 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -16,13 +16,14 @@ final class TeamManageViewController: BaseViewController { static let teamSectionHeight = 59 static let teamSectionSpacing = 8 static let teamSectionPadding = 28 + static let teamTitleLabelHeight = 50 } private var sections: [Section] = [] private lazy var teamCount = 0 { didSet { changeTeamView.snp.updateConstraints { - $0.height.equalTo((teamCount * Size.teamSectionHeight) + ((teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding) + $0.height.equalTo((teamCount * Size.teamSectionHeight) + ((teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding + Size.teamTitleLabelHeight) } } } @@ -86,17 +87,12 @@ final class TeamManageViewController: BaseViewController { changeTeamView.snp.makeConstraints { $0.top.equalToSuperview() $0.width.equalToSuperview() - if changeTeamView.teamDataDummy.isEmpty { - $0.height.equalTo(150) - } - else { - $0.height.equalTo((teamCount * Size.teamSectionHeight) + ((teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding) - } + $0.height.equalTo(150) } contentView.addSubview(dividerView) dividerView.snp.makeConstraints { - $0.top.equalTo(changeTeamView.snp.bottom).offset(55) + $0.top.equalTo(changeTeamView.snp.bottom) $0.width.equalToSuperview() $0.height.equalTo(6) } @@ -271,7 +267,7 @@ extension TeamManageViewController: UITableViewDelegate { } extension TeamManageViewController: ChangeTeamViewDelegate { - func chagneTeam(teamId: Int) { + func changeTeam(teamId: Int) { NotificationCenter.default.post(name: .chagneNotification, object: teamId) dismiss(animated: true) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 757cbec3..dc5e118d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -10,7 +10,7 @@ import UIKit import SnapKit protocol ChangeTeamViewDelegate: AnyObject { - func chagneTeam(teamId: Int) + func changeTeam(teamId: Int) } final class ChangeTeamView: UIView { @@ -113,6 +113,6 @@ extension ChangeTeamView: UICollectionViewDataSource { extension ChangeTeamView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - self.delegate?.chagneTeam(teamId: teamDataDummy[indexPath.item].id!) + self.delegate?.changeTeam(teamId: teamDataDummy[indexPath.item].id!) } } From 12f0a585241c06659934290788b0e1a48b8e821d Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 18:09:12 +0900 Subject: [PATCH 265/388] =?UTF-8?q?[CHORE]=20url=20->=20=EB=A6=AC=ED=84=B0?= =?UTF-8?q?=EB=9F=B4=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift index 0ef96bfe..f229a55a 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift @@ -13,7 +13,7 @@ enum TeamInfoEndPoint: EndPointable { var address: String { switch self { case .fetchUserTeamList: - return "http://15.165.21.115:3001/api/v2/users/teams" + return "\(UrlLiteral.baseUrl2)/users/teams" } } From 8a01c1e2a0214c45af92735b0080cc77aed9a784 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 20:55:43 +0900 Subject: [PATCH 266/388] =?UTF-8?q?[CHORE]=20@available=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamInfoEndPoint 2.swift | 44 +++++++++++++++++++ .../Home/Home/TeamManageViewController.swift | 1 + 2 files changed, 45 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint 2.swift diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint 2.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint 2.swift new file mode 100644 index 00000000..0ef96bfe --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint 2.swift @@ -0,0 +1,44 @@ +// +// TeamInfoEndPoint.swift +// Maddori.Apple +// +// Created by 이성호 on 2023/03/16. +// + +import Alamofire + +enum TeamInfoEndPoint: EndPointable { + case fetchUserTeamList + + var address: String { + switch self { + case .fetchUserTeamList: + return "http://15.165.21.115:3001/api/v2/users/teams" + } + } + + var method: Alamofire.HTTPMethod { + switch self { + case .fetchUserTeamList: + return .get + } + } + + var body: T? { + switch self { + case .fetchUserTeamList: + return nil + } + } + + var headers: Alamofire.HTTPHeaders? { + switch self { + case .fetchUserTeamList: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)" + ] + return HTTPHeaders(headers) + } + } +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 468af5da..f5485b87 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -59,6 +59,7 @@ final class TeamManageViewController: BaseViewController { super.init() } + @available(*, unavailable) required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } From 02f3c5e95a11bb6779e1fda9b6f154015a5c513c Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 21:02:10 +0900 Subject: [PATCH 267/388] =?UTF-8?q?[CHORE]=20=EB=B3=80=EC=88=98=EB=AA=85?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 2 +- .../Home/Home/UIComponent/ChangeTeamView.swift | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index f5485b87..59953b8c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -189,7 +189,7 @@ final class TeamManageViewController: BaseViewController { guard let teamCount = json.detail?.count else { return } self.teamCount = teamCount guard let team = json.detail else { return } - self.changeTeamView.teamDataDummy = team + self.changeTeamView.teamList = team self.setCurrentTeam() } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index dc5e118d..fd10db6e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -15,9 +15,9 @@ protocol ChangeTeamViewDelegate: AnyObject { final class ChangeTeamView: UIView { - var teamDataDummy: [TeamInfoResponse] = [] { + var teamList: [TeamInfoResponse] = [] { didSet { - teamDataDummy.isEmpty ? setLayoutEmptyView() : setLayoutTeamListView() + teamList.isEmpty ? setLayoutEmptyView() : setLayoutTeamListView() } } var currentTeamId: Int? @@ -95,14 +95,14 @@ final class ChangeTeamView: UIView { extension ChangeTeamView: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return teamDataDummy.count + return teamList.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TeamChangeCollectionViewCell.className, for: indexPath) as? TeamChangeCollectionViewCell else { return UICollectionViewCell() } - cell.teamNameLabel.text = teamDataDummy[indexPath.item].teamName + cell.teamNameLabel.text = teamList[indexPath.item].teamName if let currentTeamId = self.currentTeamId { - if teamDataDummy[indexPath.item].id == currentTeamId { + if teamList[indexPath.item].id == currentTeamId { cell.isSelected = true } } @@ -113,6 +113,6 @@ extension ChangeTeamView: UICollectionViewDataSource { extension ChangeTeamView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - self.delegate?.changeTeam(teamId: teamDataDummy[indexPath.item].id!) + self.delegate?.changeTeam(teamId: teamList[indexPath.item].id!) } } From 818e6272a0a424031c103cab7d88bfd84ce2e037 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 21:04:37 +0900 Subject: [PATCH 268/388] =?UTF-8?q?[CHORE]=20private=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Home/UIComponent/TeamChangeCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift index 9153b4d2..8701a98a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift @@ -53,7 +53,7 @@ final class TeamChangeCollectionViewCell: BaseCollectionViewCell { self.layer.borderWidth = width } - func applyAttribute() { + private func applyAttribute() { self.layer.borderWidth = 2 self.layer.borderColor = UIColor.blue200.cgColor self.makeShadow(color: .black100, opacity: 0.3, offset: CGSize(width: 0, height: 0), radius: 0) From 776639d28e0588dba711bd7ab6b853474615bf74 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 22:12:04 +0900 Subject: [PATCH 269/388] =?UTF-8?q?[CHORE]=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Extension/NotificationName+Extension.swift | 2 +- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- .../Screen/Home/Home/TeamManageViewController.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/NotificationName+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/NotificationName+Extension.swift index 92cf6cc1..6b91d7be 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/NotificationName+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/NotificationName+Extension.swift @@ -8,5 +8,5 @@ import Foundation extension Notification.Name { - static let chagneNotification = Notification.Name("changeTeamNotification") + static let changeTeamNotification = Notification.Name("changeTeamNotification") } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 3aaa7eba..8db86926 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -159,7 +159,7 @@ final class HomeViewController: BaseViewController { // MARK: - func private func setupNotification() { - NotificationCenter.default.addObserver(self, selector: #selector(reloadHomeViewController(_:)), name: .chagneNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(reloadHomeViewController(_:)), name: .changeTeamNotification, object: nil) } private func presentTeamModal() { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 59953b8c..29f52f80 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -269,7 +269,7 @@ extension TeamManageViewController: UITableViewDelegate { extension TeamManageViewController: ChangeTeamViewDelegate { func changeTeam(teamId: Int) { - NotificationCenter.default.post(name: .chagneNotification, object: teamId) + NotificationCenter.default.post(name: .changeTeamNotification, object: teamId) dismiss(animated: true) } } From d6f3a5e25cf0b31745a9666e273e4e5231418699 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 22:13:26 +0900 Subject: [PATCH 270/388] =?UTF-8?q?[CHORE]=20=EC=9E=98=EB=AA=BB=20?= =?UTF-8?q?=EB=B3=B5=EC=82=AC=EB=90=9C=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamInfoEndPoint 2.swift | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint 2.swift diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint 2.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint 2.swift deleted file mode 100644 index 0ef96bfe..00000000 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint 2.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// TeamInfoEndPoint.swift -// Maddori.Apple -// -// Created by 이성호 on 2023/03/16. -// - -import Alamofire - -enum TeamInfoEndPoint: EndPointable { - case fetchUserTeamList - - var address: String { - switch self { - case .fetchUserTeamList: - return "http://15.165.21.115:3001/api/v2/users/teams" - } - } - - var method: Alamofire.HTTPMethod { - switch self { - case .fetchUserTeamList: - return .get - } - } - - var body: T? { - switch self { - case .fetchUserTeamList: - return nil - } - } - - var headers: Alamofire.HTTPHeaders? { - switch self { - case .fetchUserTeamList: - let headers = [ - "access_token": "\(UserDefaultStorage.accessToken)", - "refresh_token": "\(UserDefaultStorage.refreshToken)" - ] - return HTTPHeaders(headers) - } - } -} From 2e6b02717fe2e20245949d8a343284cf742674a9 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 31 Mar 2023 22:30:09 +0900 Subject: [PATCH 271/388] =?UTF-8?q?[CHORE]=20self=20=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=EB=B6=99=EC=9D=B4=EA=B8=B0=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 12 ++++----- .../Home/Home/TeamManageViewController.swift | 25 +++++++++---------- .../Home/UIComponent/ChangeTeamView.swift | 10 ++++---- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 8db86926..61065e70 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -30,7 +30,7 @@ final class HomeViewController: BaseViewController { var reflectionDate: String = "" var isAdmin: Bool = false - var currentTeamId: Int = 0 + private var currentTeamId: Int = 0 // MARK: - property @@ -106,7 +106,7 @@ final class HomeViewController: BaseViewController { super.viewWillAppear(animated) fetchCertainTeamDetail(type: .fetchCertainTeamDetail) fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) - setupNotification() + self.setupNotification() } override func configUI() { @@ -159,11 +159,11 @@ final class HomeViewController: BaseViewController { // MARK: - func private func setupNotification() { - NotificationCenter.default.addObserver(self, selector: #selector(reloadHomeViewController(_:)), name: .changeTeamNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(self.reloadHomeViewController(_:)), name: .changeTeamNotification, object: nil) } private func presentTeamModal() { - let teamViewController = TeamManageViewController(teamId: currentTeamId) + let teamViewController = TeamManageViewController(teamId: self.currentTeamId) teamViewController.modalPresentationStyle = .pageSheet @@ -290,8 +290,8 @@ final class HomeViewController: BaseViewController { private func reloadHomeViewController(_ sender: Notification) { if let teamId = sender.object as? Int { UserDefaultHandler.setTeamId(teamId: teamId) - fetchCertainTeamDetail(type: .fetchCertainTeamDetail) - fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) + self.fetchCertainTeamDetail(type: .fetchCertainTeamDetail) + self.fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 29f52f80..2c24df04 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -22,11 +22,12 @@ final class TeamManageViewController: BaseViewController { private var sections: [Section] = [] private lazy var teamCount = 0 { didSet { - changeTeamView.snp.updateConstraints { - $0.height.equalTo((teamCount * Size.teamSectionHeight) + ((teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding + Size.teamTitleLabelHeight) + self.changeTeamView.snp.updateConstraints { + $0.height.equalTo((self.teamCount * Size.teamSectionHeight) + ((self.teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding + Size.teamTitleLabelHeight) } } } + private var currentTeamId: Int // MARK: - property @@ -50,8 +51,6 @@ final class TeamManageViewController: BaseViewController { private let scrollView: UIScrollView = UIScrollView() private let contentView: UIView = UIView() - private var currentTeamId: Int - // MARK: - life cycle init(teamId: Int) { @@ -66,10 +65,10 @@ final class TeamManageViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - setupDelegate() - configureSettingModels() - fetchUserTeamList(type: .fetchUserTeamList) - setChangeTeamViewDelegate() + self.setupDelegate() + self.configureSettingModels() + self.fetchUserTeamList(type: .fetchUserTeamList) + self.setChangeTeamViewDelegate() } override func render() { @@ -110,11 +109,11 @@ final class TeamManageViewController: BaseViewController { // MARK: - func private func setChangeTeamViewDelegate() { - changeTeamView.delegate = self + self.changeTeamView.delegate = self } private func setCurrentTeam() { - changeTeamView.currentTeamId = currentTeamId + self.changeTeamView.currentTeamId = self.currentTeamId } private func setupDelegate() { @@ -139,7 +138,7 @@ final class TeamManageViewController: BaseViewController { private func joinNewTeam() { let rootView = presentingViewController - dismiss(animated: true) { + self.dismiss(animated: true) { let joinViewController = UINavigationController(rootViewController: JoinTeamViewController(from: .teamManageView)) joinViewController.modalPresentationStyle = .fullScreen rootView?.present(joinViewController, animated: true) @@ -148,7 +147,7 @@ final class TeamManageViewController: BaseViewController { private func createTeam() { let rootView = presentingViewController - dismiss(animated: true) { + self.dismiss(animated: true) { let createTeamViewController = UINavigationController(rootViewController: CreateTeamViewController()) createTeamViewController.modalPresentationStyle = .fullScreen rootView?.present(createTeamViewController, animated: true) @@ -270,6 +269,6 @@ extension TeamManageViewController: UITableViewDelegate { extension TeamManageViewController: ChangeTeamViewDelegate { func changeTeam(teamId: Int) { NotificationCenter.default.post(name: .changeTeamNotification, object: teamId) - dismiss(animated: true) + self.dismiss(animated: true) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index fd10db6e..16f5df72 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -17,7 +17,7 @@ final class ChangeTeamView: UIView { var teamList: [TeamInfoResponse] = [] { didSet { - teamList.isEmpty ? setLayoutEmptyView() : setLayoutTeamListView() + self.teamList.isEmpty ? self.setLayoutEmptyView() : self.setLayoutTeamListView() } } var currentTeamId: Int? @@ -95,14 +95,14 @@ final class ChangeTeamView: UIView { extension ChangeTeamView: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return teamList.count + return self.teamList.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TeamChangeCollectionViewCell.className, for: indexPath) as? TeamChangeCollectionViewCell else { return UICollectionViewCell() } - cell.teamNameLabel.text = teamList[indexPath.item].teamName + cell.teamNameLabel.text = self.teamList[indexPath.item].teamName if let currentTeamId = self.currentTeamId { - if teamList[indexPath.item].id == currentTeamId { + if self.teamList[indexPath.item].id == currentTeamId { cell.isSelected = true } } @@ -113,6 +113,6 @@ extension ChangeTeamView: UICollectionViewDataSource { extension ChangeTeamView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - self.delegate?.changeTeam(teamId: teamList[indexPath.item].id!) + self.delegate?.changeTeam(teamId: self.teamList[indexPath.item].id!) } } From 38feaed8e3be7449f8b4e0627c3a616b76ef13d3 Mon Sep 17 00:00:00 2001 From: chemi Date: Sat, 1 Apr 2023 17:41:55 +0900 Subject: [PATCH 272/388] =?UTF-8?q?[CHORE]=20=ED=98=84=EC=9E=AC=20?= =?UTF-8?q?=EC=86=8D=ED=95=9C=20=ED=8C=80=20=EA=B0=80=EC=A0=B8=EC=98=A4?= =?UTF-8?q?=EB=8A=94=20API=EA=B5=AC=ED=98=84=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamDetailEndPoint.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift index ec976963..1168852c 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -11,6 +11,7 @@ enum TeamDetailEndPoint: EndPointable { case fetchTeamMember case fetchTeamInformation case deleteLeaveTeam + case fetchTeams var address: String { switch self { @@ -22,6 +23,9 @@ enum TeamDetailEndPoint: EndPointable { case .deleteLeaveTeam: return "\(UrlLiteral.baseUrl2)/users/team/\(UserDefaultStorage.teamId)/leave" + + case .fetchTeams: + return "\(UrlLiteral.baseUrl2)/users/teams" } } @@ -35,6 +39,9 @@ enum TeamDetailEndPoint: EndPointable { case .deleteLeaveTeam: return .delete + + case .fetchTeams: + return .get } } @@ -48,6 +55,9 @@ enum TeamDetailEndPoint: EndPointable { case .deleteLeaveTeam: return nil + + case .fetchTeams: + return nil } } @@ -73,6 +83,13 @@ enum TeamDetailEndPoint: EndPointable { "refresh_token": "\(UserDefaultStorage.refreshToken)" ] return HTTPHeaders(headers) + + case .fetchTeams: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)" + ] + return HTTPHeaders(headers) } } } From 61adc30b94664aefeefe71af230fe8d803f5a978 Mon Sep 17 00:00:00 2001 From: chemi Date: Sat, 1 Apr 2023 17:42:32 +0900 Subject: [PATCH 273/388] =?UTF-8?q?[FEAT]=20=ED=8C=80=20=EB=82=98=EA=B0=80?= =?UTF-8?q?=EA=B8=B0=20=EC=9D=B4=ED=9B=84=20TeamId=20UserDefault=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index b851516d..1924f4e8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -75,6 +75,9 @@ final class TeamDetailViewController: BaseViewController { setupCodeShareButton() fetchTeamDetailMember(type: .fetchTeamMember) fetchTeamInformation(type: .fetchTeamInformation) +// fetchUserTeamList(type: .fetchTeams, completion: { +// print("completion") +// }) } else { makeAlert(title: "팀 없음", message: "현재 속한 팀이 없습니다.\n 팀을 생성하거나, 참가 해 주세요.", @@ -272,8 +275,26 @@ final class TeamDetailViewController: BaseViewController { method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let _ = json.value { - self.navigationController?.popViewController(animated: true) - UserDefaultHandler.setTeamId(teamId: 0) + self.fetchUserTeamList(type: .fetchTeams) { + self.navigationController?.popViewController(animated: true) + } + } + } + } + + private func fetchUserTeamList(type: TeamDetailEndPoint, completion: @escaping (() ->())) { + AF.request(type.address, + method: type.method, + headers: type.headers).responseDecodable(of: BaseModel<[TeamInfoResponse]>.self) { json in + if let data = json.value { + guard let teams = data.detail else { return } + if !teams.isEmpty { + guard let teamId = teams.first?.id else { return } + UserDefaultHandler.setTeamId(teamId: teamId) + } else { + UserDefaultHandler.setTeamId(teamId: 0) + } + completion() } } } From 9bda700a0b4a7761ecd70a006f59cb275e54a93b Mon Sep 17 00:00:00 2001 From: chemi Date: Sat, 1 Apr 2023 17:45:13 +0900 Subject: [PATCH 274/388] =?UTF-8?q?[CHORE]=20API=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamDetailEndPoint.swift | 10 +++++----- .../Home/TeamDetail/TeamDetailViewController.swift | 5 +---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift index 1168852c..ce1be6a5 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -11,7 +11,7 @@ enum TeamDetailEndPoint: EndPointable { case fetchTeamMember case fetchTeamInformation case deleteLeaveTeam - case fetchTeams + case fetchUserTeamList var address: String { switch self { @@ -24,7 +24,7 @@ enum TeamDetailEndPoint: EndPointable { case .deleteLeaveTeam: return "\(UrlLiteral.baseUrl2)/users/team/\(UserDefaultStorage.teamId)/leave" - case .fetchTeams: + case .fetchUserTeamList: return "\(UrlLiteral.baseUrl2)/users/teams" } } @@ -40,7 +40,7 @@ enum TeamDetailEndPoint: EndPointable { case .deleteLeaveTeam: return .delete - case .fetchTeams: + case .fetchUserTeamList: return .get } } @@ -56,7 +56,7 @@ enum TeamDetailEndPoint: EndPointable { case .deleteLeaveTeam: return nil - case .fetchTeams: + case .fetchUserTeamList: return nil } } @@ -84,7 +84,7 @@ enum TeamDetailEndPoint: EndPointable { ] return HTTPHeaders(headers) - case .fetchTeams: + case .fetchUserTeamList: let headers = [ "access_token": "\(UserDefaultStorage.accessToken)", "refresh_token": "\(UserDefaultStorage.refreshToken)" diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 1924f4e8..65532145 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -75,9 +75,6 @@ final class TeamDetailViewController: BaseViewController { setupCodeShareButton() fetchTeamDetailMember(type: .fetchTeamMember) fetchTeamInformation(type: .fetchTeamInformation) -// fetchUserTeamList(type: .fetchTeams, completion: { -// print("completion") -// }) } else { makeAlert(title: "팀 없음", message: "현재 속한 팀이 없습니다.\n 팀을 생성하거나, 참가 해 주세요.", @@ -275,7 +272,7 @@ final class TeamDetailViewController: BaseViewController { method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let _ = json.value { - self.fetchUserTeamList(type: .fetchTeams) { + self.fetchUserTeamList(type: .fetchUserTeamList) { self.navigationController?.popViewController(animated: true) } } From d200f90ce6237423cec8944b459ffdfc59ba090d Mon Sep 17 00:00:00 2001 From: chemi Date: Sat, 1 Apr 2023 17:59:04 +0900 Subject: [PATCH 275/388] =?UTF-8?q?[FEAT]=20=EC=86=8D=ED=95=9C=20=ED=8C=80?= =?UTF-8?q?=20=EC=97=86=EC=9D=84=20=EB=95=8C=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=88=A8=EA=B8=B0=EA=B8=B0=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 6 ++++++ .../TeamDetail/TeamDetailViewController.swift | 20 ++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index f5892119..717a152d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -103,6 +103,7 @@ final class HomeViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + setLayoutTeamManageButton() fetchCertainTeamDetail(type: .fetchCertainTeamDetail) fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) } @@ -278,6 +279,11 @@ final class HomeViewController: BaseViewController { self.navigationController?.pushViewController(viewController, animated: true) } + private func setLayoutTeamManageButton() { + let hasTeam = UserDefaultStorage.teamId != 0 + teamManageButton.isHidden = !hasTeam + } + // MARK: - api private func fetchCertainTeamDetail(type: HomeEndPoint) { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 65532145..a69ccf6d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -68,20 +68,12 @@ final class TeamDetailViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - if UserDefaultStorage.teamId != 0 { - setupBackButton() - setupEditButton() - setupExitButton() - setupCodeShareButton() - fetchTeamDetailMember(type: .fetchTeamMember) - fetchTeamInformation(type: .fetchTeamInformation) - } else { - makeAlert(title: "팀 없음", - message: "현재 속한 팀이 없습니다.\n 팀을 생성하거나, 참가 해 주세요.", - okAction: { [weak self] _ in - self?.navigationController?.popViewController(animated: true) - }) - } + setupBackButton() + setupEditButton() + setupExitButton() + setupCodeShareButton() + fetchTeamDetailMember(type: .fetchTeamMember) + fetchTeamInformation(type: .fetchTeamInformation) } override func configUI() { From 797522aa9a01c133c1f28b608c338b24782400de Mon Sep 17 00:00:00 2001 From: chemi Date: Sat, 1 Apr 2023 18:19:53 +0900 Subject: [PATCH 276/388] =?UTF-8?q?[CHORE]=20=EA=B1=B4=EB=84=88=EB=9B=B0?= =?UTF-8?q?=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=82=AD=EC=A0=9C=20(#329)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/TextLiteral.swift | 1 - .../JoinTeam/JoinTeamViewController.swift | 23 ------------------- 2 files changed, 24 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index cde48b72..dbe03ffa 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -107,7 +107,6 @@ enum TextLiteral { static let joinTeamViewControllerSubButtonText = "팀 생성하기" static let joinTeamViewControllerAlertTitle = "잘못된 초대코드" static let joinTeamViewControllerAlertMessage = "초대코드를 다시 입력해주세요." - static let joinTeamViewControllerSkipButtonText = "건너뛰기" // MARK: - StartReflectionViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index a0bac7c8..2a9899c3 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -62,14 +62,6 @@ final class JoinTeamViewController: BaseTextFieldViewController { button.addAction(action, for: .touchUpInside) return button }() - private let skipButton: UIButton = { - let button = UIButton() - button.setTitle(TextLiteral.joinTeamViewControllerSkipButtonText, for: .normal) - button.setTitleColor(.gray500, for: .normal) - button.titleLabel?.font = .toast - button.frame = CGRect(x: 0, y: 0, width: 49, height: 44) - return button - }() private lazy var createView: LabelButtonView = { let view = LabelButtonView() view.subText = TextLiteral.joinTeamViewControllerSubText @@ -86,7 +78,6 @@ final class JoinTeamViewController: BaseTextFieldViewController { super.viewDidLoad() setupDoneButton() setupKeyboard() - setupSkipButton() } override func render() { @@ -105,12 +96,10 @@ final class JoinTeamViewController: BaseTextFieldViewController { let button = removeBarButtonItemOffset(with: backButton, offsetX: 10) let backButton = makeBarButtonItem(with: button) - let skipButton = makeBarButtonItem(with: skipButton) navigationController?.navigationBar.prefersLargeTitles = false navigationItem.largeTitleDisplayMode = .never navigationItem.leftBarButtonItem = backButton - navigationItem.rightBarButtonItem = skipButton } // MARK: - setup @@ -128,13 +117,6 @@ final class JoinTeamViewController: BaseTextFieldViewController { super.kigoTextField.autocapitalizationType = .allCharacters } - private func setupSkipButton() { - let action = UIAction { [weak self] _ in - self?.pushHomeViewController() - } - skipButton.addAction(action, for: .touchUpInside) - } - // MARK: - func private func presentCreateTeamViewController() { @@ -149,11 +131,6 @@ final class JoinTeamViewController: BaseTextFieldViewController { navigationController?.pushViewController(viewController, animated: true) } - private func pushHomeViewController() { - let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate - sceneDelegate?.changeRootViewCustomTabBarView() - } - // MARK: - api private func fetchCertainTeam(type: SetupEndPoint) { From 3c64b496a44d88f85ac6958c380b71b354e2abed Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 2 Apr 2023 14:10:02 +0900 Subject: [PATCH 277/388] [CHORE] create team no name solved --- .../Maddori.Apple/Network/EndPoint/HomeEndPoint.swift | 2 +- .../Network/Response/CertainTeamDetailResponse.swift | 4 +--- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 5 +---- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/HomeEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/HomeEndPoint.swift index daf6799c..75e19c38 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/HomeEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/HomeEndPoint.swift @@ -14,7 +14,7 @@ enum HomeEndPoint: EndPointable { var address: String { switch self { case .fetchCertainTeamDetail: - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)" case .fetchCurrentReflectionDetail: return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/current" } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/CertainTeamDetailResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/CertainTeamDetailResponse.swift index 3ea5264e..884eac48 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/CertainTeamDetailResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/CertainTeamDetailResponse.swift @@ -12,12 +12,10 @@ struct CertainTeamDetailResponse: Decodable { let teamId: Int? let teamName: String? let invitationCode: String? - let admin: Bool? enum CodingKeys: String, CodingKey { - case teamId = "team_id" + case teamId = "id" case teamName = "team_name" case invitationCode = "invitation_code" - case admin } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index f5892119..3b543241 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -286,10 +286,7 @@ final class HomeViewController: BaseViewController { headers: type.headers ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { - guard let isAdmin = json.detail?.admin, - let teamName = json.detail?.teamName - else { return } - self.isAdmin = isAdmin + guard let teamName = json.detail?.teamName else { return } DispatchQueue.main.async { self.teamButton.setTitle(teamName + " ", for: .normal) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index ac362e2a..d55a7713 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -343,7 +343,7 @@ final class SetNicknameViewController: BaseViewController { ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) - guard let teamId = json.detail?.id else { return } + guard let teamId = json.detail?.team?.id else { return } UserDefaultHandler.setTeamId(teamId: teamId) UserDefaultHandler.setIsLogin(isLogin: true) DispatchQueue.main.async { From f08a764b4a716f1d0d57ba13c784ef8ad71df998 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 2 Apr 2023 14:17:39 +0900 Subject: [PATCH 278/388] =?UTF-8?q?[CHORE]=20=EC=9E=90=EC=9E=98=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95(#323)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/UIComponent/Button/MainButton.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift index 83f353bd..57b12fa9 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift @@ -27,7 +27,7 @@ final class MainButton: UIButton { didSet { setupAttribute() } } - lazy private var spinner = UIActivityIndicatorView() + private lazy var spinner = UIActivityIndicatorView() // MARK: - life cycle From 496160df4c18cd82f0ae32df4bb872509a776067 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 2 Apr 2023 14:41:42 +0900 Subject: [PATCH 279/388] [CHORE] API baseurl updated (#332) --- .../Maddori.Apple/Network/EndPoint/HomeEndPoint.swift | 2 +- .../Network/EndPoint/MyReflectionEndPoint.swift | 2 +- .../Screen/Home/Home/HomeViewController.swift | 1 + .../MyReflection/MyReflectionViewController.swift | 7 ++++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/HomeEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/HomeEndPoint.swift index daf6799c..135a26ed 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/HomeEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/HomeEndPoint.swift @@ -16,7 +16,7 @@ enum HomeEndPoint: EndPointable { case .fetchCertainTeamDetail: return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)" case .fetchCurrentReflectionDetail: - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/current" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/current" } } diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift index 9598bcc8..eeb10eb0 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift @@ -19,7 +19,7 @@ enum MyReflectionEndPoint: EndPointable { case .fetchCertainTypeFeedbackAllID(let reflectionId, let cssType): return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks?type=\(cssType.rawValue)" case .deleteUser: - return "\(UrlLiteral.baseUrl)/login/signout" + return "\(UrlLiteral.baseUrl2)/auth/signout" } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index f5892119..97198d5f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -308,6 +308,7 @@ final class HomeViewController: BaseViewController { headers: type.headers ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { + dump(json) let reflectionDetail = json.detail guard let reflectionStatus = reflectionDetail?.reflectionStatus, let reflectionId = reflectionDetail?.currentReflectionId diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift index d44c6445..2387d134 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift @@ -108,13 +108,16 @@ final class MyReflectionViewController: BaseViewController { } } + // MARK: - api + private func deleteUser(type: MyReflectionEndPoint) { AF.request(type.address, method: type.method, headers: type.headers ) .responseDecodable(of: BaseModel.self) { json in - if let _ = json.value { + if let json = json.value { + dump(json) UserDefaultHandler.clearAllData() guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate else { return } @@ -123,8 +126,6 @@ final class MyReflectionViewController: BaseViewController { } } - // MARK: - api - private func fetchAllReflection(type: MyReflectionEndPoint) { AF.request(type.address, method: type.method, From ef171f6ec52109bb24a791c93e27baa93cfed269 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 7 Apr 2023 00:47:54 +0900 Subject: [PATCH 280/388] =?UTF-8?q?[ADD]=20AddFeedback=20api=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84(#334)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reqeust/DTO/FeedBackContentDTO.swift | 2 -- .../Response/FeedBackContentResponse.swift | 18 ++++++++++++++++++ .../Network/Response/MemberResponse.swift | 8 ++++++++ .../AddFeedbackKeywordViewController.swift | 6 ++++-- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/FeedBackContentDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/FeedBackContentDTO.swift index 02d3ad53..4a1ed8c4 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/FeedBackContentDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/FeedBackContentDTO.swift @@ -11,9 +11,7 @@ struct FeedBackContentDTO: Encodable { let type: FeedBackDTO let keyword: String let content: String - let start_content: String? let to_id: Int - } enum FeedBackDTO: String, Encodable { diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift index 3d371e66..2e0d9109 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift @@ -33,3 +33,21 @@ struct FeedBackContentResponse: Decodable { case fromUser = "from_user" } } + +// MARK: - create feedback 용 / 나중에 FeedBackContentResponse 합치기 +struct SimpleFeedBackContentResponse: Decodable { + // MARK: - createFeedback + let id: Int? + let type: FeedBackType? + let keyword: String? + let content: String? + let toUser: SimpleMemberResponse? + + enum CodingKeys: String, CodingKey { + case id + case type + case keyword + case content + case toUser = "to_user" + } +} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift index c8b9ea8d..79edab12 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift @@ -34,3 +34,11 @@ struct TeamMemberResponse: Decodable { case profileImagePath = "profile_image_path" } } + +// MARK: - MemberResponse와 동일한 역할 v2용 + +struct SimpleMemberResponse: Decodable { + // MARK: - createFeedback(FeedBackContentResponse) + let id: Int? + let nickname: String? +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackKeywordViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackKeywordViewController.swift index 66fa500d..b9f91705 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackKeywordViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackKeywordViewController.swift @@ -231,7 +231,7 @@ final class AddFeedbackKeywordViewController: BaseViewController { let userId = feedbackContent.toUserId else { return } let contentString = feedbackContent.content - let dto = FeedBackContentDTO(type: type, keyword: keyword, content: contentString, start_content: nil, to_id: userId) + let dto = FeedBackContentDTO(type: type, keyword: keyword, content: contentString, to_id: userId) dispatchAddFeedBack(type: .dispatchAddFeedBack(reflectionId: feedbackContent.reflectionId, dto)) } @@ -243,12 +243,14 @@ final class AddFeedbackKeywordViewController: BaseViewController { parameters: type.body, encoder: JSONParameterEncoder.default, headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let data = json.value { dump(data) DispatchQueue.main.async { self.dismiss(animated: true) } + } else { + print("실패") } } } From e0aafb226f61ac1122eb6828c7036b7e0b628242 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 7 Apr 2023 01:21:15 +0900 Subject: [PATCH 281/388] =?UTF-8?q?[ADD]=20EditFeedback:=20endpoint=20&=20?= =?UTF-8?q?response=20=EC=88=98=EC=A0=95(#334)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/MyFeedBackEndPoint.swift | 2 +- .../Response/FeedBackInfoResponse.swift | 18 ++++-------------- .../UIComponent/MyFeedbackCollectionView.swift | 16 ++++++++-------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift index 91d0a000..844ce9c1 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift @@ -20,7 +20,7 @@ enum MyFeedBackEndPoint { case .fetchCertainMemberFeedBack(let memberId): return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/current/feedbacks/from-me?members=\(memberId)" case .deleteFeedBack(let reflectionId, let feedBackId): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)" case .putEditFeedBack(let reflectionId, let feedBackId, _): return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)" } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackInfoResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackInfoResponse.swift index df8ae6a6..d1c028d5 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackInfoResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackInfoResponse.swift @@ -9,24 +9,14 @@ import Foundation struct FeedBackInfoResponse: Decodable { // MARK: - getFromMeToCertainMemberFeedbackAll - let teamId: Int? - let reflectionId: Int? - let reflectionName: String? - let reflectionStatus: String? - let fromId: Int? - let toId: Int? - let toUsername: String? + let toUser: SimpleMemberResponse + let reflection: ReflectionResponse let continueArray: [KeywordResponse] let stopArray: [KeywordResponse] enum CodingKeys: String, CodingKey { - case teamId = "team_id" - case reflectionId = "reflection_id" - case reflectionName = "reflection_name" - case reflectionStatus = "reflection_status" - case fromId = "from_id" - case toId = "to_id" - case toUsername = "to_username" + case toUser = "to_user" + case reflection case continueArray = "Continue" case stopArray = "Stop" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift index e66dcbb2..36b3ea3c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift @@ -104,11 +104,11 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { let hasContinueStop = collectionView.numberOfSections == 2 let isContinueSection = indexPath.section == 0 if hasContinueStop { - let reflectionId = data.reflectionId ?? 0 + let reflectionId = data.reflection.id ?? 0 let feedbackId = isContinueSection ? data.continueArray[indexPath.item].id ?? 0 : data.stopArray[indexPath.item].id ?? 0 - let nickName = data.toUsername ?? "" + let nickName = data.toUser.nickname ?? "" let keyword = isContinueSection ? data.continueArray[indexPath.item].keyword ?? "" : data.stopArray[indexPath.item].keyword ?? "" @@ -118,7 +118,7 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { let start = isContinueSection ? data.continueArray[indexPath.item].startContent : data.stopArray[indexPath.item].startContent - let reflectionStatus = ReflectionStatus.init(rawValue: feedbackInfo?.reflectionStatus ?? "Before") + let reflectionStatus = ReflectionStatus.init(rawValue: feedbackInfo?.reflection.state?.rawValue ?? "Before") let data = FeedbackFromMeModel(reflectionId: reflectionId, feedbackId: feedbackId, @@ -133,11 +133,11 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { } else { let continueArray = data.continueArray let stopArray = data.stopArray - let reflectionStatus = ReflectionStatus.init(rawValue: data.reflectionStatus ?? "Before") + let reflectionStatus = ReflectionStatus.init(rawValue: data.reflection.state?.rawValue ?? "Before") if !continueArray.isEmpty { - let data = FeedbackFromMeModel(reflectionId: data.reflectionId ?? 0, + let data = FeedbackFromMeModel(reflectionId: data.reflection.id ?? 0, feedbackId: continueArray[indexPath.item].id ?? 0, - nickname: data.toUsername ?? "", + nickname: data.toUser.nickname ?? "", feedbackType: .continueType, keyword: continueArray[indexPath.item].keyword ?? "", info: continueArray[indexPath.item].content ?? "", @@ -146,9 +146,9 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { ) didTappedCell?(data) } else { - let data = FeedbackFromMeModel(reflectionId: data.reflectionId ?? 0, + let data = FeedbackFromMeModel(reflectionId: data.reflection.id ?? 0, feedbackId: stopArray[indexPath.item].id ?? 0, - nickname: data.toUsername ?? "", + nickname: data.toUser.nickname ?? "", feedbackType: .stopType, keyword: stopArray[indexPath.item].keyword ?? "", info: stopArray[indexPath.item].content ?? "", From d87a168bccec08de5038142e84ed4234069964a9 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 7 Apr 2023 01:35:21 +0900 Subject: [PATCH 282/388] =?UTF-8?q?[ADD]=20EditFeedback=20api=20v2=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20=EC=99=84=EB=A3=8C(#334)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/MyFeedBackEndPoint.swift | 2 +- .../Network/Reqeust/DTO/EditFeedBackDTO.swift | 1 - .../Network/Response/EditFeedBackResponse.swift | 14 +++++++++++++- .../MyFeedbackEditViewController.swift | 3 +-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift index 844ce9c1..f9259f5d 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyFeedBackEndPoint.swift @@ -22,7 +22,7 @@ enum MyFeedBackEndPoint { case .deleteFeedBack(let reflectionId, let feedBackId): return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)" case .putEditFeedBack(let reflectionId, let feedBackId, _): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks/\(feedBackId)" } } diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift index dac6d7b9..4f5db22d 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift @@ -11,5 +11,4 @@ struct EditFeedBackDTO: Encodable { let type: FeedBackDTO let keyword: String let content: String - let start_content: String? } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift index b643efb4..3171a455 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift @@ -9,5 +9,17 @@ import Foundation struct EditFeedBackResponse: Decodable { // MARK: - updateFeedback - let feedback: FeedBackResponse? + let id: Int + let type: FeedBackType + let keyword: String + let content: String + let toUser: SimpleMemberResponse + + enum CodingKeys: String, CodingKey { + case id + case type + case keyword + case content + case toUser = "to_user" + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift index c80759a4..6881d5b2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift @@ -257,8 +257,7 @@ final class MyFeedbackEditViewController: BaseViewController { private func didTappedDoneButton() { let dto = EditFeedBackDTO(type: feedbackType, keyword: keywordTextFieldView.keywordTextField.text ?? "", - content: feedbackContentTextView.text ?? "", - start_content: nil) + content: feedbackContentTextView.text ?? "") putEditFeedBack(type: .putEditFeedBack(reflectionId: feedbackDetail.reflectionId, feedBackId: feedbackDetail.feedbackId, dto)) } From 2ce492f85a561e2d04a5fa0e6dbd6bf45c3cfd10 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 7 Apr 2023 10:38:04 +0900 Subject: [PATCH 283/388] =?UTF-8?q?[CHORE]=20fetchPastReflectionList=20url?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20(#336)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift index 9598bcc8..e7d3b737 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift @@ -15,7 +15,7 @@ enum MyReflectionEndPoint: EndPointable { var address: String { switch self { case .fetchPastReflectionList(let teamId): - return "\(UrlLiteral.baseUrl)/teams/\(teamId)/reflections" + return "\(UrlLiteral.baseUrl2)/teams/\(teamId)/reflections" case .fetchCertainTypeFeedbackAllID(let reflectionId, let cssType): return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks?type=\(cssType.rawValue)" case .deleteUser: From 3a2c7ef2607200db0c767dd0334fc0c8272eca80 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 7 Apr 2023 11:00:10 +0900 Subject: [PATCH 284/388] =?UTF-8?q?[CHORE]=20getCertainTypeFeedbackAll=20v?= =?UTF-8?q?2=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8F=B0=EC=8A=A4=20=EB=B3=80=EA=B2=BD=20(#336)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/MyReflectionEndPoint.swift | 2 +- .../Network/Response/FeedBackResponse.swift | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift index e7d3b737..380f2c5f 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/MyReflectionEndPoint.swift @@ -17,7 +17,7 @@ enum MyReflectionEndPoint: EndPointable { case .fetchPastReflectionList(let teamId): return "\(UrlLiteral.baseUrl2)/teams/\(teamId)/reflections" case .fetchCertainTypeFeedbackAllID(let reflectionId, let cssType): - return "\(UrlLiteral.baseUrl)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks?type=\(cssType.rawValue)" + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/reflections/\(reflectionId)/feedbacks?type=\(cssType.rawValue)" case .deleteUser: return "\(UrlLiteral.baseUrl)/login/signout" } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackResponse.swift index 4618455b..d078ae04 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackResponse.swift @@ -12,12 +12,6 @@ struct FeedBackResponse: Decodable { let type: String? let keyword: String? let content: String? - let startContent: String? - let fromId: Int? - let toId: Int? - let teamId: Int? - let reflectionId: Int? - let reflection: ReflectionResponse? let fromUser: MemberResponse? enum CodingKeys: String, CodingKey { @@ -25,12 +19,6 @@ struct FeedBackResponse: Decodable { case type case keyword case content - case startContent = "start_content" - case fromId = "from_id" - case toId = "to_id" - case teamId = "team_id" - case reflectionId = "reflection_id" - case reflection case fromUser = "from_user" } } From a9bfedcc9def832231aced15148b3565cc1c85d9 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 7 Apr 2023 13:43:49 +0900 Subject: [PATCH 285/388] =?UTF-8?q?[FEAT]=20statusbar=20height=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80=20(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIViewController+Extension.swift | 8 ++++++++ .../TeamDetail/TeamDetailViewController.swift | 19 +++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift index 7407a05c..fb8c6548 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/UIViewController+Extension.swift @@ -8,6 +8,14 @@ import UIKit extension UIViewController { + var statusBarHeight: CGFloat { + if #available(iOS 13.0, *) { + return UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0 + } else { + return UIApplication.shared.statusBarFrame.height + } + } + func makeAlert(title: String, message: String? = nil, okAction: ((UIAlertAction) -> Void)? = nil, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index ebb42a11..e1b00aba 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -113,19 +113,12 @@ final class TeamDetailViewController: BaseViewController { $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) $0.height.equalTo(16) } - let size = TeamDetailMembersView.PropertySize.self - let topInset: CGFloat = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.size.height - let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height - let bottomInset: CGFloat = hasHomeIndicator ? 34 : 0 - let minHeight = view.frame.size.height - topInset - size.navigationBarHeight - size.tableViewTopProperty - size.tableViewBottomProperty - bottomInset - 60 - let currentHeight = (size.cellSize + size.cellSpacing) * CGFloat(memberTableView.members.count) + size.headerViewHeight + size.cellSpacing - let height = max(minHeight, currentHeight) contentView.addSubview(memberTableView) memberTableView.snp.makeConstraints { $0.top.equalTo(memberTitleLabel.snp.bottom).offset(20) $0.leading.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) - $0.height.equalTo(height) + $0.height.equalTo(calculateHeight()) } contentView.addSubview(firstFullDividerView) @@ -203,4 +196,14 @@ final class TeamDetailViewController: BaseViewController { } teamLeaveButton.addAction(action, for: .touchUpInside) } + + private func calculateHeight() -> CGFloat { + let size = TeamDetailMembersView.PropertySize.self + let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height + let bottomInset: CGFloat = hasHomeIndicator ? 34 : 0 + let minHeight = view.frame.size.height - statusBarHeight - size.navigationBarHeight - size.tableViewTopProperty - size.tableViewBottomProperty - bottomInset - 60 + let currentHeight = (size.cellSize + size.cellSpacing) * CGFloat(memberTableView.members.count) + size.headerViewHeight + size.cellSpacing + let height = max(minHeight, currentHeight) + return height + } } From b055838a2596bfbb7c4995d663122affe6e4e0e1 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 7 Apr 2023 13:51:44 +0900 Subject: [PATCH 286/388] =?UTF-8?q?[CHORE]=20=ED=83=AD=EB=B0=94,=20?= =?UTF-8?q?=EB=84=A4=EB=B9=84=EA=B2=8C=EC=9D=B4=EC=85=98=EB=B0=94=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95(#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index e1b00aba..5a42f9d8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -74,10 +74,9 @@ final class TeamDetailViewController: BaseViewController { setupExitButton() } - override func configUI() { - super.configUI() - navigationController?.isNavigationBarHidden = false - self.tabBarController?.tabBar.isHidden = true + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + setupNavigationAndTapbar() } override func render() { @@ -197,6 +196,11 @@ final class TeamDetailViewController: BaseViewController { teamLeaveButton.addAction(action, for: .touchUpInside) } + private func setupNavigationAndTapbar() { + navigationController?.isNavigationBarHidden = false + self.tabBarController?.tabBar.isHidden = true + } + private func calculateHeight() -> CGFloat { let size = TeamDetailMembersView.PropertySize.self let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height From 76294d3190b5cd650ec4638a1a36e855d97fea21 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 7 Apr 2023 15:03:48 +0900 Subject: [PATCH 287/388] =?UTF-8?q?[CHORE]=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift | 2 +- .../Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift index c16da8bb..e5aa5cca 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableHeaderView.swift @@ -51,7 +51,7 @@ final class TeamDetailMemberTableHeaderView: UITableViewHeaderFooterView { memberInformationView.profileNicknameLabel.text = nickname memberInformationView.profileRoleLabel.text = role if let imagePath { - memberInformationView.profileImageView.load(from: UrlLiteral.iamgeBaseUrl + imagePath) + memberInformationView.profileImageView.load(from: UrlLiteral.imageBaseURL + imagePath) } } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift index a932f95e..8a2e0718 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift @@ -28,7 +28,7 @@ final class TeamDetailMemberTableViewCell: BaseTableViewCell { memberInfoView.profileNicknameLabel.text = nickname memberInfoView.profileRoleLabel.text = role if let imagePath { - memberInfoView.profileImageView.load(from: UrlLiteral.iamgeBaseUrl + imagePath) + memberInfoView.profileImageView.load(from: UrlLiteral.imageBaseURL + imagePath) } } } From 60a20e8b4276c7de0c3ee1cea7dcf63d116180f4 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 7 Apr 2023 15:04:53 +0900 Subject: [PATCH 288/388] =?UTF-8?q?[CHORE]=20=EC=A4=91=EB=B3=B5=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=88=98=EC=A0=95=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index e9869ce8..b0cf4012 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -207,16 +207,8 @@ final class TeamDetailViewController: BaseViewController { } private func updateLayout() { - let size = TeamDetailMembersView.PropertySize.self - let topInset: CGFloat = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.size.height - let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height - let bottomInset: CGFloat = hasHomeIndicator ? 34 : 0 - let minHeight = view.frame.size.height - topInset - size.navigationBarHeight - size.tableViewTopProperty - size.tableViewBottomProperty - bottomInset - 60 - let currentHeight = (size.cellSize + size.cellSpacing) * CGFloat(memberTableView.members.count) + size.headerViewHeight + size.cellSpacing - let height = max(minHeight, currentHeight) - memberTableView.snp.updateConstraints { - $0.height.equalTo(height) + $0.height.equalTo(calculateHeight()) } } From caa091f4e80dbdbf045d9b84828386732901fe24 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 7 Apr 2023 15:17:33 +0900 Subject: [PATCH 289/388] =?UTF-8?q?[CHORE]=20=ED=95=A8=EC=88=98=EB=AA=85?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamDetailEndPoint.swift | 10 +++++----- .../Home/TeamDetail/TeamDetailViewController.swift | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift index ce1be6a5..add18540 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -10,7 +10,7 @@ import Alamofire enum TeamDetailEndPoint: EndPointable { case fetchTeamMember case fetchTeamInformation - case deleteLeaveTeam + case deleteTeam case fetchUserTeamList var address: String { @@ -21,7 +21,7 @@ enum TeamDetailEndPoint: EndPointable { case .fetchTeamInformation: return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)" - case .deleteLeaveTeam: + case .deleteTeam: return "\(UrlLiteral.baseUrl2)/users/team/\(UserDefaultStorage.teamId)/leave" case .fetchUserTeamList: @@ -37,7 +37,7 @@ enum TeamDetailEndPoint: EndPointable { case .fetchTeamInformation: return .get - case .deleteLeaveTeam: + case .deleteTeam: return .delete case .fetchUserTeamList: @@ -53,7 +53,7 @@ enum TeamDetailEndPoint: EndPointable { case .fetchTeamInformation: return nil - case .deleteLeaveTeam: + case .deleteTeam: return nil case .fetchUserTeamList: @@ -77,7 +77,7 @@ enum TeamDetailEndPoint: EndPointable { ] return HTTPHeaders(headers) - case .deleteLeaveTeam: + case .deleteTeam: let headers = [ "access_token": "\(UserDefaultStorage.accessToken)", "refresh_token": "\(UserDefaultStorage.refreshToken)" diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index b0cf4012..3ace51b4 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -193,7 +193,7 @@ final class TeamDetailViewController: BaseViewController { message: TextLiteral.teamDetailViewControllerLeaveTeamAlertMessage, okTitle: TextLiteral.leaveTitle, okAction: { _ in - self?.deleteLeaveTeam(type: .deleteLeaveTeam) + self?.deleteLeaveTeam(type: .deleteTeam) }) } teamLeaveButton.addAction(action, for: .touchUpInside) From a652a3e3f1de7897da0c0f1a366da19d113c48cb Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 7 Apr 2023 15:28:40 +0900 Subject: [PATCH 290/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20API=ED=95=A8=EC=88=98=20viewWillAppear=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 3ace51b4..f35b95e8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -73,12 +73,12 @@ final class TeamDetailViewController: BaseViewController { setupExitButton() setupCodeShareButton() fetchTeamDetailMember(type: .fetchTeamMember) - fetchTeamInformation(type: .fetchTeamInformation) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) setupNavigationAndTapbar() + fetchTeamInformation(type: .fetchTeamInformation) } override func render() { From 5478636e2a72a7fc8066876575dd17f0db7d667d Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 7 Apr 2023 15:29:56 +0900 Subject: [PATCH 291/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EB=A9=A4?= =?UTF-8?q?=EB=B2=84=20=ED=95=A8=EC=88=98=20viewWillAppear=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99=20(#326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index f35b95e8..57e385b7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -72,12 +72,12 @@ final class TeamDetailViewController: BaseViewController { setupEditButton() setupExitButton() setupCodeShareButton() - fetchTeamDetailMember(type: .fetchTeamMember) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) setupNavigationAndTapbar() + fetchTeamDetailMember(type: .fetchTeamMember) fetchTeamInformation(type: .fetchTeamInformation) } From 5655affdab6cdde7f0d54a5385a45543e8ab1a44 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 7 Apr 2023 15:35:42 +0900 Subject: [PATCH 292/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamInfoEndPoint.swift | 2 +- .../Setup/SetNickname/SetNicknameViewController.swift | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift index f229a55a..4d93ec3d 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamInfoEndPoint.swift @@ -17,7 +17,7 @@ enum TeamInfoEndPoint: EndPointable { } } - var method: Alamofire.HTTPMethod { + var method: HTTPMethod { switch self { case .fetchUserTeamList: return .get diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 258a8032..7ce954fb 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -312,15 +312,6 @@ final class SetNicknameViewController: BaseViewController { let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) } - // FIXME: 진저가 확인 후 코드리뷰 시 삭제 예정 -// if UserDefaultStorage.teamId == 0 { -// let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) -// dispatchCreateTeam(type: .dispatchCreateTeam(dto)) -// } else { -// let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) -// dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) -// } - nicknameTextField.resignFirstResponder() roleTextField.resignFirstResponder() } From 649841fba7b1d835abc769f4b9e03ecf91dbdf94 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 7 Apr 2023 15:48:15 +0900 Subject: [PATCH 293/388] =?UTF-8?q?[CHORE]=20=EC=BB=A8=ED=94=8C=EB=A6=AD?= =?UTF-8?q?=ED=8A=B8=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Setup/SetNickname/SetNicknameViewController.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index e14315f9..0c148c10 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -312,12 +312,10 @@ final class SetNicknameViewController: BaseViewController { // FIXME: - 이미지 데이터 추가 if fromView == .createView { - let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role, profile_image: nil) - dispatchCreateTeam(type: .dispatchCreateTeam(dto)) + dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) } else if fromView == .joinView { - let dto = JoinTeamDTO(nickname: nickname, role: role, profile_image: nil) - dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) + dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId), nickname: nickname, role: role) } nicknameTextField.resignFirstResponder() roleTextField.resignFirstResponder() From 5e3d5bf3ab527681cd2fc70f01008adf368a1e0b Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 7 Apr 2023 15:53:03 +0900 Subject: [PATCH 294/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=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 --- .../Screen/Home/Home/TeamManageViewController.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 2c24df04..80e0fc19 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -198,8 +198,7 @@ final class TeamManageViewController: BaseViewController { AF.request(type.address, method: type.method, headers: type.headers - ) - .responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let _ = json.value { UserDefaultHandler.clearAllData() guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate From 688143eac0b08434c8e4ec08bd49148d8887814a Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:18:50 +0900 Subject: [PATCH 295/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/JoinTeam/JoinTeamViewController.swift | 7 +++---- .../Setup/SetNickname/SetNicknameViewController.swift | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index 4cd5b211..c85ea474 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -126,22 +126,21 @@ final class JoinTeamViewController: BaseTextFieldViewController { override func setupNavigationBar() { super.setupNavigationBar() - if fromView == .loginView { + switch fromView { + case .loginView: let button = removeBarButtonItemOffset(with: backButton, offsetX: 10) let backButton = makeBarButtonItem(with: button) navigationController?.navigationBar.prefersLargeTitles = false navigationItem.largeTitleDisplayMode = .never navigationItem.leftBarButtonItem = backButton - } - else if fromView == .teamManageView { + case .teamManageView: let button = removeBarButtonItemOffset(with: closeButton, offsetX: -10) let closeButton = makeBarButtonItem(with: button) navigationController?.navigationBar.prefersLargeTitles = false navigationItem.largeTitleDisplayMode = .never navigationItem.rightBarButtonItem = closeButton - } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 0c148c10..b7bed565 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -309,14 +309,14 @@ final class SetNicknameViewController: BaseViewController { private func didTappedDoneButton() { guard let nickname = nicknameTextField.text else { return } guard let role = roleTextField.text else { return } - // FIXME: - 이미지 데이터 추가 - if fromView == .createView { + switch fromView { + case .createView: dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) - } - else if fromView == .joinView { + case .joinView: dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId), nickname: nickname, role: role) } + nicknameTextField.resignFirstResponder() roleTextField.resignFirstResponder() } From 561f6f9b1a4a93b5fe611118433fa737418a4e15 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:20:54 +0900 Subject: [PATCH 296/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 4 +--- .../Screen/Setup/JoinTeam/JoinTeamViewController.swift | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 80e0fc19..b2d4d7ef 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -59,9 +59,7 @@ final class TeamManageViewController: BaseViewController { } @available(*, unavailable) - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } + required init?(coder: NSCoder) { nil } override func viewDidLoad() { super.viewDidLoad() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index c85ea474..630d8da8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -98,9 +98,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { } @available(*, unavailable) - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } + required init?(coder: NSCoder) { nil } override func viewDidLoad() { super.viewDidLoad() From 5f087b02c080391174134490ca128dcc3177d379 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:23:43 +0900 Subject: [PATCH 297/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index b7bed565..28915f5b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -120,9 +120,7 @@ final class SetNicknameViewController: BaseViewController { } @available(*, unavailable) - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } + required init?(coder: NSCoder) { nil } override func viewDidLoad() { super.viewDidLoad() From d7aaa42af3343a45f12678b5ec16bb8eabdb4efb Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Tue, 11 Apr 2023 01:11:33 +0900 Subject: [PATCH 298/388] [CHORE] launchscreen.storyboard file added --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 +++++ .../Setup/Launch/LaunchScreen.storyboard | 48 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Setup/Launch/LaunchScreen.storyboard diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 441d183b..c7781a9f 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -118,6 +118,7 @@ 3EB508922917585600FB77CB /* UICollectionView + Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB508912917585600FB77CB /* UICollectionView + Extension.swift */; }; 3EDED991293B8CE00000B4DC /* AddFeedbackContentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EDED990293B8CE00000B4DC /* AddFeedbackContentViewController.swift */; }; 3EDED995293C81EC0000B4DC /* AddFeedbackKeywordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EDED994293C81EC0000B4DC /* AddFeedbackKeywordViewController.swift */; }; + 3EF7909B29E462F50052578E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3EF7909A29E462F50052578E /* LaunchScreen.storyboard */; }; 520FEC44292234C0009FC1F2 /* FeedbackToMeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 520FEC43292234C0009FC1F2 /* FeedbackToMeModel.swift */; }; 522D99BF29041B51009CBD95 /* CustomTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522D99BE29041B51009CBD95 /* CustomTextView.swift */; }; 523EDFB329D451590033F9A5 /* UIImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 523EDFB229D451590033F9A5 /* UIImage+Extension.swift */; }; @@ -279,6 +280,7 @@ 3EB508912917585600FB77CB /* UICollectionView + Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionView + Extension.swift"; sourceTree = ""; }; 3EDED990293B8CE00000B4DC /* AddFeedbackContentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedbackContentViewController.swift; sourceTree = ""; }; 3EDED994293C81EC0000B4DC /* AddFeedbackKeywordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedbackKeywordViewController.swift; sourceTree = ""; }; + 3EF7909A29E462F50052578E /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 520FEC43292234C0009FC1F2 /* FeedbackToMeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackToMeModel.swift; sourceTree = ""; }; 522D99BE29041B51009CBD95 /* CustomTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextView.swift; sourceTree = ""; }; 523EDFB229D451590033F9A5 /* UIImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extension.swift"; sourceTree = ""; }; @@ -846,6 +848,14 @@ path = MyReflection; sourceTree = ""; }; + 3EF7909929E460370052578E /* Launch */ = { + isa = PBXGroup; + children = ( + 3EF7909A29E462F50052578E /* LaunchScreen.storyboard */, + ); + path = Launch; + sourceTree = ""; + }; 520FEC42292234AF009FC1F2 /* FeedbackToMe */ = { isa = PBXGroup; children = ( @@ -1060,6 +1070,7 @@ D724790A28FEC8A800D67B50 /* Setup */ = { isa = PBXGroup; children = ( + 3EF7909929E460370052578E /* Launch */, 39307CF32917DA8A00789AB6 /* Login */, 52B21E5229248DC30048964C /* SetNickname */, 52B21E5329248DD80048964C /* JoinTeam */, @@ -1155,6 +1166,7 @@ buildActionMask = 2147483647; files = ( 39257DD128F8FEBE00201E0B /* LaunchScreen.storyboard in Resources */, + 3EF7909B29E462F50052578E /* LaunchScreen.storyboard in Resources */, 3998E86F295C308100541752 /* Settings.bundle in Resources */, 39257DCE28F8FEBE00201E0B /* Assets.xcassets in Resources */, ); diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/Launch/LaunchScreen.storyboard b/Maddori.Apple/Maddori.Apple/Screen/Setup/Launch/LaunchScreen.storyboard new file mode 100644 index 00000000..f0d4540a --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/Launch/LaunchScreen.storyboard @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 38b09141cd8b4cdd349346af54826d973fbb466d Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 15:14:10 +0900 Subject: [PATCH 299/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20View=EC=B6=94=EA=B0=80=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 ++++++++++++ .../EditTeamName/EditTeamNameViewController.swift | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 441d183b..7c7e0f50 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 391596622904176500A432D9 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391596612904176500A432D9 /* UIView+Extension.swift */; }; + 391612CD29E51F1B004AE982 /* EditTeamNameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */; }; 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; @@ -168,6 +169,7 @@ /* Begin PBXFileReference section */ 391596612904176500A432D9 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; + 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameViewController.swift; sourceTree = ""; }; 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; @@ -340,6 +342,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 391612CB29E51F03004AE982 /* EditTeamName */ = { + isa = PBXGroup; + children = ( + 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */, + ); + path = EditTeamName; + sourceTree = ""; + }; 391CBA17290580360044CA30 /* InProgressDetail */ = { isa = PBXGroup; children = ( @@ -580,6 +590,7 @@ 3977E11F2910CECB000E9761 /* Home */ = { isa = PBXGroup; children = ( + 391612CB29E51F03004AE982 /* EditTeamName */, 3E557FC128FE7B9200714E46 /* Home */, 395C7E1928FEC3FB00FC2FCA /* CreateReflection */, 525E721D28FFC85200EF3FCB /* AddFeedback */, @@ -1171,6 +1182,7 @@ 395C7E2028FED7B500FC2FCA /* ReflectionNameView.swift in Sources */, 3E953A9529C1CE7D0073302F /* ImageCacheManager.swift in Sources */, 39F52C44292329BA00B19A77 /* BaseModel.swift in Sources */, + 391612CD29E51F1B004AE982 /* EditTeamNameViewController.swift in Sources */, 522D99BF29041B51009CBD95 /* CustomTextView.swift in Sources */, 3EA341C129221998005CBD1C /* ToastContentView.swift in Sources */, D70AF89729C2FDF6003A500C /* TeamInfoEndPoint.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift new file mode 100644 index 00000000..41a15d4d --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -0,0 +1,8 @@ +// +// EditTeamNameViewController.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/04/11. +// + +import Foundation From ac0f57c6a9d53fd374e87a6181cab51ef289e295 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 15:17:07 +0900 Subject: [PATCH 300/388] =?UTF-8?q?[FEAT]=20tabbar,=20navigationBar=20?= =?UTF-8?q?=EA=B0=80=EB=A6=AC=EA=B8=B0=20=EC=88=98=EC=A0=95=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 3 ++- .../TeamDetail/TeamDetailViewController.swift | 19 +++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index bb9e41e5..4daa97a0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -104,6 +104,7 @@ final class HomeViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + navigationController?.isNavigationBarHidden = true setLayoutTeamManageButton() fetchCertainTeamDetail(type: .fetchCertainTeamDetail) fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) @@ -111,7 +112,6 @@ final class HomeViewController: BaseViewController { } override func configUI() { - navigationController?.isNavigationBarHidden = true view.backgroundColor = .white200 } @@ -282,6 +282,7 @@ final class HomeViewController: BaseViewController { private func pushTeamDetailViewController() { let viewController = TeamDetailViewController() + viewController.hidesBottomBarWhenPushed = true self.navigationController?.pushViewController(viewController, animated: true) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 57e385b7..335b16fa 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -68,6 +68,7 @@ final class TeamDetailViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() + self.navigationController?.isNavigationBarHidden = false setupBackButton() setupEditButton() setupExitButton() @@ -76,7 +77,6 @@ final class TeamDetailViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - setupNavigationAndTapbar() fetchTeamDetailMember(type: .fetchTeamMember) fetchTeamInformation(type: .fetchTeamInformation) } @@ -165,11 +165,6 @@ final class TeamDetailViewController: BaseViewController { navigationItem.leftBarButtonItem = backButton } - override func viewWillDisappear(_ animated: Bool) { - navigationController?.isNavigationBarHidden = true - self.tabBarController?.tabBar.isHidden = false - } - // MARK: - func private func setupBackButton() { @@ -180,9 +175,10 @@ final class TeamDetailViewController: BaseViewController { } private func setupEditButton() { - let action = UIAction { _ in - // FIXME: - 방 정보 수정 view 연결 - print("action") + let action = UIAction { [weak self] _ in + let viewController = EditTeamNameViewController() + viewController.hidesBottomBarWhenPushed = true + self?.navigationController?.pushViewController(viewController, animated: true) } self.editButton.addAction(action, for: .touchUpInside) } @@ -274,11 +270,6 @@ final class TeamDetailViewController: BaseViewController { } } - private func setupNavigationAndTapbar() { - navigationController?.isNavigationBarHidden = false - self.tabBarController?.tabBar.isHidden = true - } - private func calculateHeight() -> CGFloat { let size = TeamDetailMembersView.PropertySize.self let hasHomeIndicator = UIScreen.main.bounds.width * 2 < UIScreen.main.bounds.height From 67a39f99c06e4c4a3221e1dd656b64e657d94ded Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 15:17:27 +0900 Subject: [PATCH 301/388] =?UTF-8?q?[CHORE]=20=EB=A9=A4=EB=B2=84=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EB=B2=84=EA=B7=B8=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/UIComponent/TeamDetailMembersView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index c534f6dc..e1af1976 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -63,6 +63,7 @@ final class TeamDetailMembersView: UIView { } func loadData(data: [MemberDetailResponse]) { + members.removeAll() data.forEach { if $0.userId == UserDefaultStorage.userId { currentMember = $0 From d18b904ec9c35124b55b0693c84b561abc262f7c Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 15:23:57 +0900 Subject: [PATCH 302/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20view=20UI=20=EC=99=84=EC=84=B1=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/TextLiteral.swift | 4 ++ .../EditTeamNameViewController.swift | 69 ++++++++++++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 8cce3a9f..acc203b5 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -264,4 +264,8 @@ enum TextLiteral { static let teamDetailViewControllerLeaveTeamLabel: String = "팀 나가기" static let teamDetailViewControllerLeaveTeamAlertTitle: String = "팀에서 나가시겠습니까?" static let teamDetailViewControllerLeaveTeamAlertMessage: String = "모든 회고와 피드백 정보가 사라지며,\n되돌릴 수 없습니다." + + // MARK: - EditTeamNameView + + static let editTeamLabelText: String = "팀 이름을 수정해 주세요" } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index 41a15d4d..96abd22a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -5,4 +5,71 @@ // Created by Mingwan Choi on 2023/04/11. // -import Foundation +import UIKit + +final class EditTeamNameViewController: BaseTextFieldViewController { + override var titleText: String { + get { + return TextLiteral.editTeamLabelText + } + + set { + super.titleText = newValue + } + } + + override var placeholderText: String { + get { + // FIXME: - place holder의 내용이 피그마에 없음. + return "수정할 팀 이름을 입력해 주세요." + } + + set { + super.placeholderText = newValue + } + } + + override var maxLength: Int { + get { + return 10 + } + + set { + super.maxLength = newValue + } + } + + override var buttonText: String { + get { + return TextLiteral.doneButtonComplete + } + + set { + super.buttonText = newValue + } + } + + // MARK: - property + + private lazy var backButton: BackButton = { + let button = BackButton() + let action = UIAction { [weak self] _ in + self?.navigationController?.popViewController(animated: true) + } + button.addAction(action, for: .touchUpInside) + return button + }() + + // MARK: - life cycle + + override func setupNavigationBar() { + super.setupNavigationBar() + + let button = removeBarButtonItemOffset(with: backButton, offsetX: 10) + let backButton = makeBarButtonItem(with: button) + + navigationController?.navigationBar.prefersLargeTitles = false + navigationItem.largeTitleDisplayMode = .never + navigationItem.leftBarButtonItem = backButton + } +} From e6afb788a891bc11b54407868cb4768249460a79 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 15:57:27 +0900 Subject: [PATCH 303/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20API=20=EC=B6=94=EA=B0=80=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 +++++ .../EndPoint/EditTeamNameEndPoint.swift | 44 +++++++++++++++++++ .../Network/Reqeust/DTO/EditTeamNameDTO.swift | 12 +++++ .../Response/EditTeamNameResponse.swift | 18 ++++++++ 4 files changed, 86 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Network/EndPoint/EditTeamNameEndPoint.swift create mode 100644 Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditTeamNameDTO.swift create mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/EditTeamNameResponse.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 7c7e0f50..b4999385 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -9,6 +9,9 @@ /* Begin PBXBuildFile section */ 391596622904176500A432D9 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391596612904176500A432D9 /* UIView+Extension.swift */; }; 391612CD29E51F1B004AE982 /* EditTeamNameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */; }; + 391612CF29E5352A004AE982 /* EditTeamNameEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */; }; + 391612D129E5364A004AE982 /* EditTeamNameDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */; }; + 391612D329E53745004AE982 /* EditTeamNameResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D229E53745004AE982 /* EditTeamNameResponse.swift */; }; 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; @@ -170,6 +173,9 @@ /* Begin PBXFileReference section */ 391596612904176500A432D9 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameViewController.swift; sourceTree = ""; }; + 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameEndPoint.swift; sourceTree = ""; }; + 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameDTO.swift; sourceTree = ""; }; + 391612D229E53745004AE982 /* EditTeamNameResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameResponse.swift; sourceTree = ""; }; 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; @@ -737,6 +743,7 @@ 39F909D6292679C400DAD0A3 /* EditFeedBackDTO.swift */, 7EE38BAC2925DDD200FD738D /* EncodeDTO.swift */, 396334D6292DADBE00E74B77 /* AppleLoginDTO.swift */, + 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */, ); path = DTO; sourceTree = ""; @@ -773,6 +780,7 @@ 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */, 396334DA292DAE8300E74B77 /* UserResponse.swift */, 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */, + 391612D229E53745004AE982 /* EditTeamNameResponse.swift */, ); path = Response; sourceTree = ""; @@ -789,6 +797,7 @@ 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */, 391D38F429D54CBA00A6BFED /* TeamDetailEndPoint.swift */, D70AF89629C2FDF6003A500C /* TeamInfoEndPoint.swift */, + 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */, ); path = EndPoint; sourceTree = ""; @@ -1229,6 +1238,7 @@ 39F5582B2908027500CD6F6E /* UIDevice+Extension.swift in Sources */, 395C7E1328F9841A00FC2FCA /* SizeLiteral.swift in Sources */, 52E6770F29911E3E00A0935B /* ReflectionMemberCollectionView.swift in Sources */, + 391612D329E53745004AE982 /* EditTeamNameResponse.swift in Sources */, 3EB508902917525600FB77CB /* EmptyReflectionView.swift in Sources */, D7A585292990DB0D00E1F4EE /* Option.swift in Sources */, 3EB5088E2916D05F00FB77CB /* EmptyFeedbackView.swift in Sources */, @@ -1303,6 +1313,7 @@ 39257DED28F9378D00201E0B /* BaseCollectionViewCell.swift in Sources */, 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */, 39F1A13C2912637E005E3456 /* MyFeedbackMemberCollectionViewCell.swift in Sources */, + 391612CF29E5352A004AE982 /* EditTeamNameEndPoint.swift in Sources */, 3E5195A42928C8FB00710A01 /* CreateReflectionEndPoint.swift in Sources */, 525E721A28FF0F1900EF3FCB /* MemberCollectionViewCell.swift in Sources */, 395C7E2228FEDB6500FC2FCA /* UITextField+Extension.swift in Sources */, @@ -1318,6 +1329,7 @@ 3EB5088C2916C64800FB77CB /* EmptyFeedbackKeyword.swift in Sources */, 39436C15291287A00083D77A /* MyFeedbackCollectionViewCell.swift in Sources */, 3EA341E62924E2AD005CBD1C /* HomeEndPoint.swift in Sources */, + 391612D129E5364A004AE982 /* EditTeamNameDTO.swift in Sources */, 395C7E0D28F959A500FC2FCA /* MainButton.swift in Sources */, 396334DB292DAE8300E74B77 /* UserResponse.swift in Sources */, 3EB508622912B12700FB77CB /* MyReflectionCollectionViewHeader.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/EditTeamNameEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/EditTeamNameEndPoint.swift new file mode 100644 index 00000000..80051ff6 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/EditTeamNameEndPoint.swift @@ -0,0 +1,44 @@ +// +// EditTeamNameEndPoint.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/04/11. +// + +import Alamofire + +enum EditTeamNameEndPoint: EndPointable { + case patchEditTeamName(T) + + var address: String { + switch self { + case .patchEditTeamName: + return "\(UrlLiteral.baseUrl2)/teams/\(UserDefaultStorage.teamId)/team-name" + } + } + + var method: Alamofire.HTTPMethod { + switch self { + case .patchEditTeamName: + return .patch + } + } + + var body: T? { + switch self { + case .patchEditTeamName(let body): + return body + } + } + + var headers: Alamofire.HTTPHeaders? { + switch self { + case .patchEditTeamName: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)" + ] + return HTTPHeaders(headers) + } + } +} diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditTeamNameDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditTeamNameDTO.swift new file mode 100644 index 00000000..5bb6bef6 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditTeamNameDTO.swift @@ -0,0 +1,12 @@ +// +// EditTeamNameDTO.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/04/11. +// + +import Foundation + +struct EditTeamNameDTO: Encodable { + let team_name: String +} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/EditTeamNameResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/EditTeamNameResponse.swift new file mode 100644 index 00000000..2825dda8 --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/Response/EditTeamNameResponse.swift @@ -0,0 +1,18 @@ +// +// EditTeamNameResponse.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/04/11. +// + +import Foundation + +struct EditTeamNameResponse: Decodable { + let id: Int + let teamName: String + + enum CodingKeys: String, CodingKey { + case id + case teamName = "team_name" + } +} From 7b127922467d997d8f64203a05ff58fc941f6801 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 15:58:04 +0900 Subject: [PATCH 304/388] =?UTF-8?q?[FEAT]=20=ED=8C=80=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EditTeamNameViewController.swift | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index 96abd22a..22661d5a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -7,6 +7,8 @@ import UIKit +import Alamofire + final class EditTeamNameViewController: BaseTextFieldViewController { override var titleText: String { get { @@ -62,6 +64,11 @@ final class EditTeamNameViewController: BaseTextFieldViewController { // MARK: - life cycle + override func viewDidLoad() { + super.viewDidLoad() + setupDoneButton() + } + override func setupNavigationBar() { super.setupNavigationBar() @@ -72,4 +79,31 @@ final class EditTeamNameViewController: BaseTextFieldViewController { navigationItem.largeTitleDisplayMode = .never navigationItem.leftBarButtonItem = backButton } + + // MARK: - func + + private func setupDoneButton() { + let action = UIAction { [weak self] _ in + guard let teamName = self?.kigoTextField.text else { return } + self?.dispatchTeamName(type: .patchEditTeamName(EditTeamNameDTO(team_name: teamName))) + } + self.doneButton.addAction(action, for: .touchUpInside) + } + + // MARK: - api + + private func dispatchTeamName(type: EditTeamNameEndPoint) { + AF.request( + type.address, + method: type.method, + parameters: type.body, + encoder: JSONParameterEncoder.default, + headers: type.headers + ).responseDecodable(of: BaseModel.self) { json in + if let data = json.value { + dump(data) + self.navigationController?.popViewController(animated: true) + } + } + } } From 21e632b7a1837c8ea8eac6d9de3dfbc91acd4a20 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 16:40:55 +0900 Subject: [PATCH 305/388] =?UTF-8?q?[ADD]=20=EC=B4=88=EB=8C=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EA=B3=B5=EC=9C=A0=ED=95=98=EA=B8=B0=20->=20?= =?UTF-8?q?=EB=B3=B5=EC=82=AC=ED=95=98=EA=B8=B0=20(#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 2 +- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 8cce3a9f..993e3d3a 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -260,7 +260,7 @@ enum TextLiteral { static let changeTeamViewLabel: String = "참여 중인 팀" static let teamDetailViewControllerMemberTitleLabel: String = "멤버" - static let teamDetailViewControllerShareCodeText: String = "초대코드 공유하기" + static let teamDetailViewControllerCopyCodeText: String = "초대코드 복사하기" static let teamDetailViewControllerLeaveTeamLabel: String = "팀 나가기" static let teamDetailViewControllerLeaveTeamAlertTitle: String = "팀에서 나가시겠습니까?" static let teamDetailViewControllerLeaveTeamAlertMessage: String = "모든 회고와 피드백 정보가 사라지며,\n되돌릴 수 없습니다." diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 57e385b7..b39df4d7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -44,7 +44,7 @@ final class TeamDetailViewController: BaseViewController { private let firstFullDividerView = FullDividerView() private let codeShareButton: UIButton = { let button = UIButton(type: .system) - button.setTitle(TextLiteral.teamDetailViewControllerShareCodeText, for: .normal) + button.setTitle(TextLiteral.teamDetailViewControllerCopyCodeText, for: .normal) button.setTitleColor(.blue200, for: .normal) button.titleLabel?.font = .label2 return button From 82ff7e99ccd563518b2b55d2ac99b1d0e29c20e9 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 17:45:08 +0900 Subject: [PATCH 306/388] =?UTF-8?q?[ADD]=20ToastView=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=ED=99=94=20(#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 + .../Global/UIComponent/View/ToastView.swift | 128 ++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastView.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 441d183b..d3da8346 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 391596622904176500A432D9 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391596612904176500A432D9 /* UIView+Extension.swift */; }; + 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; @@ -168,6 +169,7 @@ /* Begin PBXFileReference section */ 391596612904176500A432D9 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; + 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; @@ -652,6 +654,7 @@ 52F0CB5129178C2700E39C50 /* AlertViewController.swift */, 3EA341C029221998005CBD1C /* ToastContentView.swift */, 3975CEAE293EEDD6002D4F1A /* KeywordView.swift */, + 391612D429E551BD004AE982 /* ToastView.swift */, ); path = View; sourceTree = ""; @@ -1217,6 +1220,7 @@ 39F5582B2908027500CD6F6E /* UIDevice+Extension.swift in Sources */, 395C7E1328F9841A00FC2FCA /* SizeLiteral.swift in Sources */, 52E6770F29911E3E00A0935B /* ReflectionMemberCollectionView.swift in Sources */, + 391612D529E551BD004AE982 /* ToastView.swift in Sources */, 3EB508902917525600FB77CB /* EmptyReflectionView.swift in Sources */, D7A585292990DB0D00E1F4EE /* Option.swift in Sources */, 3EB5088E2916D05F00FB77CB /* EmptyFeedbackView.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastView.swift new file mode 100644 index 00000000..f796e2ac --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastView.swift @@ -0,0 +1,128 @@ +// +// ToastView.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2023/04/11. +// + +import UIKit + +import SnapKit + +final class ToastView: UIView { + let type: ToastType + var isTappedCopyButton: Bool = false + + enum ToastType { + case warning + case complete + + var icon: UIImage { + switch self { + case .warning: + return ImageLiterals.icWarning + case .complete: + return ImageLiterals.icComplete + } + } + + var iconColor: UIColor { + switch self { + case .warning: + return .yellow300 + case .complete: + return .green + } + } + + var text: String { + switch self { + case .warning: + return TextLiteral.warningText + case .complete: + return TextLiteral.completeText + } + } + + var toastWidth: CGFloat { + switch self { + case .warning: + return 213 + case .complete: + return 218 + } + } + } + + private lazy var toastIcon: UIImageView = { + let imageView = UIImageView() + imageView.image = type.icon + imageView.tintColor = type.iconColor + return imageView + }() + private lazy var toastLabel: UILabel = { + let label = UILabel() + label.text = type.text + label.font = .toast + label.textColor = .white100 + return label + }() + + init(type: ToastType) { + self.type = type + super.init(frame: .zero) + } + + required init?(coder: NSCoder) { nil } + + override class var layerClass: AnyClass { + return CAGradientLayer.self + } + + override func layoutSubviews() { + super.layoutSubviews() + self.layer.cornerRadius = 10 + self.clipsToBounds = true + self.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) + self.render() + } + + private func render() { + self.addSubview(toastIcon) + toastIcon.snp.makeConstraints { + $0.leading.equalToSuperview().inset(16) + $0.centerY.equalToSuperview() + $0.height.width.equalTo(18) + } + + self.addSubview(toastLabel) + toastLabel.snp.makeConstraints { + $0.leading.equalTo(toastIcon.snp.trailing).offset(10) + $0.centerY.equalToSuperview() + } + } + + func showToast(navigationController: UINavigationController) { + if !isTappedCopyButton { + isTappedCopyButton = true + navigationController.view.addSubview(self) + self.snp.makeConstraints { + $0.top.equalToSuperview().inset(-60) + $0.centerX.equalToSuperview() + $0.height.equalTo(46) + $0.width.equalTo(type.toastWidth) + } + + UIView.animate(withDuration: 0.5, delay: 0, animations: { + self.transform = CGAffineTransform(translationX: 0, y: 115) + }, completion: { _ in + UIView.animate(withDuration: 1, delay: 0.8, animations: { + self.transform = .identity + }, completion: { _ in + self.removeFromSuperview() + self.isTappedCopyButton = false + }) + }) + } + } +} From 740fda6c1d36d0e050abdc78d02da6fa5b58c926 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 11 Apr 2023 17:45:54 +0900 Subject: [PATCH 307/388] =?UTF-8?q?[ADD]=20=EC=B4=88=EB=8C=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B3=B5=EC=82=AC=ED=95=98=EA=B8=B0=20ToastView=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80(#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index b39df4d7..cd3222f3 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -16,6 +16,7 @@ final class TeamDetailViewController: BaseViewController { // MARK: - property private lazy var backButton = BackButton(type: .system) + private lazy var toastView = ToastView(type: .complete) private let titleLabel: UILabel = { let label = UILabel() label.font = .title @@ -42,7 +43,7 @@ final class TeamDetailViewController: BaseViewController { }() private let memberTableView = TeamDetailMembersView() private let firstFullDividerView = FullDividerView() - private let codeShareButton: UIButton = { + private let codeCopyButton: UIButton = { let button = UIButton(type: .system) button.setTitle(TextLiteral.teamDetailViewControllerCopyCodeText, for: .normal) button.setTitleColor(.blue200, for: .normal) @@ -129,15 +130,15 @@ final class TeamDetailViewController: BaseViewController { $0.height.equalTo(4) } - contentView.addSubview(codeShareButton) - codeShareButton.snp.makeConstraints { + contentView.addSubview(codeCopyButton) + codeCopyButton.snp.makeConstraints { $0.top.equalTo(firstFullDividerView.snp.bottom).offset(20) $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } contentView.addSubview(invitationCodeLabel) invitationCodeLabel.snp.makeConstraints { - $0.centerY.equalTo(codeShareButton.snp.centerY) + $0.centerY.equalTo(codeCopyButton.snp.centerY) $0.trailing.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } @@ -202,8 +203,10 @@ final class TeamDetailViewController: BaseViewController { private func setupCodeShareButton() { let action = UIAction { [weak self] _ in UIPasteboard.general.string = self?.invitationCode + guard let navigation = self?.navigationController else { return } + self?.toastView.showToast(navigationController: navigation) } - codeShareButton.addAction(action, for: .touchUpInside) + codeCopyButton.addAction(action, for: .touchUpInside) } private func updateLayout() { From 9ecf467425f467e9b20af0d52b062d2b73c2cdd6 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 12 Apr 2023 02:00:35 +0900 Subject: [PATCH 308/388] =?UTF-8?q?[ADD]=20Endpoint=20=EC=B6=94=EA=B0=80(#?= =?UTF-8?q?345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamDetailEndPoint.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift index add18540..eff9ef6a 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -12,6 +12,7 @@ enum TeamDetailEndPoint: EndPointable { case fetchTeamInformation case deleteTeam case fetchUserTeamList + case putEditProfile var address: String { switch self { @@ -26,6 +27,9 @@ enum TeamDetailEndPoint: EndPointable { case .fetchUserTeamList: return "\(UrlLiteral.baseUrl2)/users/teams" + + case .putEditProfile: + return "\(UrlLiteral.baseUrl2)/users/teams/\(UserDefaultStorage.teamId)/profile" } } @@ -42,6 +46,9 @@ enum TeamDetailEndPoint: EndPointable { case .fetchUserTeamList: return .get + + case .putEditProfile: + return .put } } @@ -58,6 +65,9 @@ enum TeamDetailEndPoint: EndPointable { case .fetchUserTeamList: return nil + + case .putEditProfile: + return nil } } @@ -90,6 +100,14 @@ enum TeamDetailEndPoint: EndPointable { "refresh_token": "\(UserDefaultStorage.refreshToken)" ] return HTTPHeaders(headers) + + case .putEditProfile: + let headers = [ + "access_token": "\(UserDefaultStorage.accessToken)", + "refresh_token": "\(UserDefaultStorage.refreshToken)", + "Content-Type": "multipart/form-data" + ] + return HTTPHeaders(headers) } } } From 2ca10f6a40398a8d707557de8117181a384318d7 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 12 Apr 2023 02:14:17 +0900 Subject: [PATCH 309/388] =?UTF-8?q?[ADD]=20SetNicknameVC=EC=97=90=20putEdi?= =?UTF-8?q?tProfile=20api=20=EC=B6=94=EA=B0=80(#345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 28915f5b..7660962f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -452,6 +452,39 @@ final class SetNicknameViewController: BaseViewController { } } } + + private func putEditProfile(type: TeamDetailEndPoint, nickname: String, role: String?) { + AF.upload(multipartFormData: { multipartFormData in + let profileInfo: Dictionary = ["nickname": nickname, "role": role] + for (key, value) in profileInfo { + if let value = value { + guard let data = "\(value)".data(using: .utf8) else { return } + multipartFormData.append(data, withName: key, mimeType: "text/plain") + } + } + if let profileURL = self.profileURL { + multipartFormData.append(profileURL, + withName: "profile_image", + fileName: ".png", + mimeType: "image/png") + } + }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in + if let json = json.value { + dump(json) + guard let nickname = json.detail?.nickname else { return } + UserDefaultHandler.setNickname(nickname: nickname) + DispatchQueue.main.async { + // FIXME: - 뒤로가기 + } + } else { + DispatchQueue.main.async { + self.makeAlert(title: TextLiteral.setNicknameViewControllerJoinTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) + self.doneButton.isLoading = false + // FIXME: - alert label 수정 + } + } + } + } } // MARK: - extension From 102bd02b3cc1dffdec4b7a7931a32d40429c97d2 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 12 Apr 2023 03:21:09 +0900 Subject: [PATCH 310/388] =?UTF-8?q?[ADD]=20navigation=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?(#345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/TeamDetailViewController.swift | 11 +++++++++ .../UIComponent/TeamDetailMembersView.swift | 7 ++++++ .../SetNicknameViewController.swift | 24 +++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 57e385b7..6b92706b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -72,6 +72,7 @@ final class TeamDetailViewController: BaseViewController { setupEditButton() setupExitButton() setupCodeShareButton() + setupMyProfileButton() } override func viewWillAppear(_ animated: Bool) { @@ -212,6 +213,16 @@ final class TeamDetailViewController: BaseViewController { } } + private func setupMyProfileButton() { + memberTableView.didTappedMyProfile = { [weak self] userName, role, profilePath in + let viewController = SetNicknameViewController(from: .teamDetail) + viewController.userName = userName + viewController.role = role + viewController.profilePath = profilePath + self?.navigationController?.pushViewController(viewController, animated: true) + } + } + // MARK: - api private func fetchTeamDetailMember(type: TeamDetailEndPoint) { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index c534f6dc..0715bf0b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -14,6 +14,7 @@ final class TeamDetailMembersView: UIView { // FIXME: - API연결 후 수정 var members: [MemberDetailResponse] = [] var currentMember: MemberDetailResponse? + var didTappedMyProfile: ((String, String, String) -> ())? enum PropertySize { static let headerViewHeight: CGFloat = 70 @@ -102,10 +103,16 @@ extension TeamDetailMembersView: UITableViewDataSource { headerView.setupMemberInfoView(nickname: currentMember?.userName ?? UserDefaultStorage.nickname, role: currentMember?.role ?? "", imagePath: currentMember?.profileImagePath ?? "") + let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTappedHeaderView)) + headerView.addGestureRecognizer(tapRecognizer) return headerView } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return PropertySize.headerViewHeight + PropertySize.cellSpacing } + + @objc func didTappedHeaderView(gestureRecognizer: UIGestureRecognizer) { + didTappedMyProfile?(currentMember?.userName ?? UserDefaultStorage.nickname, currentMember?.role ?? "", currentMember?.profileImagePath ?? "") + } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 7660962f..0f4d71c6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -16,6 +16,7 @@ final class SetNicknameViewController: BaseViewController { enum ViewType { case createView case joinView + case teamDetail } private enum TextLength { static let totalMin: Int = 0 @@ -24,6 +25,9 @@ final class SetNicknameViewController: BaseViewController { } private let cameraPicker = UIImagePickerController() private let teamName: String = UserDefaultStorage.teamName + var userName: String? + var role: String? + var profilePath: String? private var profileURL: URL? private let fromView: ViewType @@ -122,6 +126,11 @@ final class SetNicknameViewController: BaseViewController { @available(*, unavailable) required init?(coder: NSCoder) { nil } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + setupEditProfile() + } + override func viewDidLoad() { super.viewDidLoad() setupDelegate() @@ -313,6 +322,8 @@ final class SetNicknameViewController: BaseViewController { dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) case .joinView: dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId), nickname: nickname, role: role) + case .teamDetail: + putEditProfile(type: .putEditProfile, nickname: nickname, role: role) } nicknameTextField.resignFirstResponder() @@ -355,6 +366,19 @@ final class SetNicknameViewController: BaseViewController { } } + private func setupEditProfile() { + if fromView == .teamDetail { + navigationController?.isNavigationBarHidden = false + self.tabBarController?.tabBar.isHidden = true + + nicknameTextField.text = userName + roleTextField.text = role + if let profilePath { + profileImageButton.profileImage.load(from: UrlLiteral.imageBaseURL + profilePath) + } + } + } + // MARK: - selector @objc private func keyboardWillShow(notification: NSNotification) { From b601dd4059e2971a0bad5dc4bc1ec4ae3c951602 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 12 Apr 2023 03:50:43 +0900 Subject: [PATCH 311/388] =?UTF-8?q?[ADD]=20donebutton=20disable=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95(#335)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SetNicknameViewController.swift | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 0f4d71c6..d8ac72e1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -519,8 +519,16 @@ extension SetNicknameViewController: UITextFieldDelegate { checkMaxLength(textField: textField) if textField == nicknameTextField { - let hasText = textField.hasText - doneButton.isDisabled = !hasText + if textField.text != userName { + let hasText = textField.hasText + doneButton.isDisabled = !hasText + } else { + doneButton.isDisabled = true + } + } else if textField == roleTextField { + if fromView == .teamDetail && textField.text != role && nicknameTextField.hasText { + doneButton.isDisabled = false + } } } } @@ -542,6 +550,12 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { do { try data.write(to: url) self.profileURL = url + if url != URL(string: self.profilePath ?? "") && self.nicknameTextField.hasText { + DispatchQueue.main.async { + self.doneButton.isDisabled = false + + } + } } catch { self.makeAlert(title: TextLiteral.setNicknameControllerLibraryErrorAlertTitle, message: TextLiteral.setNicknameControllerLibraryErrorAlertMessage) } @@ -568,6 +582,12 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate, UINavigati do { try data.write(to: url) self.profileURL = url + if url != URL(string: self.profilePath ?? "") && self.nicknameTextField.hasText { + DispatchQueue.main.async { + self.doneButton.isDisabled = false + + } + } } catch { self.makeAlert(title: TextLiteral.setNicknameViewControllerCameraAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) } From 4366115778849eda6e9611552d76225f01892217 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 12 Apr 2023 03:54:51 +0900 Subject: [PATCH 312/388] =?UTF-8?q?[ADD]=20pop=20navigation=20&=20alert=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80(#345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Literal/TextLiteral.swift | 1 + .../Setup/SetNickname/SetNicknameViewController.swift | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 8cce3a9f..8938301a 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -70,6 +70,7 @@ enum TextLiteral { static let setNicknameViewControllerPermissionAlertTitle = "사진 접근 권한" static let setNicknameViewControllerPermissionAlertMessage = "사진 추가를 원하시면 '확인'을 눌러 사진 접근을 허용해 주세요." static let setNicknameViewControllerCameraAlertTitle = "촬영된 이미지를 불러올 수 없습니다." + static let setNicknameViewControllerEditProfileAlertTitle = "프로필 수정 실패" // MARK: - HomeViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index d8ac72e1..400213c0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -498,13 +498,13 @@ final class SetNicknameViewController: BaseViewController { guard let nickname = json.detail?.nickname else { return } UserDefaultHandler.setNickname(nickname: nickname) DispatchQueue.main.async { - // FIXME: - 뒤로가기 + self.navigationController?.popViewController(animated: true) + self.doneButton.isLoading = false } } else { DispatchQueue.main.async { - self.makeAlert(title: TextLiteral.setNicknameViewControllerJoinTeamAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) + self.makeAlert(title: TextLiteral.setNicknameViewControllerEditProfileAlertTitle, message: TextLiteral.setNicknameViewControllerAlertMessage) self.doneButton.isLoading = false - // FIXME: - alert label 수정 } } } From 02cc7919e1772c614efe611a8465942d9b88edcd Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 13 Apr 2023 17:54:10 +0900 Subject: [PATCH 313/388] =?UTF-8?q?[FEAT]=20=ED=94=BC=EB=93=9C=EB=B0=B1=20?= =?UTF-8?q?=EC=A4=84=20=EB=95=8C=20=EB=A7=B4=EB=B2=84=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EB=B7=B0=20UI=20=EB=B3=80=EA=B2=BD=20(#314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberCollectionView.swift | 8 ++-- .../MemberCollectionViewCell.swift | 48 ++++++------------- .../AddFeedbackDetailViewController.swift | 18 +++---- 3 files changed, 26 insertions(+), 48 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift index ecf58153..b2ab54b1 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift @@ -38,7 +38,7 @@ final class MemberCollectionView: UIView { let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical flowLayout.sectionInset = Size.collectionInsets - flowLayout.itemSize = CGSize(width: Size.cellWidth, height: Size.cellHeight) + flowLayout.itemSize = CGSize(width: UIScreen.main.bounds.width - SizeLiteral.leadingTrailingPadding * 4, height: 52) flowLayout.minimumLineSpacing = Size.cellSpacing return flowLayout }() @@ -89,9 +89,9 @@ extension MemberCollectionView: UICollectionViewDataSource { assert(false, "Wrong Cell") return UICollectionViewCell() } - - cell.memberLabel.text = memberList[indexPath.item].userName - + if let username = memberList[indexPath.item].userName { + cell.setupLayoutInfoView(nickname: username, role: memberList[indexPath.item].role ?? "", imagePath: memberList[indexPath.item].profileImagePath) + } return cell } } diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift index 06c03961..1287872f 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift @@ -22,54 +22,36 @@ final class MemberCollectionViewCell: BaseCollectionViewCell { } // MARK: - property - - let memberLabel: UILabel = { - let label = UILabel() - label.font = .main - label.textColor = .black100 - label.layer.masksToBounds = true - label.layer.cornerRadius = 8 - label.textAlignment = .center - label.backgroundColor = .white100 - return label - }() - private lazy var memberShadow: UIView = { - let view = UIView() - view.frame = self.frame - view.layer.cornerRadius = 8 - view.layer.shadowRadius = 2 - view.layer.shadowOffset = CGSize(width: 0, height: 0) - view.layer.shadowOpacity = 0.2 - return view - }() + private let memberInfoView = MemberInformationView() // MARK: - life cycle override func render() { - self.addSubview(memberShadow) - memberShadow.snp.makeConstraints { - $0.edges.equalToSuperview() - } - - memberShadow.addSubview(memberLabel) - memberLabel.snp.makeConstraints { + self.addSubview(memberInfoView) + memberInfoView.snp.makeConstraints { $0.edges.equalToSuperview() } } // MARK: - func + func setupLayoutInfoView(nickname: String, role: String, imagePath: String?) { + memberInfoView.profileNicknameLabel.text = nickname + memberInfoView.profileRoleLabel.text = role + if let imagePath { + memberInfoView.profileImageView.load(from: UrlLiteral.imageBaseURL + imagePath) + } + } + private func applyAttribute() { if isSelected { - memberLabel.layer.borderWidth = 2 - memberLabel.layer.cornerRadius = SizeLiteral.componentCornerRadius - memberLabel.layer.borderColor = UIColor.blue200.cgColor - memberLabel.textColor = .blue200 + memberInfoView.profileNicknameLabel.textColor = .blue200 + memberInfoView.profileRoleLabel.textColor = .blue200 } } private func resetAttribute() { - memberLabel.layer.borderWidth = 0 - memberLabel.textColor = .black100 + memberInfoView.profileNicknameLabel.textColor = .black + memberInfoView.profileRoleLabel.textColor = .black } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift index 55c9856c..2e1a7a83 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift @@ -112,7 +112,7 @@ final class AddFeedbackDetailViewController: BaseViewController { setupShadowView() detectMemberIsSelected() detectFeedbackTypeIsSelected() - fetchCurrentTeamMember(type: .fetchCurrentTeamMember) + fetchTeamDetailMember(type: .fetchTeamMember) } override func setupNavigationBar() { @@ -294,18 +294,14 @@ final class AddFeedbackDetailViewController: BaseViewController { // MARK: - api - private func fetchCurrentTeamMember(type: AddFeedBackEndPoint) { - AF.request( - type.address, - method: type.method, - headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in - dump(json.value) + private func fetchTeamDetailMember(type: TeamDetailEndPoint) { + AF.request(type.address, + method: type.method, + headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let data = json.value { - guard let allMemberList = data.detail?.members else { return } - let memberList = allMemberList.filter { $0.userName != UserDefaultStorage.nickname } + guard let members = data.detail?.members else { return } DispatchQueue.main.async { - self.selectMemberView.memberCollectionView.memberList = memberList + self.selectMemberView.memberCollectionView.memberList = members } } } From 262c0bfa456ab99a895da9092430162756e9032f Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:13:24 +0900 Subject: [PATCH 314/388] =?UTF-8?q?[FEAT]=20=EC=9E=AC=EC=82=AC=EC=9A=A9=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20(#314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberCollectionView/MemberCollectionViewCell.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift index 1287872f..437ce33f 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift @@ -35,6 +35,14 @@ final class MemberCollectionViewCell: BaseCollectionViewCell { // MARK: - func + override func prepareForReuse() { + super.prepareForReuse() + + memberInfoView.profileNicknameLabel.text = nil + memberInfoView.profileImageView.image = ImageLiterals.imgDefaultProfile + memberInfoView.profileNicknameLabel.text = nil + } + func setupLayoutInfoView(nickname: String, role: String, imagePath: String?) { memberInfoView.profileNicknameLabel.text = nickname memberInfoView.profileRoleLabel.text = role From 594f021ecb6a9155e3ab6850fc5222c9eea07d2f Mon Sep 17 00:00:00 2001 From: Guel-git Date: Fri, 14 Apr 2023 14:00:15 +0900 Subject: [PATCH 315/388] =?UTF-8?q?[ADD]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EB=9D=84=EC=96=B4=EC=93=B0=EA=B8=B0=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0(#345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 400213c0..6f6d83d1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -553,7 +553,6 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { if url != URL(string: self.profilePath ?? "") && self.nicknameTextField.hasText { DispatchQueue.main.async { self.doneButton.isDisabled = false - } } } catch { @@ -585,7 +584,6 @@ extension SetNicknameViewController: UIImagePickerControllerDelegate, UINavigati if url != URL(string: self.profilePath ?? "") && self.nicknameTextField.hasText { DispatchQueue.main.async { self.doneButton.isDisabled = false - } } } catch { From d98a7b2b1ec9682d48370492c94b11b22c94132a Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Fri, 14 Apr 2023 22:51:44 +0900 Subject: [PATCH 316/388] [CHORE] removed launchscreen --- .../Maddori.Apple.xcodeproj/project.pbxproj | 15 ----------- .../Base.lproj/LaunchScreen.storyboard | 25 ------------------- 2 files changed, 40 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Global/Resource/Base.lproj/LaunchScreen.storyboard diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index c7781a9f..ff69c06f 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -17,7 +17,6 @@ 39257DC528F8FEBD00201E0B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DC428F8FEBD00201E0B /* AppDelegate.swift */; }; 39257DC728F8FEBD00201E0B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DC628F8FEBD00201E0B /* SceneDelegate.swift */; }; 39257DCE28F8FEBE00201E0B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 39257DCD28F8FEBE00201E0B /* Assets.xcassets */; }; - 39257DD128F8FEBE00201E0B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 39257DCF28F8FEBE00201E0B /* LaunchScreen.storyboard */; }; 39257DEB28F9373900201E0B /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DEA28F9373900201E0B /* BaseViewController.swift */; }; 39257DED28F9378D00201E0B /* BaseCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DEC28F9378D00201E0B /* BaseCollectionViewCell.swift */; }; 39257DEF28F937A500201E0B /* BaseTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39257DEE28F937A500201E0B /* BaseTableViewCell.swift */; }; @@ -179,7 +178,6 @@ 39257DC428F8FEBD00201E0B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39257DC628F8FEBD00201E0B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 39257DCD28F8FEBE00201E0B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 39257DD028F8FEBE00201E0B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 39257DD228F8FEBE00201E0B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39257DEA28F9373900201E0B /* BaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = ""; }; 39257DEC28F9378D00201E0B /* BaseCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCollectionViewCell.swift; sourceTree = ""; }; @@ -446,7 +444,6 @@ 39257DE428F90F7700201E0B /* Resource */ = { isa = PBXGroup; children = ( - 39257DCF28F8FEBE00201E0B /* LaunchScreen.storyboard */, 39257DCD28F8FEBE00201E0B /* Assets.xcassets */, ); path = Resource; @@ -1165,7 +1162,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 39257DD128F8FEBE00201E0B /* LaunchScreen.storyboard in Resources */, 3EF7909B29E462F50052578E /* LaunchScreen.storyboard in Resources */, 3998E86F295C308100541752 /* Settings.bundle in Resources */, 39257DCE28F8FEBE00201E0B /* Assets.xcassets in Resources */, @@ -1337,17 +1333,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - 39257DCF28F8FEBE00201E0B /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 39257DD028F8FEBE00201E0B /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ 39257DD328F8FEBE00201E0B /* Debug */ = { isa = XCBuildConfiguration; diff --git a/Maddori.Apple/Maddori.Apple/Global/Resource/Base.lproj/LaunchScreen.storyboard b/Maddori.Apple/Maddori.Apple/Global/Resource/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e9329..00000000 --- a/Maddori.Apple/Maddori.Apple/Global/Resource/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - From 01e2868371485109bbb1b819af1d0111f5204be3 Mon Sep 17 00:00:00 2001 From: chemi Date: Sun, 16 Apr 2023 18:32:35 +0900 Subject: [PATCH 317/388] =?UTF-8?q?[CHORE]=20=ED=86=A0=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?(#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvitationCodeViewController.swift | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift index b53e8b25..a766f40d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/InvitationCode/InvitationCodeViewController.swift @@ -56,17 +56,7 @@ final class InvitationCodeViewController: BaseViewController { label.textColor = .gray400 return label }() - private let toastView: UIView = { - let view = UIView() - view.layer.cornerRadius = 10 - view.clipsToBounds = true - return view - }() - private let toastContentView: ToastContentView = { - let view = ToastContentView() - view.toastType = .complete - return view - }() + private let toastView = ToastView(type: .complete) // MARK: - life cycle @@ -74,8 +64,6 @@ final class InvitationCodeViewController: BaseViewController { super.viewDidLoad() setupCopyCodeButton() setupStartButton() - setGradientToastView() - render() } override func setupNavigationBar() { @@ -125,40 +113,15 @@ final class InvitationCodeViewController: BaseViewController { $0.bottom.equalTo(startButton.snp.top) $0.height.equalTo(SizeLiteral.minimumTouchArea) } - - toastView.addSubview(toastContentView) - toastContentView.snp.makeConstraints { - $0.edges.equalToSuperview() - } - toastContentView.render() } // MARK: - func - private func showToastPopUp() { - if !isTappedCopyButton { - isTappedCopyButton = true - UIView.animate(withDuration: 0.5, delay: 0, animations: { - self.toastView.transform = CGAffineTransform(translationX: 0, y: 115) - }, completion: { _ in - UIView.animate(withDuration: 1, delay: 0.8, animations: { - self.toastView.transform = .identity - }, completion: { _ in - self.isTappedCopyButton = false - }) - }) - } - } - - private func setGradientToastView() { - toastView.layoutIfNeeded() - toastView.setGradient(colorTop: .gradientGrayTop, colorBottom: .gradientGrayBottom) - } - private func setupCopyCodeButton() { let action = UIAction { [weak self] _ in UIPasteboard.general.string = self?.invitedCodeLabel.text - self?.showToastPopUp() + guard let navigationController = self?.navigationController else { return } + self?.toastView.showToast(navigationController: navigationController) } copyCodeButton.addAction(action, for: .touchUpInside) } From 12c04f93e03d9fde02ca32bc91dafd1b4a60f82b Mon Sep 17 00:00:00 2001 From: chemi Date: Sun, 16 Apr 2023 18:33:31 +0900 Subject: [PATCH 318/388] =?UTF-8?q?[CHORE]=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?=ED=86=A0=EC=8A=A4=ED=8A=B8=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EC=82=AD=EC=A0=9C=20(#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 - .../UIComponent/View/ToastContentView.swift | 86 ------------------- 2 files changed, 90 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastContentView.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index d3da8346..ab9f921a 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -105,7 +105,6 @@ 3E66777529419C8300BB5670 /* KeywordTextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E66777429419C8300BB5670 /* KeywordTextFieldView.swift */; }; 3E8052DF2906E09100A6449D /* KeywordSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E8052DE2906E09100A6449D /* KeywordSectionHeaderView.swift */; }; 3E953A9529C1CE7D0073302F /* ImageCacheManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E953A9429C1CE7D0073302F /* ImageCacheManager.swift */; }; - 3EA341C129221998005CBD1C /* ToastContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA341C029221998005CBD1C /* ToastContentView.swift */; }; 3EA341E62924E2AD005CBD1C /* HomeEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA341E52924E2AD005CBD1C /* HomeEndPoint.swift */; }; 3EA341E82925E5EA005CBD1C /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA341E72925E5EA005CBD1C /* String+Extension.swift */; }; 3EA341EA29261ADD005CBD1C /* InProgressEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA341E929261ADD005CBD1C /* InProgressEndPoint.swift */; }; @@ -267,7 +266,6 @@ 3E66777429419C8300BB5670 /* KeywordTextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordTextFieldView.swift; sourceTree = ""; }; 3E8052DE2906E09100A6449D /* KeywordSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordSectionHeaderView.swift; sourceTree = ""; }; 3E953A9429C1CE7D0073302F /* ImageCacheManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCacheManager.swift; sourceTree = ""; }; - 3EA341C029221998005CBD1C /* ToastContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastContentView.swift; sourceTree = ""; }; 3EA341E52924E2AD005CBD1C /* HomeEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeEndPoint.swift; sourceTree = ""; }; 3EA341E72925E5EA005CBD1C /* String+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = ""; }; 3EA341E929261ADD005CBD1C /* InProgressEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressEndPoint.swift; sourceTree = ""; }; @@ -652,7 +650,6 @@ D79D908B2903B6B1004DDC4A /* LabelButtonView.swift */, 3E557FC428FE854600714E46 /* KeywordLabel.swift */, 52F0CB5129178C2700E39C50 /* AlertViewController.swift */, - 3EA341C029221998005CBD1C /* ToastContentView.swift */, 3975CEAE293EEDD6002D4F1A /* KeywordView.swift */, 391612D429E551BD004AE982 /* ToastView.swift */, ); @@ -1175,7 +1172,6 @@ 3E953A9529C1CE7D0073302F /* ImageCacheManager.swift in Sources */, 39F52C44292329BA00B19A77 /* BaseModel.swift in Sources */, 522D99BF29041B51009CBD95 /* CustomTextView.swift in Sources */, - 3EA341C129221998005CBD1C /* ToastContentView.swift in Sources */, D70AF89729C2FDF6003A500C /* TeamInfoEndPoint.swift in Sources */, 39F1A13529125762005E3456 /* MyFeedbackViewController.swift in Sources */, 39F52C702924747600B19A77 /* AllCertainTypeFeedBackResponse.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastContentView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastContentView.swift deleted file mode 100644 index aa6d7493..00000000 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastContentView.swift +++ /dev/null @@ -1,86 +0,0 @@ -// -// ToastContentView.swift -// Maddori.Apple -// -// Created by 이성민 on 2022/11/14. -// - -import UIKit - -import SnapKit - -enum ToastType { - case warning - case complete - - var icon: UIImage { - switch self { - case .warning: - return ImageLiterals.icWarning - case .complete: - return ImageLiterals.icComplete - } - } - - var iconColor: UIColor { - switch self { - case .warning: - return .yellow300 - case .complete: - return .green - } - } - - var text: String { - switch self { - case .warning: - return TextLiteral.warningText - case .complete: - return TextLiteral.completeText - } - } -} - -final class ToastContentView: UIView { - - var toastType: ToastType? { - didSet { - setupAttribute() - } - } - - // MARK: - property - - private let toastIcon = UIImageView() - private let toastLabel: UILabel = { - let label = UILabel() - label.font = .toast - label.textColor = .white100 - return label - }() - - // MARK: - life cycle - - func render() { - superview?.addSubview(toastIcon) - toastIcon.snp.makeConstraints { - $0.leading.equalToSuperview().inset(16) - $0.centerY.equalToSuperview() - } - - superview?.addSubview(toastLabel) - toastLabel.snp.makeConstraints { - $0.leading.equalTo(toastIcon.snp.trailing).offset(10) - $0.centerY.equalToSuperview().offset(1) - $0.trailing.equalToSuperview().inset(22) - } - } - - // MARK: - func - - private func setupAttribute() { - self.toastIcon.image = toastType?.icon - self.toastIcon.tintColor = toastType?.iconColor - self.toastLabel.text = toastType?.text - } -} From 1576f57f49e5ab3fb8aa4d57f2e64097735ecb3e Mon Sep 17 00:00:00 2001 From: chemi Date: Sun, 16 Apr 2023 18:37:25 +0900 Subject: [PATCH 319/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20placeHolder=20=EC=88=98=EC=A0=95=20(#33?= =?UTF-8?q?9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/EditTeamName/EditTeamNameViewController.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index 22661d5a..5739fe9e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -22,8 +22,7 @@ final class EditTeamNameViewController: BaseTextFieldViewController { override var placeholderText: String { get { - // FIXME: - place holder의 내용이 피그마에 없음. - return "수정할 팀 이름을 입력해 주세요." + return TextLiteral.createTeamViewControllerTextFieldPlaceHolder } set { From a0f02b9846333479679a551083d154ddf62eb8fc Mon Sep 17 00:00:00 2001 From: chemi Date: Sun, 16 Apr 2023 18:50:35 +0900 Subject: [PATCH 320/388] =?UTF-8?q?[CHORE]=20=ED=98=84=EC=9E=AC=20?= =?UTF-8?q?=ED=8C=80=20=EC=9D=B4=EB=A6=84=20default=EB=A1=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/EditTeamName/EditTeamNameViewController.swift | 5 +++++ .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 1 + 2 files changed, 6 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index 5739fe9e..384f4b59 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -66,6 +66,7 @@ final class EditTeamNameViewController: BaseTextFieldViewController { override func viewDidLoad() { super.viewDidLoad() setupDoneButton() + setupDefaultTextFieldText() } override func setupNavigationBar() { @@ -89,6 +90,10 @@ final class EditTeamNameViewController: BaseTextFieldViewController { self.doneButton.addAction(action, for: .touchUpInside) } + private func setupDefaultTextFieldText() { + self.kigoTextField.text = UserDefaultStorage.teamName + } + // MARK: - api private func dispatchTeamName(type: EditTeamNameEndPoint) { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 335b16fa..48efe43c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -237,6 +237,7 @@ final class TeamDetailViewController: BaseViewController { self.invitationCodeLabel.text = invitationCode self.titleLabel.text = teamName } + UserDefaultHandler.setTeamName(teamName: teamName) } } } From 24580bcd09261a89ba20c50472cde2fe064dc2ca Mon Sep 17 00:00:00 2001 From: chemi Date: Sun, 16 Apr 2023 19:10:02 +0900 Subject: [PATCH 321/388] =?UTF-8?q?[CHORE]=20navigation=20bar=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 4daa97a0..eec82bfa 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -98,13 +98,13 @@ final class HomeViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() + navigationController?.isNavigationBarHidden = true setupDelegation() render() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - navigationController?.isNavigationBarHidden = true setLayoutTeamManageButton() fetchCertainTeamDetail(type: .fetchCertainTeamDetail) fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 48efe43c..d34c1970 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -77,10 +77,16 @@ final class TeamDetailViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + navigationController?.setNavigationBarHidden(false, animated: true) fetchTeamDetailMember(type: .fetchTeamMember) fetchTeamInformation(type: .fetchTeamInformation) } + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + navigationController?.setNavigationBarHidden(true, animated: true) + } + override func render() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { From 512acf77bf882f440b810898920a0602ffbf101e Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 21 Apr 2023 22:15:28 +0900 Subject: [PATCH 322/388] =?UTF-8?q?[CHORE]=20=EC=83=89=EC=83=81=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(#314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberCollectionView/MemberCollectionViewCell.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift index 437ce33f..a0dbfbff 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift @@ -59,7 +59,7 @@ final class MemberCollectionViewCell: BaseCollectionViewCell { } private func resetAttribute() { - memberInfoView.profileNicknameLabel.textColor = .black - memberInfoView.profileRoleLabel.textColor = .black + memberInfoView.profileNicknameLabel.textColor = .gray600 + memberInfoView.profileRoleLabel.textColor = .gray400 } } From 01f881c13f802f18374f003b511d5091394a80f4 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 21 Apr 2023 22:18:31 +0900 Subject: [PATCH 323/388] =?UTF-8?q?[CHORE]=20=EC=85=80=EC=9D=98=20?= =?UTF-8?q?=EB=B0=B0=EA=B2=BD=EC=83=89=20=EC=B6=94=EA=B0=80=20(#314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberCollectionView/MemberCollectionViewCell.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift index a0dbfbff..4645673f 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionViewCell.swift @@ -35,6 +35,11 @@ final class MemberCollectionViewCell: BaseCollectionViewCell { // MARK: - func + override func configUI() { + super.configUI() + backgroundColor = .backgroundWhite + } + override func prepareForReuse() { super.prepareForReuse() From 7678242f51dbefa6a6cd0f1c3829f34662f334d5 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Fri, 21 Apr 2023 22:19:16 +0900 Subject: [PATCH 324/388] =?UTF-8?q?[CHORE]=20=EC=85=80=20=EC=95=88?= =?UTF-8?q?=EC=97=90=20=EC=82=AC=EC=9D=B4=EC=A6=88=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?(#314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberCollectionView/MemberCollectionView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift index b2ab54b1..1ee507ac 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift @@ -38,7 +38,7 @@ final class MemberCollectionView: UIView { let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical flowLayout.sectionInset = Size.collectionInsets - flowLayout.itemSize = CGSize(width: UIScreen.main.bounds.width - SizeLiteral.leadingTrailingPadding * 4, height: 52) + flowLayout.itemSize = CGSize(width: UIScreen.main.bounds.width - SizeLiteral.leadingTrailingPadding * 2 - 38, height: 52) flowLayout.minimumLineSpacing = Size.cellSpacing return flowLayout }() From 96e8e07543ef209ac035fa2aecc053d55a8114c9 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 26 Apr 2023 16:12:43 +0900 Subject: [PATCH 325/388] =?UTF-8?q?[CHORE]=20private=20=EC=A0=91=EA=B7=BC?= =?UTF-8?q?=20=EC=A0=9C=EC=96=B4=20=EC=B6=94=EA=B0=80=20(#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/UIComponent/View/ToastView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastView.swift index f796e2ac..62c1f838 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/ToastView.swift @@ -11,7 +11,7 @@ import SnapKit final class ToastView: UIView { let type: ToastType - var isTappedCopyButton: Bool = false + private var isTappedCopyButton: Bool = false enum ToastType { case warning From 43ca7b7aa91e4cbbd8160e559b7fda219e0a5731 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Wed, 26 Apr 2023 17:42:05 +0900 Subject: [PATCH 326/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Extension/String+Extension.swift | 4 ++++ .../Network/EndPoint/TeamDetailEndPoint.swift | 6 +++--- .../Network/Reqeust/DTO/JoinTeamDTO.swift | 1 - .../SetNickname/SetNicknameViewController.swift | 17 +++++++++-------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift b/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift index 765a4ae8..3d87de42 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Extension/String+Extension.swift @@ -38,4 +38,8 @@ extension String { } return false } + + func utf8Encode() -> Data? { + return data(using: .utf8) + } } diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift index eff9ef6a..02bdc489 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -12,7 +12,7 @@ enum TeamDetailEndPoint: EndPointable { case fetchTeamInformation case deleteTeam case fetchUserTeamList - case putEditProfile + case putEditProfile(T) var address: String { switch self { @@ -66,8 +66,8 @@ enum TeamDetailEndPoint: EndPointable { case .fetchUserTeamList: return nil - case .putEditProfile: - return nil + case .putEditProfile(let body): + return body } } diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift index 491b51f9..c67eb651 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift @@ -10,5 +10,4 @@ import Foundation struct JoinTeamDTO: Encodable { let nickname: String let role: String? - let profile_image: String? } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 6f6d83d1..0ef374fd 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -323,7 +323,8 @@ final class SetNicknameViewController: BaseViewController { case .joinView: dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId), nickname: nickname, role: role) case .teamDetail: - putEditProfile(type: .putEditProfile, nickname: nickname, role: role) + let dto = JoinTeamDTO(nickname: nickname, role: role) + putEditProfile(type: .putEditProfile(dto)) } nicknameTextField.resignFirstResponder() @@ -477,14 +478,14 @@ final class SetNicknameViewController: BaseViewController { } } - private func putEditProfile(type: TeamDetailEndPoint, nickname: String, role: String?) { + private func putEditProfile(type: TeamDetailEndPoint) { AF.upload(multipartFormData: { multipartFormData in - let profileInfo: Dictionary = ["nickname": nickname, "role": role] - for (key, value) in profileInfo { - if let value = value { - guard let data = "\(value)".data(using: .utf8) else { return } - multipartFormData.append(data, withName: key, mimeType: "text/plain") - } + guard let nickname = type.body?.nickname, + let nicknameData = nickname.utf8Encode() else { return } + multipartFormData.append(nicknameData, withName: "nickname") + if let role = type.body?.role { + guard let roleData = role.utf8Encode() else { return } + multipartFormData.append(roleData, withName: "role") } if let profileURL = self.profileURL { multipartFormData.append(profileURL, From f6c7441aaca8998749a090e62334b096486bbbf7 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 26 Apr 2023 20:56:48 +0900 Subject: [PATCH 327/388] =?UTF-8?q?[CHORE]=20mainButton=EC=97=90=20Gradien?= =?UTF-8?q?t=20=EC=A0=81=EC=9A=A9=20(#348)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/UIComponent/Button/MainButton.swift | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift index 57b12fa9..aec639e3 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/Button/MainButton.swift @@ -33,19 +33,25 @@ final class MainButton: UIButton { override init(frame: CGRect) { super.init(frame: frame) + if !self.isDisabled { + setGradientLayer() + } render() configUI() } required init?(coder: NSCoder) { nil } + override class var layerClass: AnyClass { + return CAGradientLayer.self + } + private func configUI() { layer.masksToBounds = true layer.cornerRadius = 10 titleLabel?.font = .font(.bold, ofSize: 18) setTitleColor(.white, for: .normal) setTitleColor(.white, for: .disabled) - setBackgroundColor(.blue200, for: .normal) setBackgroundColor(.gray200, for: .disabled) configLoadingIndicator() } @@ -62,6 +68,15 @@ final class MainButton: UIButton { } } + private func setGradientLayer() { + if let gradientLayer = layer as? CAGradientLayer { + gradientLayer.colors = [UIColor.gradientBlueTop.cgColor, UIColor.gradientBlueBottom.cgColor] + gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.0) + gradientLayer.endPoint = CGPoint(x: 0.0, y: 1.0) + gradientLayer.frame = bounds + } + } + // MARK: - func private func setupAttribute() { From d6db2745ad8147a4b6ddb7ab1b32f05a5672644d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 1 May 2023 19:27:13 +0900 Subject: [PATCH 328/388] =?UTF-8?q?[ADD]=20apple=20login=20response=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 8 ++------ .../Network/Response/AppleLoginResponse.swift | 12 ++++++++++- .../Network/Response/UserResponse.swift | 20 ------------------- 3 files changed, 13 insertions(+), 27 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/UserResponse.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index ae405df0..40f2202e 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -8,11 +8,11 @@ /* Begin PBXBuildFile section */ 391596622904176500A432D9 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391596612904176500A432D9 /* UIView+Extension.swift */; }; - 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391612CD29E51F1B004AE982 /* EditTeamNameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */; }; 391612CF29E5352A004AE982 /* EditTeamNameEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */; }; 391612D129E5364A004AE982 /* EditTeamNameDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */; }; 391612D329E53745004AE982 /* EditTeamNameResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D229E53745004AE982 /* EditTeamNameResponse.swift */; }; + 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; @@ -51,7 +51,6 @@ 3960864129811E3C003AB4F8 /* TeamDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3960864029811E3C003AB4F8 /* TeamDetailViewController.swift */; }; 396334D7292DADBE00E74B77 /* AppleLoginDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396334D6292DADBE00E74B77 /* AppleLoginDTO.swift */; }; 396334D9292DAE0000E74B77 /* AppleLoginResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */; }; - 396334DB292DAE8300E74B77 /* UserResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396334DA292DAE8300E74B77 /* UserResponse.swift */; }; 3975CEAF293EEDD6002D4F1A /* KeywordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3975CEAE293EEDD6002D4F1A /* KeywordView.swift */; }; 397E49572924D93F004220D6 /* UrlLiteral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 397E49562924D93F004220D6 /* UrlLiteral.swift */; }; 397E495A2924F871004220D6 /* UserDefaultStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 397E49592924F871004220D6 /* UserDefaultStorage.swift */; }; @@ -172,11 +171,11 @@ /* Begin PBXFileReference section */ 391596612904176500A432D9 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; - 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameViewController.swift; sourceTree = ""; }; 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameEndPoint.swift; sourceTree = ""; }; 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameDTO.swift; sourceTree = ""; }; 391612D229E53745004AE982 /* EditTeamNameResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameResponse.swift; sourceTree = ""; }; + 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; @@ -216,7 +215,6 @@ 3960864029811E3C003AB4F8 /* TeamDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamDetailViewController.swift; sourceTree = ""; }; 396334D6292DADBE00E74B77 /* AppleLoginDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleLoginDTO.swift; sourceTree = ""; }; 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleLoginResponse.swift; sourceTree = ""; }; - 396334DA292DAE8300E74B77 /* UserResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserResponse.swift; sourceTree = ""; }; 396334DC292DB07100E74B77 /* Maddori.Apple.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Maddori.Apple.entitlements; sourceTree = ""; }; 3975CEAE293EEDD6002D4F1A /* KeywordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordView.swift; sourceTree = ""; }; 397E49562924D93F004220D6 /* UrlLiteral.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UrlLiteral.swift; sourceTree = ""; }; @@ -777,7 +775,6 @@ 39F52C73292476EA00B19A77 /* FeedBackResponse.swift */, 398474212925CF4800EDC139 /* TeamInfoResponse.swift */, 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */, - 396334DA292DAE8300E74B77 /* UserResponse.swift */, 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */, 391612D229E53745004AE982 /* EditTeamNameResponse.swift */, ); @@ -1339,7 +1336,6 @@ 3EA341E62924E2AD005CBD1C /* HomeEndPoint.swift in Sources */, 391612D129E5364A004AE982 /* EditTeamNameDTO.swift in Sources */, 395C7E0D28F959A500FC2FCA /* MainButton.swift in Sources */, - 396334DB292DAE8300E74B77 /* UserResponse.swift in Sources */, 3EB508622912B12700FB77CB /* MyReflectionCollectionViewHeader.swift in Sources */, 39257DF528F93E4700201E0B /* UIColor+Extension.swift in Sources */, 52F2D1C12906F172009CBF89 /* SelectReflectionMemberViewController.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/AppleLoginResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/AppleLoginResponse.swift index 10ddc40b..c77cd6e4 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/AppleLoginResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/AppleLoginResponse.swift @@ -11,7 +11,7 @@ struct AppleLoginResponse: Decodable { let created: Bool? let accessToken: String? let refreshToken: String? - let user: UserResponse? + let user: LoginUserResponse? enum CodingKeys: String, CodingKey { case created @@ -20,3 +20,13 @@ struct AppleLoginResponse: Decodable { case user } } + +struct LoginUserResponse: Decodable { + let userId: Int? + let teamId: Int? + + enum CodingKeys: String, CodingKey { + case userId = "user_id" + case teamId = "team_id" + } +} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/UserResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/UserResponse.swift deleted file mode 100644 index 11a0241e..00000000 --- a/Maddori.Apple/Maddori.Apple/Network/Response/UserResponse.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// UserResponse.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2022/11/23. -// - -import Foundation - -struct UserResponse: Decodable { - let userId: Int? - let userName: String? - let teamId: Int? - - enum CodingKeys: String, CodingKey { - case userId = "user_id" - case userName = "username" - case teamId = "team_id" - } -} From 2507ead97d8ea7b55177d883702144521831b93a Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 1 May 2023 21:20:16 +0900 Subject: [PATCH 329/388] =?UTF-8?q?[CHORE]=20EditTeamNameResponse=20?= =?UTF-8?q?=EA=B3=B5=EC=9A=A9=EC=9C=BC=EB=A1=9C=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EA=B8=B0(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj | 8 ++++---- .../Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift | 1 - ...{EditTeamNameResponse.swift => TeamNameResponse.swift} | 4 ++-- .../Home/EditTeamName/EditTeamNameViewController.swift | 2 +- .../Screen/Setup/JoinTeam/JoinTeamViewController.swift | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) rename Maddori.Apple/Maddori.Apple/Network/Response/{EditTeamNameResponse.swift => TeamNameResponse.swift} (76%) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 40f2202e..6f6c6b9f 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -11,7 +11,7 @@ 391612CD29E51F1B004AE982 /* EditTeamNameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */; }; 391612CF29E5352A004AE982 /* EditTeamNameEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */; }; 391612D129E5364A004AE982 /* EditTeamNameDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */; }; - 391612D329E53745004AE982 /* EditTeamNameResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D229E53745004AE982 /* EditTeamNameResponse.swift */; }; + 391612D329E53745004AE982 /* TeamNameResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D229E53745004AE982 /* TeamNameResponse.swift */; }; 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; @@ -174,7 +174,7 @@ 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameViewController.swift; sourceTree = ""; }; 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameEndPoint.swift; sourceTree = ""; }; 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameDTO.swift; sourceTree = ""; }; - 391612D229E53745004AE982 /* EditTeamNameResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameResponse.swift; sourceTree = ""; }; + 391612D229E53745004AE982 /* TeamNameResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamNameResponse.swift; sourceTree = ""; }; 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; @@ -776,7 +776,7 @@ 398474212925CF4800EDC139 /* TeamInfoResponse.swift */, 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */, 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */, - 391612D229E53745004AE982 /* EditTeamNameResponse.swift */, + 391612D229E53745004AE982 /* TeamNameResponse.swift */, ); path = Response; sourceTree = ""; @@ -1243,7 +1243,7 @@ 395C7E1328F9841A00FC2FCA /* SizeLiteral.swift in Sources */, 52E6770F29911E3E00A0935B /* ReflectionMemberCollectionView.swift in Sources */, 391612D529E551BD004AE982 /* ToastView.swift in Sources */, - 391612D329E53745004AE982 /* EditTeamNameResponse.swift in Sources */, + 391612D329E53745004AE982 /* TeamNameResponse.swift in Sources */, 3EB508902917525600FB77CB /* EmptyReflectionView.swift in Sources */, D7A585292990DB0D00E1F4EE /* Option.swift in Sources */, 3EB5088E2916D05F00FB77CB /* EmptyFeedbackView.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift index 15255c89..d1c28c9d 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift @@ -11,5 +11,4 @@ struct CreateTeamDTO: Encodable { let team_name: String let nickname: String let role: String? - let profile_image: String? } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/EditTeamNameResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift similarity index 76% rename from Maddori.Apple/Maddori.Apple/Network/Response/EditTeamNameResponse.swift rename to Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift index 2825dda8..443b0874 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/EditTeamNameResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift @@ -1,5 +1,5 @@ // -// EditTeamNameResponse.swift +// TeamNameResponse.swift // Maddori.Apple // // Created by Mingwan Choi on 2023/04/11. @@ -7,7 +7,7 @@ import Foundation -struct EditTeamNameResponse: Decodable { +struct TeamNameResponse: Decodable { let id: Int let teamName: String diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index 384f4b59..2bd5e44e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -103,7 +103,7 @@ final class EditTeamNameViewController: BaseTextFieldViewController { parameters: type.body, encoder: JSONParameterEncoder.default, headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let data = json.value { dump(data) self.navigationController?.popViewController(animated: true) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index 630d8da8..f0a53ce2 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -178,7 +178,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { AF.request(type.address, method: type.method, headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) guard let teamId = json.detail?.id, From 4029faed0ab3a40bdb127a0750116b7e005b26e9 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 1 May 2023 21:53:38 +0900 Subject: [PATCH 330/388] =?UTF-8?q?[CHORE]=20=EC=A4=91=EB=B3=B5=EB=90=98?= =?UTF-8?q?=EB=8A=94=20CertainTeamDetailResponse=20=EC=82=AD=EC=A0=9C(#350?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 ---- .../Response/CertainTeamDetailResponse.swift | 21 ------------------- .../Screen/Home/Home/HomeViewController.swift | 4 ++-- .../Home/Home/TeamManageViewController.swift | 2 +- .../Home/UIComponent/ChangeTeamView.swift | 4 ++-- .../TeamDetail/TeamDetailViewController.swift | 2 +- 6 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/CertainTeamDetailResponse.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 6f6c6b9f..034644f8 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -74,7 +74,6 @@ 39F52C53292330D200B19A77 /* MemberResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C52292330D200B19A77 /* MemberResponse.swift */; }; 39F52C552923311200B19A77 /* JoinTeamResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C542923311200B19A77 /* JoinTeamResponse.swift */; }; 39F52C572923317500B19A77 /* CreateTeamResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C562923317500B19A77 /* CreateTeamResponse.swift */; }; - 39F52C592923321700B19A77 /* CertainTeamDetailResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C582923321700B19A77 /* CertainTeamDetailResponse.swift */; }; 39F52C5B2923327F00B19A77 /* CurrentReflectionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */; }; 39F52C5D292332EA00B19A77 /* AddReflectionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5C292332EA00B19A77 /* AddReflectionResponse.swift */; }; 39F52C5F2923338B00B19A77 /* CurrentMemberResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */; }; @@ -239,7 +238,6 @@ 39F52C52292330D200B19A77 /* MemberResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberResponse.swift; sourceTree = ""; }; 39F52C542923311200B19A77 /* JoinTeamResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinTeamResponse.swift; sourceTree = ""; }; 39F52C562923317500B19A77 /* CreateTeamResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateTeamResponse.swift; sourceTree = ""; }; - 39F52C582923321700B19A77 /* CertainTeamDetailResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CertainTeamDetailResponse.swift; sourceTree = ""; }; 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentReflectionResponse.swift; sourceTree = ""; }; 39F52C5C292332EA00B19A77 /* AddReflectionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddReflectionResponse.swift; sourceTree = ""; }; 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentMemberResponse.swift; sourceTree = ""; }; @@ -759,7 +757,6 @@ 39F52C52292330D200B19A77 /* MemberResponse.swift */, 39F52C542923311200B19A77 /* JoinTeamResponse.swift */, 39F52C562923317500B19A77 /* CreateTeamResponse.swift */, - 39F52C582923321700B19A77 /* CertainTeamDetailResponse.swift */, 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */, 39F52C5C292332EA00B19A77 /* AddReflectionResponse.swift */, 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */, @@ -1305,7 +1302,6 @@ 39847424292603B000EDC139 /* AddFeedBackEndPoint.swift in Sources */, 39F52C4729232DD600B19A77 /* LoginDTO.swift in Sources */, 3EA341EA29261ADD005CBD1C /* InProgressEndPoint.swift in Sources */, - 39F52C592923321700B19A77 /* CertainTeamDetailResponse.swift in Sources */, 396334D7292DADBE00E74B77 /* AppleLoginDTO.swift in Sources */, D7A585222990C50700E1F4EE /* TeamManageSettingCell.swift in Sources */, 397E495A2924F871004220D6 /* UserDefaultStorage.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/CertainTeamDetailResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/CertainTeamDetailResponse.swift deleted file mode 100644 index 884eac48..00000000 --- a/Maddori.Apple/Maddori.Apple/Network/Response/CertainTeamDetailResponse.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// CertainTeamDetailResponse.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2022/11/15. -// - -import Foundation - -struct CertainTeamDetailResponse: Decodable { - // MARK: - getCertainTeamDetail - let teamId: Int? - let teamName: String? - let invitationCode: String? - - enum CodingKeys: String, CodingKey { - case teamId = "id" - case teamName = "team_name" - case invitationCode = "invitation_code" - } -} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index eec82bfa..f7e797b7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -308,10 +308,10 @@ final class HomeViewController: BaseViewController { AF.request(type.address, method: type.method, headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { guard let teamName = json.detail?.teamName, - let teamId = json.detail?.teamId + let teamId = json.detail?.id else { return } self.currentTeamId = teamId DispatchQueue.main.async { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index b2d4d7ef..9625c652 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -181,7 +181,7 @@ final class TeamManageViewController: BaseViewController { AF.request(type.address, method: type.method, headers: type.headers - ).responseDecodable(of: BaseModel<[TeamInfoResponse]>.self) { json in + ).responseDecodable(of: BaseModel<[TeamNameResponse]>.self) { json in if let json = json.value { guard let teamCount = json.detail?.count else { return } self.teamCount = teamCount diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 16f5df72..02625792 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -15,7 +15,7 @@ protocol ChangeTeamViewDelegate: AnyObject { final class ChangeTeamView: UIView { - var teamList: [TeamInfoResponse] = [] { + var teamList: [TeamNameResponse] = [] { didSet { self.teamList.isEmpty ? self.setLayoutEmptyView() : self.setLayoutTeamListView() } @@ -113,6 +113,6 @@ extension ChangeTeamView: UICollectionViewDataSource { extension ChangeTeamView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - self.delegate?.changeTeam(teamId: self.teamList[indexPath.item].id!) + self.delegate?.changeTeam(teamId: self.teamList[indexPath.item].id) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 4710754f..4deb3d56 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -247,7 +247,7 @@ final class TeamDetailViewController: BaseViewController { private func fetchTeamInformation(type: TeamDetailEndPoint) { AF.request(type.address, method: type.method, - headers: type.headers).responseDecodable(of: BaseModel.self) { json in + headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let data = json.value { guard let teamName = data.detail?.teamName, let invitationCode = data.detail?.invitationCode From cae55e1a22eb4314dab52f54e754c429601d4b92 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 1 May 2023 23:09:21 +0900 Subject: [PATCH 331/388] =?UTF-8?q?[CHORE]=20Add/DeleteReflectionResponse?= =?UTF-8?q?=20=ED=95=98=EB=82=98=EB=A1=9C=20=ED=95=A9=EC=B9=98=EA=B8=B0(#3?= =?UTF-8?q?50)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 8 ------ .../Response/AddReflectionResponse.swift | 25 ------------------- .../Response/DeleteReflectionResponse.swift | 16 ------------ .../Network/Response/ReflectionResponse.swift | 2 +- .../CreateReflectionViewController.swift | 4 +-- 5 files changed, 3 insertions(+), 52 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/AddReflectionResponse.swift delete mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/DeleteReflectionResponse.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 034644f8..33dd7f1b 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -75,7 +75,6 @@ 39F52C552923311200B19A77 /* JoinTeamResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C542923311200B19A77 /* JoinTeamResponse.swift */; }; 39F52C572923317500B19A77 /* CreateTeamResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C562923317500B19A77 /* CreateTeamResponse.swift */; }; 39F52C5B2923327F00B19A77 /* CurrentReflectionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */; }; - 39F52C5D292332EA00B19A77 /* AddReflectionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5C292332EA00B19A77 /* AddReflectionResponse.swift */; }; 39F52C5F2923338B00B19A77 /* CurrentMemberResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */; }; 39F52C612923344C00B19A77 /* FeedBackContentResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */; }; 39F52C632923357700B19A77 /* FeedBackInfoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */; }; @@ -95,7 +94,6 @@ 3E5195A42928C8FB00710A01 /* CreateReflectionEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */; }; 3E5195AB292B05BC00710A01 /* JoinReflectionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */; }; 3E5368992992461A000CBD48 /* DeleteButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5368982992461A000CBD48 /* DeleteButton.swift */; }; - 3E5368C629B24351000CBD48 /* DeleteReflectionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */; }; 3E5368C829B60B70000CBD48 /* UIImageView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E5368C729B60B70000CBD48 /* UIImageView+Extension.swift */; }; 3E557FC328FE7BBC00714E46 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */; }; 3E557FC528FE854600714E46 /* KeywordLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E557FC428FE854600714E46 /* KeywordLabel.swift */; }; @@ -239,7 +237,6 @@ 39F52C542923311200B19A77 /* JoinTeamResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinTeamResponse.swift; sourceTree = ""; }; 39F52C562923317500B19A77 /* CreateTeamResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateTeamResponse.swift; sourceTree = ""; }; 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentReflectionResponse.swift; sourceTree = ""; }; - 39F52C5C292332EA00B19A77 /* AddReflectionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddReflectionResponse.swift; sourceTree = ""; }; 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentMemberResponse.swift; sourceTree = ""; }; 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedBackContentResponse.swift; sourceTree = ""; }; 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedBackInfoResponse.swift; sourceTree = ""; }; @@ -258,7 +255,6 @@ 3E5195A32928C8FB00710A01 /* CreateReflectionEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateReflectionEndPoint.swift; sourceTree = ""; }; 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinReflectionButton.swift; sourceTree = ""; }; 3E5368982992461A000CBD48 /* DeleteButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteButton.swift; sourceTree = ""; }; - 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteReflectionResponse.swift; sourceTree = ""; }; 3E5368C729B60B70000CBD48 /* UIImageView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+Extension.swift"; sourceTree = ""; }; 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 3E557FC428FE854600714E46 /* KeywordLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeywordLabel.swift; sourceTree = ""; }; @@ -758,7 +754,6 @@ 39F52C542923311200B19A77 /* JoinTeamResponse.swift */, 39F52C562923317500B19A77 /* CreateTeamResponse.swift */, 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */, - 39F52C5C292332EA00B19A77 /* AddReflectionResponse.swift */, 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */, 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */, 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */, @@ -772,7 +767,6 @@ 39F52C73292476EA00B19A77 /* FeedBackResponse.swift */, 398474212925CF4800EDC139 /* TeamInfoResponse.swift */, 396334D8292DAE0000E74B77 /* AppleLoginResponse.swift */, - 3E5368C529B24351000CBD48 /* DeleteReflectionResponse.swift */, 391612D229E53745004AE982 /* TeamNameResponse.swift */, ); path = Response; @@ -1321,7 +1315,6 @@ 39341E0F29921181006C1727 /* MemberInformationView.swift in Sources */, D7AFB7C32916EAB100E998B7 /* MyReflectionDetailViewController.swift in Sources */, 39F52C632923357700B19A77 /* FeedBackInfoResponse.swift in Sources */, - 39F52C5D292332EA00B19A77 /* AddReflectionResponse.swift in Sources */, 391D38F529D54CBA00A6BFED /* TeamDetailEndPoint.swift in Sources */, 3960864129811E3C003AB4F8 /* TeamDetailViewController.swift in Sources */, D72CF1B0290552960067A118 /* InvitationCodeViewController.swift in Sources */, @@ -1337,7 +1330,6 @@ 52F2D1C12906F172009CBF89 /* SelectReflectionMemberViewController.swift in Sources */, 395C7E0328F945B500FC2FCA /* UIFont+Extension.swift in Sources */, 3E8052DF2906E09100A6449D /* KeywordSectionHeaderView.swift in Sources */, - 3E5368C629B24351000CBD48 /* DeleteReflectionResponse.swift in Sources */, 3EDED991293B8CE00000B4DC /* AddFeedbackContentViewController.swift in Sources */, 39436C182912A2E10083D77A /* Feedback.swift in Sources */, 7E2ECA102901136700A4D65C /* SetNicknameViewController.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/AddReflectionResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/AddReflectionResponse.swift deleted file mode 100644 index 68905cdd..00000000 --- a/Maddori.Apple/Maddori.Apple/Network/Response/AddReflectionResponse.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// AddReflectionResponse.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2022/11/15. -// - -import Foundation - -struct AddReflectionResponse: Decodable { - // MARK: - updateReflectionDetail - let id: Int? - let reflectionName: String? - let date: String? - let state: ReflectionStatus? - let teamId: Int? - - enum CodingKeys: String, CodingKey { - case id - case reflectionName = "reflection_name" - case date - case state - case teamId = "team_id" - } -} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/DeleteReflectionResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/DeleteReflectionResponse.swift deleted file mode 100644 index 3c447a39..00000000 --- a/Maddori.Apple/Maddori.Apple/Network/Response/DeleteReflectionResponse.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// DeleteReflectionResponse.swift -// Maddori.Apple -// -// Created by 이성민 on 2023/03/04. -// - -import Foundation - -struct DeleteReflectionResponse: Decodable { - let id: Int - let reflection_name: String? - let date: String? - let state: String - let team_id: Int -} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/ReflectionResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/ReflectionResponse.swift index 407ba411..86b18bed 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/ReflectionResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/ReflectionResponse.swift @@ -8,7 +8,7 @@ import Foundation struct ReflectionResponse: Decodable { - // MARK: - endInProgressReflection + // MARK: - patchReflectionDetail, deleteReflectionDetail, endInProgressReflection let id: Int? let reflectionName: String? let date: String? diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift index 6ba8f6c9..0c1cc260 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/CreateReflection/CreateReflectionViewController.swift @@ -295,7 +295,7 @@ final class CreateReflectionViewController: BaseViewController { parameters: type.body, encoder: JSONParameterEncoder.default, headers: type.header - ).responseDecodable(of: BaseModel.self) { [weak self] json in + ).responseDecodable(of: BaseModel.self) { [weak self] json in if let _ = json.value { self?.dismiss(animated: true) } @@ -308,7 +308,7 @@ final class CreateReflectionViewController: BaseViewController { parameters: type.body, encoder: JSONParameterEncoder.default, headers: type.header - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let data = json.value { dump(data) } From 100910c531476c64b902f3938e1127f1e8c8b6a9 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 1 May 2023 23:47:16 +0900 Subject: [PATCH 332/388] =?UTF-8?q?[ADD]=20Member=20=EC=AA=BD=20response?= =?UTF-8?q?=20=EC=A0=95=EB=A6=AC(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 12 +++---- .../MemberCollectionView.swift | 4 +-- .../Network/Reqeust/DTO/LoginDTO.swift | 12 ------- .../Response/CurrentMemberResponse.swift | 35 ------------------- .../Response/EditFeedBackResponse.swift | 2 +- .../Response/FeedBackContentResponse.swift | 2 +- .../Response/FeedBackInfoResponse.swift | 2 +- .../Network/Response/MemberResponse.swift | 23 ++---------- .../Response/MembersDetailResponse.swift | 13 +++++++ .../AddFeedbackDetailViewController.swift | 8 ++--- .../InProgress/InProgressViewController.swift | 2 +- .../ReflectionMemberCollectionView.swift | 4 +-- ...SelectReflectionMemberViewController.swift | 6 ++-- .../TeamDetail/TeamDetailViewController.swift | 6 ++-- .../UIComponent/TeamDetailMembersView.swift | 10 +++--- .../MyFeedback/MyFeedbackViewController.swift | 10 +++--- .../MyReflectionDetailViewController.swift | 2 +- .../MyReflectionFeedbackViewController.swift | 2 +- .../SetNicknameViewController.swift | 8 ++--- 19 files changed, 54 insertions(+), 109 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/LoginDTO.swift delete mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift create mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/MembersDetailResponse.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 33dd7f1b..1b54c431 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -66,7 +66,6 @@ 39F1A13529125762005E3456 /* MyFeedbackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F1A13429125762005E3456 /* MyFeedbackViewController.swift */; }; 39F1A13C2912637E005E3456 /* MyFeedbackMemberCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F1A13B2912637E005E3456 /* MyFeedbackMemberCollectionViewCell.swift */; }; 39F52C44292329BA00B19A77 /* BaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C43292329BA00B19A77 /* BaseModel.swift */; }; - 39F52C4729232DD600B19A77 /* LoginDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C4629232DD600B19A77 /* LoginDTO.swift */; }; 39F52C4929232DFB00B19A77 /* JoinTeamDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C4829232DFB00B19A77 /* JoinTeamDTO.swift */; }; 39F52C4B29232E2600B19A77 /* CreateTeamDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C4A29232E2600B19A77 /* CreateTeamDTO.swift */; }; 39F52C4D29232E5D00B19A77 /* AddReflectionDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C4C29232E5D00B19A77 /* AddReflectionDTO.swift */; }; @@ -75,7 +74,7 @@ 39F52C552923311200B19A77 /* JoinTeamResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C542923311200B19A77 /* JoinTeamResponse.swift */; }; 39F52C572923317500B19A77 /* CreateTeamResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C562923317500B19A77 /* CreateTeamResponse.swift */; }; 39F52C5B2923327F00B19A77 /* CurrentReflectionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */; }; - 39F52C5F2923338B00B19A77 /* CurrentMemberResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */; }; + 39F52C5F2923338B00B19A77 /* MembersDetailResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5E2923338B00B19A77 /* MembersDetailResponse.swift */; }; 39F52C612923344C00B19A77 /* FeedBackContentResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */; }; 39F52C632923357700B19A77 /* FeedBackInfoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */; }; 39F52C652923369000B19A77 /* EditFeedBackResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C642923369000B19A77 /* EditFeedBackResponse.swift */; }; @@ -228,7 +227,6 @@ 39F1A13429125762005E3456 /* MyFeedbackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackViewController.swift; sourceTree = ""; }; 39F1A13B2912637E005E3456 /* MyFeedbackMemberCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackMemberCollectionViewCell.swift; sourceTree = ""; }; 39F52C43292329BA00B19A77 /* BaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseModel.swift; sourceTree = ""; }; - 39F52C4629232DD600B19A77 /* LoginDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginDTO.swift; sourceTree = ""; }; 39F52C4829232DFB00B19A77 /* JoinTeamDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinTeamDTO.swift; sourceTree = ""; }; 39F52C4A29232E2600B19A77 /* CreateTeamDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateTeamDTO.swift; sourceTree = ""; }; 39F52C4C29232E5D00B19A77 /* AddReflectionDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddReflectionDTO.swift; sourceTree = ""; }; @@ -237,7 +235,7 @@ 39F52C542923311200B19A77 /* JoinTeamResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinTeamResponse.swift; sourceTree = ""; }; 39F52C562923317500B19A77 /* CreateTeamResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateTeamResponse.swift; sourceTree = ""; }; 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentReflectionResponse.swift; sourceTree = ""; }; - 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentMemberResponse.swift; sourceTree = ""; }; + 39F52C5E2923338B00B19A77 /* MembersDetailResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MembersDetailResponse.swift; sourceTree = ""; }; 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedBackContentResponse.swift; sourceTree = ""; }; 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedBackInfoResponse.swift; sourceTree = ""; }; 39F52C642923369000B19A77 /* EditFeedBackResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditFeedBackResponse.swift; sourceTree = ""; }; @@ -726,7 +724,6 @@ 39F52C4529232DBA00B19A77 /* DTO */ = { isa = PBXGroup; children = ( - 39F52C4629232DD600B19A77 /* LoginDTO.swift */, 39F52C4829232DFB00B19A77 /* JoinTeamDTO.swift */, 39F52C4A29232E2600B19A77 /* CreateTeamDTO.swift */, 39F52C4C29232E5D00B19A77 /* AddReflectionDTO.swift */, @@ -754,7 +751,7 @@ 39F52C542923311200B19A77 /* JoinTeamResponse.swift */, 39F52C562923317500B19A77 /* CreateTeamResponse.swift */, 39F52C5A2923327F00B19A77 /* CurrentReflectionResponse.swift */, - 39F52C5E2923338B00B19A77 /* CurrentMemberResponse.swift */, + 39F52C5E2923338B00B19A77 /* MembersDetailResponse.swift */, 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */, 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */, 39F52C642923369000B19A77 /* EditFeedBackResponse.swift */, @@ -1195,7 +1192,7 @@ 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */, 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */, 39F52C7A2924CC9600B19A77 /* SetupEndPoint.swift in Sources */, - 39F52C5F2923338B00B19A77 /* CurrentMemberResponse.swift in Sources */, + 39F52C5F2923338B00B19A77 /* MembersDetailResponse.swift in Sources */, 397E49572924D93F004220D6 /* UrlLiteral.swift in Sources */, 3E557FFA2901CD4200714E46 /* KeywordCollectionViewCell.swift in Sources */, 52F0CB5229178C2700E39C50 /* AlertViewController.swift in Sources */, @@ -1294,7 +1291,6 @@ 395C7E252900E74700FC2FCA /* StartReflectionViewController.swift in Sources */, 3E557FF82901CD3400714E46 /* KeywordCollectionViewFlowLayout.swift in Sources */, 39847424292603B000EDC139 /* AddFeedBackEndPoint.swift in Sources */, - 39F52C4729232DD600B19A77 /* LoginDTO.swift in Sources */, 3EA341EA29261ADD005CBD1C /* InProgressEndPoint.swift in Sources */, 396334D7292DADBE00E74B77 /* AppleLoginDTO.swift in Sources */, D7A585222990C50700E1F4EE /* TeamManageSettingCell.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift index 1ee507ac..22a8aa6f 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift @@ -89,8 +89,8 @@ extension MemberCollectionView: UICollectionViewDataSource { assert(false, "Wrong Cell") return UICollectionViewCell() } - if let username = memberList[indexPath.item].userName { - cell.setupLayoutInfoView(nickname: username, role: memberList[indexPath.item].role ?? "", imagePath: memberList[indexPath.item].profileImagePath) + if let nickname = memberList[indexPath.item].nickname { + cell.setupLayoutInfoView(nickname: nickname, role: memberList[indexPath.item].role ?? "", imagePath: memberList[indexPath.item].profileImagePath) } return cell } diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/LoginDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/LoginDTO.swift deleted file mode 100644 index a3e49726..00000000 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/LoginDTO.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// LoginDTO.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2022/11/15. -// - -import Foundation - -struct LoginDTO: Encodable { - let username: String -} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift deleted file mode 100644 index f9872444..00000000 --- a/Maddori.Apple/Maddori.Apple/Network/Response/CurrentMemberResponse.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// CurrentMemberResponse.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2022/11/15. -// - -import Foundation - -struct MemberDetailResponse: Decodable { - let userId: Int? - let userName: String? - let role: String? - let profileImagePath: String? - - enum CodingKeys: String, CodingKey { - case userId = "id" - case userName = "nickname" - case role = "role" - case profileImagePath = "profile_image_path" - } -} - - -struct TeamMembersResponse: Decodable { - // MARK: - getTeamMembers - let members: [MemberDetailResponse]? -} - -// MARK: - TeamMembersResponse v2, conflict 방지용 - -struct MembersResponse: Decodable { - // MARK: - getTeamMembers - let members: [TeamMemberResponse]? -} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift index 3171a455..10e389da 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift @@ -13,7 +13,7 @@ struct EditFeedBackResponse: Decodable { let type: FeedBackType let keyword: String let content: String - let toUser: SimpleMemberResponse + let toUser: MemberResponse enum CodingKeys: String, CodingKey { case id diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift index 2e0d9109..6aa01b2b 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift @@ -41,7 +41,7 @@ struct SimpleFeedBackContentResponse: Decodable { let type: FeedBackType? let keyword: String? let content: String? - let toUser: SimpleMemberResponse? + let toUser: MemberResponse? enum CodingKeys: String, CodingKey { case id diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackInfoResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackInfoResponse.swift index d1c028d5..6d4ab962 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackInfoResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackInfoResponse.swift @@ -9,7 +9,7 @@ import Foundation struct FeedBackInfoResponse: Decodable { // MARK: - getFromMeToCertainMemberFeedbackAll - let toUser: SimpleMemberResponse + let toUser: MemberResponse let reflection: ReflectionResponse let continueArray: [KeywordResponse] let stopArray: [KeywordResponse] diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift index 79edab12..19717277 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift @@ -8,20 +8,11 @@ import Foundation struct MemberResponse: Decodable { - // MARK: - userLogin - let userId: Int? - let userName: String? - - enum CodingKeys: String, CodingKey { - case userId = "id" - case userName = "username" - } + let id: Int? + let nickname: String? } -// MARK: - MemberResponse v2 / conflict 방지용 - -struct TeamMemberResponse: Decodable { - // MARK: - userLogin +struct MemberDetailResponse: Decodable { let id: Int? let nickname: String? let role: String? @@ -34,11 +25,3 @@ struct TeamMemberResponse: Decodable { case profileImagePath = "profile_image_path" } } - -// MARK: - MemberResponse와 동일한 역할 v2용 - -struct SimpleMemberResponse: Decodable { - // MARK: - createFeedback(FeedBackContentResponse) - let id: Int? - let nickname: String? -} diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/MembersDetailResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/MembersDetailResponse.swift new file mode 100644 index 00000000..5507286d --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Network/Response/MembersDetailResponse.swift @@ -0,0 +1,13 @@ +// +// MembersDetailResponse.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2022/11/15. +// + +import Foundation + +struct MembersDetailResponse: Decodable { + // MARK: - getTeamMembers + let members: [MemberDetailResponse]? +} diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift index 2e1a7a83..cdf3d234 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift @@ -70,9 +70,9 @@ final class AddFeedbackDetailViewController: BaseViewController { let view = SelectMemberView() view.upDownImageView.transform = CGAffineTransform(rotationAngle: .pi) view.didSelectedMemeber = { [weak self] user in - guard let userName = user.userName, - let userId = user.userId else { return } - self?.toName = userName + guard let nickname = user.nickname, + let userId = user.id else { return } + self?.toName = nickname self?.toId = userId self?.openSelectTypeView() @@ -297,7 +297,7 @@ final class AddFeedbackDetailViewController: BaseViewController { private func fetchTeamDetailMember(type: TeamDetailEndPoint) { AF.request(type.address, method: type.method, - headers: type.headers).responseDecodable(of: BaseModel.self) { json in + headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let data = json.value { guard let members = data.detail?.members else { return } DispatchQueue.main.async { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgress/InProgressViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/InProgress/InProgressViewController.swift index 47b7eeb9..559d9244 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgress/InProgressViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/InProgress/InProgressViewController.swift @@ -167,7 +167,7 @@ final class InProgressViewController: BaseViewController { content: feedback.content ?? "", // FIXME: startContent가 없을 경우 "" 로 둬도 될까? startContent: feedback.startContent ?? "", - fromUser: feedback.fromUser?.userName ?? "팀원" + fromUser: feedback.fromUser?.nickname ?? "팀원" ) keywordList.append(keyword) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift index fb568211..b1bc94de 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/ReflectionMember/ReflectionMemberCollectionView.swift @@ -25,12 +25,12 @@ final class ReflectionMemberCollectionView: UIView { right: collectionHorizontalSpacing) } - var memberList: [TeamMemberResponse] = [] { + var memberList: [MemberDetailResponse] = [] { didSet { collectionView.reloadData() } } - var didTappedMember: ((TeamMemberResponse, [Int]) -> ())? + var didTappedMember: ((MemberDetailResponse, [Int]) -> ())? var selectedMemberList: [Int] = UserDefaultStorage.seenMemberIdList { willSet { UserDefaultHandler.appendSeenMemberIdList(memberIdList: newValue) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index fa135b21..448b4fa6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -108,9 +108,9 @@ final class SelectReflectionMemberViewController: BaseViewController { private func didTappedMember() { memberCollectionView.didTappedMember = { [weak self] member, members in guard let id = member.id, - let username = member.nickname, + let nickname = member.nickname, let reflectionId = self?.reflectionId else { return } - let viewController = InProgressViewController(memberId: id, memberUsername: username, reflectionId: reflectionId) + let viewController = InProgressViewController(memberId: id, memberUsername: nickname, reflectionId: reflectionId) self?.navigationController?.pushViewController(viewController, animated: true) guard let memberCollectionView = self?.memberCollectionView else { return } @@ -129,7 +129,7 @@ final class SelectReflectionMemberViewController: BaseViewController { AF.request(type.address, method: type.method, headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) guard let fetchedMemberList = json.detail?.members else { return } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 4deb3d56..d3a44919 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -219,9 +219,9 @@ final class TeamDetailViewController: BaseViewController { } private func setupMyProfileButton() { - memberTableView.didTappedMyProfile = { [weak self] userName, role, profilePath in + memberTableView.didTappedMyProfile = { [weak self] nickname, role, profilePath in let viewController = SetNicknameViewController(from: .teamDetail) - viewController.userName = userName + viewController.nickname = nickname viewController.role = role viewController.profilePath = profilePath self?.navigationController?.pushViewController(viewController, animated: true) @@ -233,7 +233,7 @@ final class TeamDetailViewController: BaseViewController { private func fetchTeamDetailMember(type: TeamDetailEndPoint) { AF.request(type.address, method: type.method, - headers: type.headers).responseDecodable(of: BaseModel.self) { json in + headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let data = json.value { guard let members = data.detail?.members else { return } DispatchQueue.main.async { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index f3b946dc..6d6d4304 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -66,7 +66,7 @@ final class TeamDetailMembersView: UIView { func loadData(data: [MemberDetailResponse]) { members.removeAll() data.forEach { - if $0.userId == UserDefaultStorage.userId { + if $0.id == UserDefaultStorage.userId { currentMember = $0 } else { members.append($0) @@ -88,8 +88,8 @@ extension TeamDetailMembersView: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: TeamDetailMemberTableViewCell.className, for: indexPath) as? TeamDetailMemberTableViewCell else { return UITableViewCell() } - if let username = members[indexPath.item].userName { - cell.setupLayoutInfoView(nickname: username, role: members[indexPath.item].role ?? "", imagePath: members[indexPath.item].profileImagePath) + if let nickname = members[indexPath.item].nickname { + cell.setupLayoutInfoView(nickname: nickname, role: members[indexPath.item].role ?? "", imagePath: members[indexPath.item].profileImagePath) } cell.selectionStyle = .none return cell @@ -101,7 +101,7 @@ extension TeamDetailMembersView: UITableViewDataSource { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { guard let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: TeamDetailMemberTableHeaderView.className) as? TeamDetailMemberTableHeaderView else { return UITableViewHeaderFooterView() } - headerView.setupMemberInfoView(nickname: currentMember?.userName ?? UserDefaultStorage.nickname, + headerView.setupMemberInfoView(nickname: currentMember?.nickname ?? UserDefaultStorage.nickname, role: currentMember?.role ?? "", imagePath: currentMember?.profileImagePath ?? "") let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTappedHeaderView)) @@ -114,6 +114,6 @@ extension TeamDetailMembersView: UITableViewDataSource { } @objc func didTappedHeaderView(gestureRecognizer: UIGestureRecognizer) { - didTappedMyProfile?(currentMember?.userName ?? UserDefaultStorage.nickname, currentMember?.role ?? "", currentMember?.profileImagePath ?? "") + didTappedMyProfile?(currentMember?.nickname ?? UserDefaultStorage.nickname, currentMember?.role ?? "", currentMember?.profileImagePath ?? "") } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift index 7f74b25f..ec0943c7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift @@ -19,7 +19,7 @@ final class MyFeedbackViewController: BaseViewController { } else { setLayoutMyFeedbackView() memberCollectionView.reloadData() - fetchCertainMemberFeedBack(type: .fetchCertainMemberFeedBack(memberId: memberList[selectedIndex].userId ?? 0)) + fetchCertainMemberFeedBack(type: .fetchCertainMemberFeedBack(memberId: memberList[selectedIndex].id ?? 0)) } } } @@ -141,12 +141,12 @@ final class MyFeedbackViewController: BaseViewController { AF.request(type.address, method: type.method, headers: type.headers - ).responseDecodable(of: BaseModel.self) { [weak self] json in + ).responseDecodable(of: BaseModel.self) { [weak self] json in if let data = json.value { var memberArray: [MemberDetailResponse] = [] guard let members = json.value?.detail?.members else { return } members.forEach { - if $0.userName != UserDefaultStorage.nickname { + if $0.nickname != UserDefaultStorage.nickname { memberArray.append($0) } } @@ -174,7 +174,7 @@ final class MyFeedbackViewController: BaseViewController { extension MyFeedbackViewController: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - guard let memberId = memberList[indexPath.item].userId else { return } + guard let memberId = memberList[indexPath.item].id else { return } fetchCertainMemberFeedBack(type: .fetchCertainMemberFeedBack(memberId: memberId)) selectedIndex = indexPath.item } @@ -189,7 +189,7 @@ extension MyFeedbackViewController: UICollectionViewDataSource { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MyFeedbackMemberCollectionViewCell.className, for: indexPath) as? MyFeedbackMemberCollectionViewCell else { return UICollectionViewCell() } - cell.setMemberName(name: memberList[indexPath.item].userName ?? "") + cell.setMemberName(name: memberList[indexPath.item].nickname ?? "") cell.setMemberProfileImage(from: memberList[indexPath.item].profileImagePath) if indexPath.item == selectedIndex { cell.isSelected = true diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift index d69b7967..c19998c5 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift @@ -173,7 +173,7 @@ extension MyReflectionDetailViewController: UITableViewDataSource { guard let cell = tableView.dequeueReusableCell(withIdentifier: MyReflectionDetailTableViewCell.className, for: indexPath) as? MyReflectionDetailTableViewCell else { return UITableViewCell() } guard let keyword = contentArray[indexPath.row].keyword, let content = contentArray[indexPath.row].content else { return UITableViewCell() } - let fromLabelText = contentArray[indexPath.row].fromUser?.userName ?? TextLiteral.myReflectionViewControllerDeleteUserTitle + let fromLabelText = contentArray[indexPath.row].fromUser?.nickname ?? TextLiteral.myReflectionViewControllerDeleteUserTitle cell.configLabel(title: keyword, fromLabel: fromLabelText, content: content) tableView.isScrollEnabled = true return cell diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift index bb9a43db..8674a488 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift @@ -54,7 +54,7 @@ final class MyReflectionFeedbackViewController: BaseViewController { }() private lazy var feedbackFromText: UILabel = { let label = UILabel() - label.text = model.fromUser?.userName ?? TextLiteral.myReflectionViewControllerDeleteUserTitle + label.text = model.fromUser?.nickname ?? TextLiteral.myReflectionViewControllerDeleteUserTitle label.textColor = .black100 label.font = .label3 return label diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 0ef374fd..b9d67a1d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -25,7 +25,7 @@ final class SetNicknameViewController: BaseViewController { } private let cameraPicker = UIImagePickerController() private let teamName: String = UserDefaultStorage.teamName - var userName: String? + var nickname: String? var role: String? var profilePath: String? private var profileURL: URL? @@ -372,7 +372,7 @@ final class SetNicknameViewController: BaseViewController { navigationController?.isNavigationBarHidden = false self.tabBarController?.tabBar.isHidden = true - nicknameTextField.text = userName + nicknameTextField.text = nickname roleTextField.text = role if let profilePath { profileImageButton.profileImage.load(from: UrlLiteral.imageBaseURL + profilePath) @@ -493,7 +493,7 @@ final class SetNicknameViewController: BaseViewController { fileName: ".png", mimeType: "image/png") } - }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in + }, to: type.address, method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let json = json.value { dump(json) guard let nickname = json.detail?.nickname else { return } @@ -520,7 +520,7 @@ extension SetNicknameViewController: UITextFieldDelegate { checkMaxLength(textField: textField) if textField == nicknameTextField { - if textField.text != userName { + if textField.text != nickname { let hasText = textField.hasText doneButton.isDisabled = !hasText } else { From 21dffa9f0bc5659199379ef45bb70b9eb96295c3 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 2 May 2023 00:35:57 +0900 Subject: [PATCH 333/388] =?UTF-8?q?[CHORE]=20FeedBackContentResponse=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EC=82=AD=EC=A0=9C=20&=20start?= =?UTF-8?q?=20content=20=EC=82=AD=EC=A0=9C(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/Model/Keyword/Keyword.swift | 1 - .../ReflectionInfo/ReflectionInfoModel.swift | 4 +-- .../Response/AllFeedBackResponse.swift | 4 +-- .../Response/FeedBackContentResponse.swift | 28 ------------------- .../Network/Response/FeedBackResponse.swift | 2 +- .../AddFeedbackKeywordViewController.swift | 2 +- .../InProgress/InProgressViewController.swift | 7 ++--- .../MyReflectionDetailViewController.swift | 4 +-- .../MyReflectionFeedbackViewController.swift | 2 +- 9 files changed, 10 insertions(+), 44 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Model/Keyword/Keyword.swift b/Maddori.Apple/Maddori.Apple/Network/Model/Keyword/Keyword.swift index f5ae0b46..767911a5 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Model/Keyword/Keyword.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Model/Keyword/Keyword.swift @@ -13,6 +13,5 @@ struct Keyword { let type: FeedBackType let keyword: String let content: String - let startContent: String? let fromUser: String } diff --git a/Maddori.Apple/Maddori.Apple/Network/Model/ReflectionInfo/ReflectionInfoModel.swift b/Maddori.Apple/Maddori.Apple/Network/Model/ReflectionInfo/ReflectionInfoModel.swift index 292b797e..c87eb9d1 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Model/ReflectionInfo/ReflectionInfoModel.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Model/ReflectionInfo/ReflectionInfoModel.swift @@ -10,7 +10,6 @@ import Foundation enum FeedBackType: String, CaseIterable, Decodable { case continueType = "Continue" case stopType = "Stop" - case startType = "Start" } struct ReflectionInfoModel { @@ -18,7 +17,6 @@ struct ReflectionInfoModel { let feedbackType: FeedBackType let keyword: String let info: String - let start: String - static let mockData = ReflectionInfoModel(nickname: "곰민", feedbackType: .continueType, keyword: "정리정돈", info: "이번 스프린트 때 유독 행사가 많았는데 그때마다 행사 전후로 정리정돈 잘 해주셔서 감사해요 ! 특히 행사 끝나고 분리수거 깔끔해주신 게 인상 깊어요 ㅋㅋ 앞으로 우리 팀의 청결 지킴이 해주실거죠? 잘 부탁드립니다 ~", start: "새로운 제안이라고 하면 좀 이상할 수도 있지만 앞으로도 계속 청결함을 지켜주는 역할 해주시길.. 최고의 선생님 !!!!") + static let mockData = ReflectionInfoModel(nickname: "곰민", feedbackType: .continueType, keyword: "정리정돈", info: "이번 스프린트 때 유독 행사가 많았는데 그때마다 행사 전후로 정리정돈 잘 해주셔서 감사해요 ! 특히 행사 끝나고 분리수거 깔끔해주신 게 인상 깊어요 ㅋㅋ 앞으로 우리 팀의 청결 지킴이 해주실거죠? 잘 부탁드립니다 ~") } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/AllFeedBackResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/AllFeedBackResponse.swift index 8f2c6ebd..6ef254f5 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/AllFeedBackResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/AllFeedBackResponse.swift @@ -10,8 +10,8 @@ import Foundation struct AllFeedBackResponse: Decodable { // MARK: - getTeamAndUserFeedback let category: String? - let userFeedback: [FeedBackContentResponse]? - let teamFeedback: [FeedBackContentResponse]? + let userFeedback: [FeedBackResponse]? + let teamFeedback: [FeedBackResponse]? enum CodingKeys: String, CodingKey { case category diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift index 6aa01b2b..6d02df1d 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift @@ -8,34 +8,6 @@ import Foundation struct FeedBackContentResponse: Decodable { - // MARK: - createFeedback - let id: Int? - let type: FeedBackType? - let keyword: String? - let content: String? - let startContent: String? - let fromId: Int? - let toId: Int? - let teamId: Int? - let reflectionId: Int? - let fromUser: MemberResponse? - - enum CodingKeys: String, CodingKey { - case id - case type - case keyword - case content - case startContent = "start_content" - case fromId = "from_id" - case toId = "to_id" - case teamId = "team_id" - case reflectionId = "reflection_id" - case fromUser = "from_user" - } -} - -// MARK: - create feedback 용 / 나중에 FeedBackContentResponse 합치기 -struct SimpleFeedBackContentResponse: Decodable { // MARK: - createFeedback let id: Int? let type: FeedBackType? diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackResponse.swift index d078ae04..768b421a 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackResponse.swift @@ -9,7 +9,7 @@ import Foundation struct FeedBackResponse: Decodable { let id: Int? - let type: String? + let type: FeedBackType? let keyword: String? let content: String? let fromUser: MemberResponse? diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackKeywordViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackKeywordViewController.swift index b9f91705..6748d75e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackKeywordViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackKeywordViewController.swift @@ -243,7 +243,7 @@ final class AddFeedbackKeywordViewController: BaseViewController { parameters: type.body, encoder: JSONParameterEncoder.default, headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let data = json.value { dump(data) DispatchQueue.main.async { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgress/InProgressViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/InProgress/InProgressViewController.swift index 559d9244..d28f6422 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgress/InProgressViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/InProgress/InProgressViewController.swift @@ -157,7 +157,7 @@ final class InProgressViewController: BaseViewController { // MARK: - func - private func convert(_ response: [FeedBackContentResponse]) -> [Keyword] { + private func convert(_ response: [FeedBackResponse]) -> [Keyword] { var keywordList: [Keyword] = [] for feedback in response { let keyword = Keyword( @@ -165,8 +165,6 @@ final class InProgressViewController: BaseViewController { type: feedback.type ?? .continueType, keyword: feedback.keyword ?? "키워드", content: feedback.content ?? "", - // FIXME: startContent가 없을 경우 "" 로 둬도 될까? - startContent: feedback.startContent ?? "", fromUser: feedback.fromUser?.nickname ?? "팀원" ) keywordList.append(keyword) @@ -213,12 +211,11 @@ extension InProgressViewController: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { guard let cell = keywordCollectionView.cellForItem(at: indexPath) as? KeywordCollectionViewCell else { return } let keyword = keywordsSectionList[indexPath.section][indexPath.item] - guard let startContent = keyword.startContent else { return } let feedbackInfo = ReflectionInfoModel( nickname: keyword.fromUser, feedbackType: keyword.type, keyword: keyword.keyword, - info: keyword.content, start: startContent + info: keyword.content ) UserDefaultHandler.appendSeenKeywordIdList(keywordId: keyword.id) DispatchQueue.main.async { diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift index c19998c5..1c322750 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift @@ -132,8 +132,8 @@ final class MyReflectionDetailViewController: BaseViewController { if let json = json.value { guard let jsonDetail = json.detail else { return } self.contentArray.append(contentsOf: jsonDetail.feedback) - self.continueArray = self.contentArray.filter { $0.type == "Continue" } - self.stopArray = self.contentArray.filter{ $0.type == "Stop" } + self.continueArray = self.contentArray.filter { $0.type == .continueType } + self.stopArray = self.contentArray.filter{ $0.type == .stopType } self.reloadTableView(type: FeedBackDTO.continueType.rawValue) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift index 8674a488..e00a509d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift @@ -40,7 +40,7 @@ final class MyReflectionFeedbackViewController: BaseViewController { }() private lazy var feedbackTypeText: UILabel = { let label = UILabel() - label.text = model.type + label.text = model.type?.rawValue label.textColor = .black100 label.font = .label3 return label From d29e32fc381ffa22f320424a665bb4484ae39b30 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 2 May 2023 01:02:36 +0900 Subject: [PATCH 334/388] =?UTF-8?q?[CHORE]=20TeamInfoResponse=20->=20TeamN?= =?UTF-8?q?ameResponse=20=EB=A1=9C=20=EB=B3=80=EA=B2=BD(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index d3a44919..ab5fd066 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -277,7 +277,7 @@ final class TeamDetailViewController: BaseViewController { private func fetchUserTeamList(type: TeamDetailEndPoint, completion: @escaping (() ->())) { AF.request(type.address, method: type.method, - headers: type.headers).responseDecodable(of: BaseModel<[TeamInfoResponse]>.self) { json in + headers: type.headers).responseDecodable(of: BaseModel<[TeamNameResponse]>.self) { json in if let data = json.value { guard let teams = data.detail else { return } if !teams.isEmpty { From 66b301b25ab04987e34406a6cb51723a6cee14f0 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 2 May 2023 01:21:15 +0900 Subject: [PATCH 335/388] =?UTF-8?q?[CHORE]=20Start=20Content=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Model/FeedbackFromMe/FeedbackFromMeModel.swift | 1 - .../Maddori.Apple/Network/Response/KeywordResponse.swift | 8 -------- .../MyFeedback/MyFeedback/MyFeedbackViewController.swift | 1 - .../MyFeedback/UIComponent/MyFeedbackCollectionView.swift | 6 ------ .../MyFeedbackDetail/MyFeedbackDetailViewController.swift | 2 +- 5 files changed, 1 insertion(+), 17 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Model/FeedbackFromMe/FeedbackFromMeModel.swift b/Maddori.Apple/Maddori.Apple/Network/Model/FeedbackFromMe/FeedbackFromMeModel.swift index 847a4e91..cd401853 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Model/FeedbackFromMe/FeedbackFromMeModel.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Model/FeedbackFromMe/FeedbackFromMeModel.swift @@ -19,7 +19,6 @@ struct FeedbackFromMeModel { let feedbackType: FeedbackButtonType let keyword: String let info: String - let start: String? let reflectionStatus: ReflectionStatus } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/KeywordResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/KeywordResponse.swift index b8d6679e..79071b42 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/KeywordResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/KeywordResponse.swift @@ -11,12 +11,4 @@ struct KeywordResponse: Decodable { let id: Int? let keyword: String? let content: String? - let startContent: String? - - enum CodingKeys: String, CodingKey { - case id - case keyword - case content - case startContent = "start_content" - } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift index ec0943c7..a45ec035 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/MyFeedbackViewController.swift @@ -72,7 +72,6 @@ final class MyFeedbackViewController: BaseViewController { feedbackType: data.feedbackType, keyword: data.keyword, info: data.info, - start: data.start, reflectionStatus: data.reflectionStatus ) self?.navigationController?.pushViewController(MyFeedbackDetailViewController(feedbackDetail: data), animated: true) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift index 36b3ea3c..35c21a4b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift @@ -115,9 +115,6 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { let info = isContinueSection ? data.continueArray[indexPath.item].content ?? "" : data.stopArray[indexPath.item].content ?? "" - let start = isContinueSection - ? data.continueArray[indexPath.item].startContent - : data.stopArray[indexPath.item].startContent let reflectionStatus = ReflectionStatus.init(rawValue: feedbackInfo?.reflection.state?.rawValue ?? "Before") let data = FeedbackFromMeModel(reflectionId: reflectionId, @@ -126,7 +123,6 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { feedbackType: indexPath.section == 0 ? .continueType : .stopType, keyword: keyword, info: info, - start: start, reflectionStatus: reflectionStatus ?? .Before ) didTappedCell?(data) @@ -141,7 +137,6 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { feedbackType: .continueType, keyword: continueArray[indexPath.item].keyword ?? "", info: continueArray[indexPath.item].content ?? "", - start: continueArray[indexPath.item].startContent, reflectionStatus: reflectionStatus ?? .Before ) didTappedCell?(data) @@ -152,7 +147,6 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { feedbackType: .stopType, keyword: stopArray[indexPath.item].keyword ?? "", info: stopArray[indexPath.item].content ?? "", - start: stopArray[indexPath.item].startContent, reflectionStatus: reflectionStatus ?? .Before ) didTappedCell?(data) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackDetail/MyFeedbackDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackDetail/MyFeedbackDetailViewController.swift index 0eeed8a1..a23f06a0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackDetail/MyFeedbackDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackDetail/MyFeedbackDetailViewController.swift @@ -66,7 +66,7 @@ final class MyFeedbackDetailViewController: BaseViewController { private let feedbackContentScrollView = UIScrollView() private lazy var feedbackContentText: UILabel = { let label = UILabel() - let text = feedbackDetail.info + "\n\n" + (feedbackDetail.start ?? "") + let text = feedbackDetail.info label.setTextWithLineHeight(text: text, lineHeight: 24) label.textColor = .gray400 label.font = .body1 From ed4d548ba71585b50e24a4f7a0a417c37d1e5524 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 2 May 2023 01:35:05 +0900 Subject: [PATCH 336/388] =?UTF-8?q?[CHORE]=20EditFeedBackResponse=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 4 --- .../Response/EditFeedBackResponse.swift | 25 ------------------- .../MyFeedbackEditViewController.swift | 2 +- 3 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 1b54c431..662efbdd 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -77,7 +77,6 @@ 39F52C5F2923338B00B19A77 /* MembersDetailResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C5E2923338B00B19A77 /* MembersDetailResponse.swift */; }; 39F52C612923344C00B19A77 /* FeedBackContentResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */; }; 39F52C632923357700B19A77 /* FeedBackInfoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */; }; - 39F52C652923369000B19A77 /* EditFeedBackResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C642923369000B19A77 /* EditFeedBackResponse.swift */; }; 39F52C68292472EB00B19A77 /* AllFeedBackResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C67292472EB00B19A77 /* AllFeedBackResponse.swift */; }; 39F52C6A292473A800B19A77 /* ReflectionInfoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C69292473A800B19A77 /* ReflectionInfoResponse.swift */; }; 39F52C6C292473EC00B19A77 /* AllReflectionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F52C6B292473EC00B19A77 /* AllReflectionResponse.swift */; }; @@ -238,7 +237,6 @@ 39F52C5E2923338B00B19A77 /* MembersDetailResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MembersDetailResponse.swift; sourceTree = ""; }; 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedBackContentResponse.swift; sourceTree = ""; }; 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedBackInfoResponse.swift; sourceTree = ""; }; - 39F52C642923369000B19A77 /* EditFeedBackResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditFeedBackResponse.swift; sourceTree = ""; }; 39F52C67292472EB00B19A77 /* AllFeedBackResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllFeedBackResponse.swift; sourceTree = ""; }; 39F52C69292473A800B19A77 /* ReflectionInfoResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoResponse.swift; sourceTree = ""; }; 39F52C6B292473EC00B19A77 /* AllReflectionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllReflectionResponse.swift; sourceTree = ""; }; @@ -754,7 +752,6 @@ 39F52C5E2923338B00B19A77 /* MembersDetailResponse.swift */, 39F52C602923344C00B19A77 /* FeedBackContentResponse.swift */, 39F52C622923357700B19A77 /* FeedBackInfoResponse.swift */, - 39F52C642923369000B19A77 /* EditFeedBackResponse.swift */, 39F52C67292472EB00B19A77 /* AllFeedBackResponse.swift */, 39F52C69292473A800B19A77 /* ReflectionInfoResponse.swift */, 39F52C6B292473EC00B19A77 /* AllReflectionResponse.swift */, @@ -1245,7 +1242,6 @@ 39257DC728F8FEBD00201E0B /* SceneDelegate.swift in Sources */, 52F07B9A2912541B0015BC8B /* MyFeedbackDetailViewController.swift in Sources */, 39307CF52917DA9300789AB6 /* LoginViewController.swift in Sources */, - 39F52C652923369000B19A77 /* EditFeedBackResponse.swift in Sources */, 525E722528FFCFA600EF3FCB /* FeedbackTypeButtonView.swift in Sources */, 39A64ACE2905885F001DB020 /* StartSuggestionView.swift in Sources */, 391D38DD29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift deleted file mode 100644 index 10e389da..00000000 --- a/Maddori.Apple/Maddori.Apple/Network/Response/EditFeedBackResponse.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// EditFeedBackResponse.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2022/11/15. -// - -import Foundation - -struct EditFeedBackResponse: Decodable { - // MARK: - updateFeedback - let id: Int - let type: FeedBackType - let keyword: String - let content: String - let toUser: MemberResponse - - enum CodingKeys: String, CodingKey { - case id - case type - case keyword - case content - case toUser = "to_user" - } -} diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift index 6881d5b2..75a9157f 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift @@ -301,7 +301,7 @@ final class MyFeedbackEditViewController: BaseViewController { parameters: type.body, encoder: JSONParameterEncoder.default, headers: type.headers - ).responseDecodable(of: BaseModel.self) { json in + ).responseDecodable(of: BaseModel.self) { json in if let _ = json.value { DispatchQueue.main.async { self.dismiss(animated: true) { From c6ca2ce6701c516a7c1c9b317ef9d1608e5e6b89 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 2 May 2023 01:50:26 +0900 Subject: [PATCH 337/388] =?UTF-8?q?[CHORE]=20admin=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/HomeViewController.swift | 7 +++---- .../SelectReflectionMemberViewController.swift | 4 +--- .../StartReflection/StartReflectionViewController.swift | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index f7e797b7..89876107 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -29,7 +29,6 @@ final class HomeViewController: BaseViewController { var reflectionTitle: String = "" var reflectionDate: String = "" - var isAdmin: Bool = false private var currentTeamId: Int = 0 // MARK: - property @@ -233,14 +232,14 @@ final class HomeViewController: BaseViewController { } private func presentSelectReflectionMemberViewController() { - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: self.isAdmin)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId)) viewController.modalPresentationStyle = .fullScreen present(viewController, animated: true) } private func presentStartReflectionView() { guard let navigationController = self.navigationController else { return } - let viewController = StartReflectionViewController(reflectionId: currentReflectionId, navigationViewController: navigationController, isAdmin: self.isAdmin) + let viewController = StartReflectionViewController(reflectionId: currentReflectionId, navigationViewController: navigationController) viewController.modalPresentationStyle = .overFullScreen present(viewController, animated: true) UserDefaultHandler.setHasSeenAlert(to: true) @@ -406,7 +405,7 @@ extension HomeViewController: UICollectionViewDataSource { presentAddFeedbackViewController() case .Progressing: guard let navigationController = self.navigationController else { return } - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId, isAdmin: isAdmin)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: currentReflectionId)) viewController.modalPresentationStyle = .fullScreen navigationController.present(viewController, animated: true) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index 448b4fa6..3a747035 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -13,7 +13,6 @@ import SnapKit final class SelectReflectionMemberViewController: BaseViewController { let reflectionId: Int - let isAdmin: Bool // MARK: - property @@ -46,9 +45,8 @@ final class SelectReflectionMemberViewController: BaseViewController { // MARK: - life cycle - init(reflectionId: Int, isAdmin: Bool) { + init(reflectionId: Int) { self.reflectionId = reflectionId - self.isAdmin = isAdmin super.init() } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift index 16e8d900..9983f8fc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/StartReflection/StartReflectionViewController.swift @@ -13,12 +13,10 @@ final class StartReflectionViewController: BaseViewController { let reflectionId: Int let navigationViewController: UINavigationController - let isAdmin: Bool - init(reflectionId: Int, navigationViewController: UINavigationController, isAdmin: Bool) { + init(reflectionId: Int, navigationViewController: UINavigationController) { self.reflectionId = reflectionId self.navigationViewController = navigationViewController - self.isAdmin = isAdmin super.init() } @@ -164,7 +162,7 @@ final class StartReflectionViewController: BaseViewController { // MARK: - func private func presentSelectReflectionMemberViewController() { - let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: self.reflectionId, isAdmin: self.isAdmin)) + let viewController = UINavigationController(rootViewController: SelectReflectionMemberViewController(reflectionId: self.reflectionId)) viewController.modalPresentationStyle = .fullScreen self.navigationViewController.present(viewController, animated: true) } From 2c86d6d69abdb02be7a2a2017cf1790a92d09ae0 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 2 May 2023 03:01:12 +0900 Subject: [PATCH 338/388] =?UTF-8?q?[CHORE]=20mark=20=EC=B6=94=EA=B0=80(#35?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Network/Reqeust/DTO/AddReflectionDTO.swift | 1 + .../Maddori.Apple/Network/Reqeust/DTO/AppleLoginDTO.swift | 1 + .../Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift | 1 + .../Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift | 1 + .../Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift | 1 + .../Network/Response/AllCertainTypeFeedBackResponse.swift | 2 +- .../Maddori.Apple/Network/Response/AppleLoginResponse.swift | 1 + .../Network/Response/FeedBackContentResponse.swift | 4 ++-- .../Maddori.Apple/Network/Response/JoinTeamResponse.swift | 2 +- .../Maddori.Apple/Network/Response/MemberResponse.swift | 1 + .../Maddori.Apple/Network/Response/ReflectionResponse.swift | 2 +- .../Maddori.Apple/Network/Response/TeamInfoResponse.swift | 2 +- .../Maddori.Apple/Network/Response/TeamNameResponse.swift | 1 + 13 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/AddReflectionDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/AddReflectionDTO.swift index a3720a66..fcf21171 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/AddReflectionDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/AddReflectionDTO.swift @@ -8,6 +8,7 @@ import Foundation struct AddReflectionDTO: Encodable { + // MARK: - updateReflectionDetail let reflection_name: String let reflection_date: String } diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/AppleLoginDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/AppleLoginDTO.swift index ab94ba90..48ef382a 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/AppleLoginDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/AppleLoginDTO.swift @@ -8,5 +8,6 @@ import Foundation struct AppleLoginDTO: Encodable { + // MARK: - appleLogin let token: String } diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift index d1c28c9d..6ab39c0a 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift @@ -8,6 +8,7 @@ import Foundation struct CreateTeamDTO: Encodable { + // MARK: - createTeam let team_name: String let nickname: String let role: String? diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift index 4f5db22d..343d1b6b 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/EditFeedBackDTO.swift @@ -8,6 +8,7 @@ import Foundation struct EditFeedBackDTO: Encodable { + // MARK: - updateFeedback let type: FeedBackDTO let keyword: String let content: String diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift index c67eb651..9771e934 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/JoinTeamDTO.swift @@ -8,6 +8,7 @@ import Foundation struct JoinTeamDTO: Encodable { + // MARK: - userJoinTeam, editProfile let nickname: String let role: String? } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/AllCertainTypeFeedBackResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/AllCertainTypeFeedBackResponse.swift index 86fdad65..a327a864 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/AllCertainTypeFeedBackResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/AllCertainTypeFeedBackResponse.swift @@ -8,6 +8,6 @@ import Foundation struct AllCertainTypeFeedBackResponse: Decodable { - // MARK: - getCertainTypeFeedbackAll-id + // MARK: - getCertainTypeFeedbackAll let feedback: [FeedBackResponse] } diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/AppleLoginResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/AppleLoginResponse.swift index c77cd6e4..01eaff6a 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/AppleLoginResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/AppleLoginResponse.swift @@ -8,6 +8,7 @@ import Foundation struct AppleLoginResponse: Decodable { + // MARK: - appleLogin let created: Bool? let accessToken: String? let refreshToken: String? diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift index 6d02df1d..a7852606 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/FeedBackContentResponse.swift @@ -1,5 +1,5 @@ // -// AddFeedBackContentResponse.swift +// FeedBackContentResponse.swift // Maddori.Apple // // Created by Mingwan Choi on 2022/11/15. @@ -8,7 +8,7 @@ import Foundation struct FeedBackContentResponse: Decodable { - // MARK: - createFeedback + // MARK: - createFeedback, updateFeedback let id: Int? let type: FeedBackType? let keyword: String? diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift index 48e12659..9bddd772 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/JoinTeamResponse.swift @@ -8,7 +8,7 @@ import Foundation struct JoinTeamResponse: Decodable { - // MARK: - userJoinTeam + // MARK: - userJoinTeam, createTeam let id: Int? let nickname: String? let role: String? diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift index 19717277..6e5a9a93 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift @@ -13,6 +13,7 @@ struct MemberResponse: Decodable { } struct MemberDetailResponse: Decodable { + // MARK: - editProfile let id: Int? let nickname: String? let role: String? diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/ReflectionResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/ReflectionResponse.swift index 86b18bed..930c7f99 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/ReflectionResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/ReflectionResponse.swift @@ -8,7 +8,7 @@ import Foundation struct ReflectionResponse: Decodable { - // MARK: - patchReflectionDetail, deleteReflectionDetail, endInProgressReflection + // MARK: - patchReflectionDetail, deleteReflectionDetail, updateReflectionDetail let id: Int? let reflectionName: String? let date: String? diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift index 881b7dae..2a9071c8 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift @@ -8,7 +8,7 @@ import Foundation struct TeamInfoResponse: Decodable { - // MARK: - getCertainTeamName + // MARK: - getCertainTeamDetail let id: Int? let teamName: String? let invitationCode: String? diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift index 443b0874..a638b748 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift @@ -8,6 +8,7 @@ import Foundation struct TeamNameResponse: Decodable { + // MARK: - getCertainTeamName, editTeamName, getUserTeamList let id: Int let teamName: String From de4af171bf79864d08571ae6d6a0331bbf0b73ec Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 5 May 2023 08:05:49 +0900 Subject: [PATCH 339/388] =?UTF-8?q?[CHORE]=20=ED=8C=80=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EC=88=98=EC=A0=95=20View=20NavigationBar=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/EditTeamName/EditTeamNameViewController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index 384f4b59..b06f1774 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -69,6 +69,11 @@ final class EditTeamNameViewController: BaseTextFieldViewController { setupDefaultTextFieldText() } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + navigationController?.setNavigationBarHidden(false, animated: true) + } + override func setupNavigationBar() { super.setupNavigationBar() From 35f40d88d4fb060819a5bc4f865f49bdc4a76504 Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 5 May 2023 08:06:14 +0900 Subject: [PATCH 340/388] =?UTF-8?q?[CHORE]=20=EB=92=A4=EB=A1=9C=20?= =?UTF-8?q?=EA=B0=80=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=ED=81=AC=EA=B8=B0=20?= =?UTF-8?q?=EB=8B=A4=EB=A5=B8=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/EditTeamName/EditTeamNameViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index b06f1774..f29f73fc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -53,7 +53,7 @@ final class EditTeamNameViewController: BaseTextFieldViewController { // MARK: - property private lazy var backButton: BackButton = { - let button = BackButton() + let button = BackButton(type: .system) let action = UIAction { [weak self] _ in self?.navigationController?.popViewController(animated: true) } From f6bfe48892ba4877d73f20879d9c76789af6fdfc Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 7 May 2023 21:22:50 +0900 Subject: [PATCH 341/388] [CHORE] tableview backgroundview set to emptyview --- Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj | 4 ++-- .../TeamDetail/UIComponent/TeamDetailMembersView.swift | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index ae405df0..5858f020 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -8,11 +8,11 @@ /* Begin PBXBuildFile section */ 391596622904176500A432D9 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391596612904176500A432D9 /* UIView+Extension.swift */; }; - 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391612CD29E51F1B004AE982 /* EditTeamNameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */; }; 391612CF29E5352A004AE982 /* EditTeamNameEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */; }; 391612D129E5364A004AE982 /* EditTeamNameDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */; }; 391612D329E53745004AE982 /* EditTeamNameResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D229E53745004AE982 /* EditTeamNameResponse.swift */; }; + 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; @@ -172,11 +172,11 @@ /* Begin PBXFileReference section */ 391596612904176500A432D9 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; - 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameViewController.swift; sourceTree = ""; }; 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameEndPoint.swift; sourceTree = ""; }; 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameDTO.swift; sourceTree = ""; }; 391612D229E53745004AE982 /* EditTeamNameResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameResponse.swift; sourceTree = ""; }; + 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index f3b946dc..9cd19a3c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -63,6 +63,12 @@ final class TeamDetailMembersView: UIView { memberTableView.dataSource = self } + private func determineEmptyTeam() { + if members.isEmpty { + memberTableView.backgroundView = EmptyPersonView() + } + } + func loadData(data: [MemberDetailResponse]) { members.removeAll() data.forEach { @@ -72,6 +78,7 @@ final class TeamDetailMembersView: UIView { members.append($0) } } + determineEmptyTeam() memberTableView.reloadData() } } From 001870aec226acafb99f84fabff950e36e43dad4 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 7 May 2023 21:44:24 +0900 Subject: [PATCH 342/388] [CHORE] selectReflectionMemberVC guideline added (#356) --- .../Global/Literal/TextLiteral.swift | 1 + .../SelectReflectionMemberViewController.swift | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index cb0da550..a6dae9d4 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -139,6 +139,7 @@ enum TextLiteral { // MARK: - SelectReflectionMemberViewController static let selectReflectionMemberViewControllerTitleLabel = "각 팀원이 받은 피드백을\n공유해 보세요" + static let selectReflectionMemberViewControllerSubtitleLabel = "모든 팀원 버튼을 누르면 회고를 종료할 수 있습니다" static let selectReflectionMemberViewControllerDoneButtonText = "모든 회고 끝내기 " // MARK: - InProgressViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift index fa135b21..6a644033 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/SelectReflectionMember/SelectReflectionMemberViewController.swift @@ -31,6 +31,13 @@ final class SelectReflectionMemberViewController: BaseViewController { label.setTitleFont(text: TextLiteral.selectReflectionMemberViewControllerTitleLabel) return label }() + private let reflectionGuidelineLabel: UILabel = { + let label = UILabel() + label.text = TextLiteral.selectReflectionMemberViewControllerSubtitleLabel + label.font = .caption1 + label.textColor = .gray400 + return label + }() private let memberCollectionView = ReflectionMemberCollectionView() private lazy var feedbackDoneButton: MainButton = { let button = MainButton() @@ -73,6 +80,12 @@ final class SelectReflectionMemberViewController: BaseViewController { $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) } + view.addSubview(reflectionGuidelineLabel) + reflectionGuidelineLabel.snp.makeConstraints { + $0.top.equalTo(selectFeedbackMemberTitleLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) + $0.leading.equalToSuperview().inset(SizeLiteral.leadingTrailingPadding) + } + view.addSubview(feedbackDoneButton) feedbackDoneButton.snp.makeConstraints { $0.bottom.equalTo(view.safeAreaLayoutGuide).inset(SizeLiteral.bottomPadding) @@ -81,7 +94,7 @@ final class SelectReflectionMemberViewController: BaseViewController { view.addSubview(memberCollectionView) memberCollectionView.snp.makeConstraints { - $0.top.equalTo(selectFeedbackMemberTitleLabel.snp.bottom).offset(20) + $0.top.equalTo(reflectionGuidelineLabel.snp.bottom).offset(20) $0.bottom.equalTo(feedbackDoneButton.snp.top).inset(-6) $0.leading.trailing.equalToSuperview() } From 4784387d3e6ea5425735f693c49fe17f1dd44098 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 9 May 2023 02:32:51 +0900 Subject: [PATCH 343/388] =?UTF-8?q?[ADD]=20=ED=8C=80=20=EC=83=9D=EC=84=B1/?= =?UTF-8?q?=ED=95=A9=EB=A5=98=20=EC=9D=B4=EC=A0=84=EC=97=90=20=ED=8C=80=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=EC=9D=B4=20userdefault=EC=97=90=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=EB=90=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0(#358)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/TeamDetail/TeamDetailViewController.swift | 2 +- .../Setup/CreateTeam/CreateTeamViewController.swift | 8 +++----- .../Setup/JoinTeam/JoinTeamViewController.swift | 8 +++----- .../Setup/SetNickname/SetNicknameViewController.swift | 11 ++++++++--- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 4710754f..e614fcd1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -220,7 +220,7 @@ final class TeamDetailViewController: BaseViewController { private func setupMyProfileButton() { memberTableView.didTappedMyProfile = { [weak self] userName, role, profilePath in - let viewController = SetNicknameViewController(from: .teamDetail) + let viewController = SetNicknameViewController(from: .teamDetail, teamId: UserDefaultStorage.teamId, teamName: UserDefaultStorage.teamName) viewController.userName = userName viewController.role = role viewController.profilePath = profilePath diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index 73084837..95377448 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -97,9 +97,7 @@ final class CreateTeamViewController: BaseTextFieldViewController { self?.doneButton.isLoading = false } } else { - UserDefaultHandler.setTeamName(teamName: teamName) - UserDefaultHandler.setTeamId(teamId: 0) - self?.pushSetNicknameViewController() + self?.pushSetNicknameViewController(teamName: teamName) } } } @@ -108,8 +106,8 @@ final class CreateTeamViewController: BaseTextFieldViewController { // MARK: - func - private func pushSetNicknameViewController() { - let viewController = SetNicknameViewController(from: .createView) + private func pushSetNicknameViewController(teamName: String) { + let viewController = SetNicknameViewController(from: .createView, teamId: nil, teamName: teamName) navigationController?.pushViewController(viewController, animated: true) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift index 630d8da8..1c3e4f7d 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/JoinTeam/JoinTeamViewController.swift @@ -167,8 +167,8 @@ final class JoinTeamViewController: BaseTextFieldViewController { present(rootViewController, animated: true) } - private func pushSetNicknameViewController() { - let viewController = SetNicknameViewController(from: .joinView) + private func pushSetNicknameViewController(teamId: Int, teamName: String) { + let viewController = SetNicknameViewController(from: .joinView, teamId: teamId, teamName: teamName) navigationController?.pushViewController(viewController, animated: true) } @@ -184,9 +184,7 @@ final class JoinTeamViewController: BaseTextFieldViewController { guard let teamId = json.detail?.id, let teamName = json.detail?.teamName else { return } - UserDefaultHandler.setTeamId(teamId: teamId) - UserDefaultHandler.setTeamName(teamName: teamName) - self.pushSetNicknameViewController() + self.pushSetNicknameViewController(teamId: teamId, teamName: teamName) } else { DispatchQueue.main.async { self.makeAlert(title: TextLiteral.joinTeamViewControllerAlertTitle, message: TextLiteral.joinTeamViewControllerAlertMessage) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 0ef374fd..427718ed 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -24,12 +24,13 @@ final class SetNicknameViewController: BaseViewController { static let roleMax: Int = 20 } private let cameraPicker = UIImagePickerController() - private let teamName: String = UserDefaultStorage.teamName var userName: String? var role: String? var profilePath: String? private var profileURL: URL? private let fromView: ViewType + private var teamId: Int? + private let teamName: String // MARK: - property @@ -118,8 +119,10 @@ final class SetNicknameViewController: BaseViewController { // MARK: - life cycle - init(from: ViewType) { + init(from: ViewType, teamId: Int?, teamName: String) { self.fromView = from + self.teamId = teamId + self.teamName = teamName super.init() } @@ -321,7 +324,9 @@ final class SetNicknameViewController: BaseViewController { case .createView: dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) case .joinView: - dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId), nickname: nickname, role: role) + if let teamId { + dispatchJoinTeam(type: .dispatchJoinTeam(teamId: teamId), nickname: nickname, role: role) + } case .teamDetail: let dto = JoinTeamDTO(nickname: nickname, role: role) putEditProfile(type: .putEditProfile(dto)) From 7f752670d6c29de15966386283cee03d5c2198f3 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 9 May 2023 20:03:34 +0900 Subject: [PATCH 344/388] =?UTF-8?q?[CHORE]=20TextLiteral=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC(#360)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 16 +---- .../Global/Literal/TextLiteral.swift | 27 +------- .../View/AlertViewController.swift | 2 +- .../UIComponent/StartSuggestionView.swift | 61 ------------------- .../MyFeedbackEditViewController.swift | 4 +- .../SetNicknameViewController.swift | 2 +- 6 files changed, 7 insertions(+), 105 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView.swift diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index ae405df0..94990483 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -8,11 +8,11 @@ /* Begin PBXBuildFile section */ 391596622904176500A432D9 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391596612904176500A432D9 /* UIView+Extension.swift */; }; - 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391612CD29E51F1B004AE982 /* EditTeamNameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */; }; 391612CF29E5352A004AE982 /* EditTeamNameEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */; }; 391612D129E5364A004AE982 /* EditTeamNameDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */; }; 391612D329E53745004AE982 /* EditTeamNameResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D229E53745004AE982 /* EditTeamNameResponse.swift */; }; + 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; @@ -61,7 +61,6 @@ 3984742629264ACE00EDC139 /* MyFeedBackEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3984742529264ACE00EDC139 /* MyFeedBackEndPoint.swift */; }; 39847428292656EB00EDC139 /* VoidModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39847427292656EB00EDC139 /* VoidModel.swift */; }; 3998E86F295C308100541752 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 3998E86E295C308100541752 /* Settings.bundle */; }; - 39A64ACE2905885F001DB020 /* StartSuggestionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39A64ACD2905885F001DB020 /* StartSuggestionView.swift */; }; 39AC287F29269BC6006CFEE6 /* Endpointable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39AC287E29269BC6006CFEE6 /* Endpointable.swift */; }; 39F15C0C296D371500952D02 /* EmptyPersonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F15C0B296D371500952D02 /* EmptyPersonView.swift */; }; 39F1A13529125762005E3456 /* MyFeedbackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F1A13429125762005E3456 /* MyFeedbackViewController.swift */; }; @@ -172,11 +171,11 @@ /* Begin PBXFileReference section */ 391596612904176500A432D9 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; - 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameViewController.swift; sourceTree = ""; }; 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameEndPoint.swift; sourceTree = ""; }; 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameDTO.swift; sourceTree = ""; }; 391612D229E53745004AE982 /* EditTeamNameResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameResponse.swift; sourceTree = ""; }; + 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; @@ -227,7 +226,6 @@ 3984742529264ACE00EDC139 /* MyFeedBackEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedBackEndPoint.swift; sourceTree = ""; }; 39847427292656EB00EDC139 /* VoidModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoidModel.swift; sourceTree = ""; }; 3998E86E295C308100541752 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; - 39A64ACD2905885F001DB020 /* StartSuggestionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartSuggestionView.swift; sourceTree = ""; }; 39AC287E29269BC6006CFEE6 /* Endpointable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Endpointable.swift; sourceTree = ""; }; 39F15C0B296D371500952D02 /* EmptyPersonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyPersonView.swift; sourceTree = ""; }; 39F1A13429125762005E3456 /* MyFeedbackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyFeedbackViewController.swift; sourceTree = ""; }; @@ -359,7 +357,6 @@ 391CBA17290580360044CA30 /* InProgressDetail */ = { isa = PBXGroup; children = ( - 39A64ACC2905882C001DB020 /* UIComponent */, 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */, ); path = InProgressDetail; @@ -682,14 +679,6 @@ path = Storage; sourceTree = ""; }; - 39A64ACC2905882C001DB020 /* UIComponent */ = { - isa = PBXGroup; - children = ( - 39A64ACD2905885F001DB020 /* StartSuggestionView.swift */, - ); - path = UIComponent; - sourceTree = ""; - }; 39AC287D29269BBB006CFEE6 /* Protocol */ = { isa = PBXGroup; children = ( @@ -1262,7 +1251,6 @@ 39307CF52917DA9300789AB6 /* LoginViewController.swift in Sources */, 39F52C652923369000B19A77 /* EditFeedBackResponse.swift in Sources */, 525E722528FFCFA600EF3FCB /* FeedbackTypeButtonView.swift in Sources */, - 39A64ACE2905885F001DB020 /* StartSuggestionView.swift in Sources */, 391D38DD29C44A0400A6BFED /* TeamDetailMemberTableHeaderView.swift in Sources */, D7AFB7C52916EDC300E998B7 /* MyReflectionDetailTableViewCell.swift in Sources */, D7195FBC299223F6002526E7 /* TeamChangeCollectionViewCell.swift in Sources */, diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index cb0da550..5acac938 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -11,7 +11,7 @@ enum TextLiteral { // MARK: - Common - static let doneButtonTitle = "입력완료" + static let doneButtonTitle = "입력 완료" static let feedbackTypeLabel = "피드백 종류" static let feedbackKeywordLabel = "키워드" static let feedbackContentLabel = "내용" @@ -23,15 +23,8 @@ enum TextLiteral { // MARK: - MainViewController static let mainViewControllerCurrentReflectionKeyword = "이번 회고에 담긴 피드백 키워드" - static let mainViewControllerInvitationButtonText = "초대코드" - static let mainViewControllerPlanLabelButtonSubText = "회고 일정이 없습니다" - static let mainViewControllerPlanLabelButtonSubButtonText = "일정 만들기" static let mainViewControllerButtonText = "피드백 추가하기" - // MARK: - SelectFeedbackMemberViewController - - static let selectFeedbackMemberViewControllerTitle = "피드백을 주고 싶은\n팀원을 선택해주세요" - // MARK: - CreateReflectionViewController static let createReflectionViewControllerTitle = "새로운 회고 정보를\n입력해주세요" @@ -48,15 +41,12 @@ enum TextLiteral { // MARK: - SetNicknameViewController - static let setNicknameViewControllerTitleLabel = "키고에서 사용할 \n닉네임을 입력해주세요" - static let setNicknameViewControllerNicknameTextFieldPlaceHolder = "예) 진저, 호야, 성민" static let setNicknameControllerNavigationTitleLabel = "프로필 생성" static let setNicknameControllerTitleLabel = "에서\n사용할 프로필을 작성해 주세요" static let setNicknameControllerNicknameLabel = "닉네임 *" static let setNicknameControllerNicknameTextFieldPlaceHolderText = "ex) 진저" static let setNicknameControllerRoleLabel = "역할" static let setNicknameControllerRoleTextFieldPlaceHolderText = "ex) iOS 개발자" - static let setNicknameControllerDoneButtonText = "입력 완료" static let setNicknameControllerProfileActionSheetTitle = "프로필 사진 설정" static let setNicknameControllerProfileActionSheetLibraryTitle = "앨범에서 사진 선택" static let setNicknameControllerProfileActionSheetCameraTitle = "사진 촬영" @@ -80,12 +70,7 @@ enum TextLiteral { // MARK: - AddFeedbackViewController static let addFeedbackViewControllerTitleLabel = "에게 피드백 주기" - static let addFeedbackViewControllerFeedbackKeywordTextFieldPlaceholder = "피드백을 키워드로 작성해주세요" static let addFeedbackViewControllerFeedbackContentTextViewPlaceholder = "키워드에 대한 자세한 내용을 작성해주세요" - static let addFeedbackViewControllerDoneButtonTitle = "완료" - static let addFeedbackViewControllerFeedbackStartLabel = "Start 제안하기" - static let addFeedbackViewControllerStartTextViewPlaceholder = "제안하고 싶은 Start를 작성해주세요" - static let addFeedbackViewControllerFeedbackSendTimeLabel = "작성한 피드백은 회고 시간 전까지 수정 가능합니다" // MARK: - AddFeedbackContentViewController @@ -132,10 +117,6 @@ enum TextLiteral { static let invitationCodeViewControllerStartButtonText = "시작하기" static let invitationCodeViewControllerSubLabelText = "초대코드는 팀 관리 화면에서 공유할 수 있습니다" - // MARK: - StartSuggestionView - - static let startSuggestionViewStartText = "⭐️ Start" - // MARK: - SelectReflectionMemberViewController static let selectReflectionMemberViewControllerTitleLabel = "각 팀원이 받은 피드백을\n공유해 보세요" @@ -176,7 +157,6 @@ enum TextLiteral { static let myFeedbackDetailViewControllerDeleteButtonText: String = "삭제" static let myFeedbackDetailViewControllerTitleLabel: String = "에게 쓴 피드백" - static let myFeedbackDetailViewControllerFeedbackStartLabel: String = "Start" static let myFeedbackDetailViewControllerEditButtonText: String = "수정하러 가기" static let myFeedbackDetailViewControllerReflectionIsStartedLabel: String = "회고가 시작되었습니다" static let myFeedbackDetailViewControllerBeforeReflectionLabel: String = "담아둔 피드백은 회고 시간 전까지 수정 가능합니다" @@ -185,10 +165,7 @@ enum TextLiteral { // MARK: - AlertViewController static let alertViewControllerTypeDeleteTitle = "피드백 삭제하기" - static let alertViewControllerTypeJoinTitle = "합류할 팀" static let alertViewControllerTypeDeleteSubTitle = "삭제된 피드백은 복구할 수 없습니다" - static let alertViewControllerTypeJoinSubTitle = "팀에 합류하시겠어요?" - static let alertViewControllerCancelButtonText = "취소" // MARK: - LoginViewController @@ -199,8 +176,6 @@ enum TextLiteral { static let myReflectionFeedbackViewControllerFeedbackTypeLabel = "피드백 종류" static let myReflectionFeedbackViewControllerFeedbackFromLabel = "작성자" - static let myReflectionFeedbackViewControllerFeedbackContentLabel = "내용" - static let myReflectionFeedbackViewControllerFeedbackStartLabel = "Start" // MARK: - TabBar diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift index 8e68238d..50309b4e 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/AlertViewController.swift @@ -102,7 +102,7 @@ final class AlertViewController: BaseViewController { }() private lazy var cancelButton: UIButton = { let button = UIButton() - button.setTitle(TextLiteral.alertViewControllerCancelButtonText, for: .normal) + button.setTitle(TextLiteral.actionSheetCancelTitle, for: .normal) button.setTitleColor(.gray500, for: .normal) button.titleLabel?.font = .body2 button.titleLabel?.textAlignment = .center diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView.swift deleted file mode 100644 index e3ee034a..00000000 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// StartSuggestionView.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2022/10/23. -// - -import UIKit - -import SnapKit - -final class StartSuggestionView: UIStackView { - - // MARK: - property - - private let titleLabel: UILabel = { - let label = UILabel() - label.text = TextLiteral.startSuggestionViewStartText - label.textColor = .gray600 - label.font = .label2 - return label - }() - private let startInfoLabel: UILabel = { - let label = UILabel() - label.textColor = .gray600 - label.font = .body2 - label.numberOfLines = 0 - return label - }() - - // MARK: - life cycle - - override init(frame: CGRect) { - super.init(frame: frame) - render() - } - - required init(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - private func render() { - self.addSubview(titleLabel) - titleLabel.snp.makeConstraints { - $0.top.equalToSuperview().inset(22) - $0.leading.equalToSuperview().inset(16) - } - - self.addSubview(startInfoLabel) - startInfoLabel.snp.makeConstraints { - $0.leading.trailing.equalToSuperview().inset(16) - $0.top.equalTo(titleLabel.snp.bottom).offset(12) - $0.bottom.equalToSuperview().inset(22) - } - } - - func setStartInfoLabel(info: String) { - startInfoLabel.text = info - startInfoLabel.setTextWithLineHeight(text: startInfoLabel.text, lineHeight: 22) - } -} diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift index 6881d5b2..771481ec 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedbackEdit/MyFeedbackEditViewController.swift @@ -76,7 +76,7 @@ final class MyFeedbackEditViewController: BaseViewController { private let feedbackContentTextView = CustomTextView() private lazy var feedbackDoneButton: MainButton = { let button = MainButton() - button.title = TextLiteral.addFeedbackViewControllerDoneButtonTitle + button.title = TextLiteral.doneButtonComplete button.isDisabled = true let action = UIAction { [weak self] _ in self?.didTappedDoneButton() @@ -330,7 +330,7 @@ extension MyFeedbackEditViewController: UITextViewDelegate { } func textViewDidBeginEditing(_ textView: UITextView) { - if textView.text == TextLiteral.addFeedbackViewControllerFeedbackContentTextViewPlaceholder || textView.text == TextLiteral.addFeedbackViewControllerStartTextViewPlaceholder { + if textView.text == TextLiteral.addFeedbackViewControllerFeedbackContentTextViewPlaceholder { textView.text = nil textView.textColor = .black100 } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 0ef374fd..3333cdaf 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -106,7 +106,7 @@ final class SetNicknameViewController: BaseViewController { }() private lazy var doneButton: MainButton = { let button = MainButton() - button.title = TextLiteral.setNicknameControllerDoneButtonText + button.title = TextLiteral.doneButtonTitle button.isDisabled = true let action = UIAction { [weak self] _ in self?.didTappedDoneButton() From 1d2dba830f43d7d2ff4c5af951dab409028713e4 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 9 May 2023 21:06:38 +0900 Subject: [PATCH 345/388] =?UTF-8?q?[CHORE]=20dispatchJoinTeam=20DTO?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD(#360)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/SetupEndPoint.swift | 8 +++---- .../SetNicknameViewController.swift | 21 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift index b4c124be..0e516d94 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift @@ -9,7 +9,7 @@ import Alamofire enum SetupEndPoint: EndPointable { case dispatchCreateTeam - case dispatchJoinTeam(teamId: Int) + case dispatchJoinTeam(teamId: Int, T) case fetchCertainTeam(invitationCode: String) case dispatchAppleLogin(T) @@ -17,7 +17,7 @@ enum SetupEndPoint: EndPointable { switch self { case .dispatchCreateTeam: return "\(UrlLiteral.baseUrl2)/teams" - case .dispatchJoinTeam(let teamId): + case .dispatchJoinTeam(let teamId, _): return "\(UrlLiteral.baseUrl2)/users/join-team/\(teamId)" case .fetchCertainTeam(let invitationCode): return "\(UrlLiteral.baseUrl2)/teams?invitation_code=\(invitationCode)" @@ -43,8 +43,8 @@ enum SetupEndPoint: EndPointable { switch self { case .dispatchCreateTeam: return nil - case .dispatchJoinTeam: - return nil + case .dispatchJoinTeam(_, let body): + return body case .fetchCertainTeam: return nil case .dispatchAppleLogin(let body): diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 3333cdaf..7e7ddda8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -321,7 +321,8 @@ final class SetNicknameViewController: BaseViewController { case .createView: dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) case .joinView: - dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId), nickname: nickname, role: role) + let dto = JoinTeamDTO(nickname: nickname, role: role) + dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) case .teamDetail: let dto = JoinTeamDTO(nickname: nickname, role: role) putEditProfile(type: .putEditProfile(dto)) @@ -441,14 +442,14 @@ final class SetNicknameViewController: BaseViewController { } } - private func dispatchJoinTeam(type: SetupEndPoint, nickname: String, role: String?) { + private func dispatchJoinTeam(type: SetupEndPoint) { AF.upload(multipartFormData: { multipartFormData in - let profileInfo: Dictionary = ["nickname": nickname, "role": role] - for (key, value) in profileInfo { - if let value = value { - guard let data = "\(value)".data(using: .utf8) else { return } - multipartFormData.append(data, withName: key, mimeType: "text/plain") - } + guard let nickname = type.body?.nickname, + let nicknameData = nickname.utf8Encode() else { return } + multipartFormData.append(nicknameData, withName: "nickname") + if let role = type.body?.role { + guard let roleData = role.utf8Encode() else { return } + multipartFormData.append(roleData, withName: "role") } if let profileURL = self.profileURL { multipartFormData.append(profileURL, @@ -551,8 +552,8 @@ extension SetNicknameViewController: PHPickerViewControllerDelegate { do { try data.write(to: url) self.profileURL = url - if url != URL(string: self.profilePath ?? "") && self.nicknameTextField.hasText { - DispatchQueue.main.async { + DispatchQueue.main.async { + if url != URL(string: self.profilePath ?? "") && self.nicknameTextField.hasText { self.doneButton.isDisabled = false } } From b6a77668ed56bb1696b83c5eb2503cfc9fb93761 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 9 May 2023 21:41:07 +0900 Subject: [PATCH 346/388] =?UTF-8?q?[CHORE]=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EB=B0=8F=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=A6=AC=ED=84=B0=EB=9F=B4=20=EC=88=98=EC=A0=95=20(#361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/TextLiteral.swift | 16 ++++++------ .../Home/Home/TeamManageViewController.swift | 6 ++--- .../MyReflectionViewController.swift | 25 +------------------ .../MyReflectionDetailViewController.swift | 2 +- .../MyReflectionFeedbackViewController.swift | 2 +- 5 files changed, 14 insertions(+), 37 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index cb0da550..8678578e 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -222,14 +222,14 @@ enum TextLiteral { static let previewTitleLabel: String = "회고 일정을 추가할 수 없습니다" static let previewDescriptionLabel: String = "팀을 생성하거나 팀에 합류해주세요" - // MARK: - MyReflectionViewController - - static let myReflectionViewControllerLogOutTitle: String = "로그아웃" - static let myReflectionViewControllerLogOutMessage: String = "로그아웃 하시겠습니까?" - static let myReflectionViewControllerDeleteUser: String = "회원탈퇴" - static let myReflectionViewControllerDeleteUserAlertTitle: String = "회원탈퇴 하시겠습니까?" - static let myReflectionViewControllerDeleteUserAlertMessage: String = "모든 회고와 피드백 정보가 사라지며, \n되돌릴 수 없습니다." - static let myReflectionViewControllerDeleteUserTitle: String = "탈퇴한 멤버" + // MARK: - TeamManageViewController + + static let TeamManageViewControllerLogOutTitle: String = "로그아웃" + static let TeamManageViewControllerLogOutMessage: String = "로그아웃 하시겠습니까?" + static let TeamManageViewControllerDeleteUser: String = "회원탈퇴" + static let TeamManageViewControllerDeleteUserAlertTitle: String = "회원탈퇴 하시겠습니까?" + static let TeamManageViewControllerDeleteUserAlertMessage: String = "모든 회고와 피드백 정보가 사라지며, \n되돌릴 수 없습니다." + static let TeamManageViewControllerDeleteUserTitle: String = "탈퇴한 멤버" // MARK: - FeedbackTypeButtonView diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index b2d4d7ef..ea88d910 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -157,15 +157,15 @@ final class TeamManageViewController: BaseViewController { } private func withdrawal() { - self.makeRequestAlert(title: TextLiteral.myReflectionViewControllerDeleteUserAlertTitle, - message: TextLiteral.myReflectionViewControllerDeleteUserAlertMessage, + self.makeRequestAlert(title: TextLiteral.TeamManageViewControllerDeleteUserAlertTitle, + message: TextLiteral.TeamManageViewControllerDeleteUserAlertMessage, okAction: { [weak self] _ in self?.deleteUser(type: .deleteUser) }) } private func logoutUser() { - makeRequestAlert(title: TextLiteral.myReflectionViewControllerLogOutMessage, + makeRequestAlert(title: TextLiteral.TeamManageViewControllerLogOutMessage, message: "", okTitle: "확인", cancelTitle: "취소") { _ in diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift index 2387d134..c8dbfd9b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift @@ -27,7 +27,6 @@ final class MyReflectionViewController: BaseViewController { // MARK: - property - private let ellipsisButton = SettingButton(type: .system) private lazy var myReflectionTitleLabel: UILabel = { let label = UILabel() label.setTitleFont(text: user + "님의 회고") @@ -46,16 +45,9 @@ final class MyReflectionViewController: BaseViewController { // MARK: - life cycle - override func setupNavigationBar() { - super.setupNavigationBar() - let rightItemButton = makeBarButtonItem(with: ellipsisButton) - navigationItem.rightBarButtonItem = rightItemButton - } - override func viewDidLoad() { super.viewDidLoad() setUpDelegation() - setUpEllipsisButtonMenu() } override func viewWillAppear(_ animated: Bool) { @@ -85,23 +77,8 @@ final class MyReflectionViewController: BaseViewController { reflectionCollectionView.dataSource = self } - private func setUpEllipsisButtonMenu() { - let menu = UIMenu(options: .displayInline, children: [ - UIAction(title: TextLiteral.myReflectionViewControllerLogOutTitle, handler: { [weak self] _ in - self?.logoutUser() - }), - UIAction(title: TextLiteral.myReflectionViewControllerDeleteUser, attributes: .destructive, handler: { [weak self] _ in - self?.makeRequestAlert(title: TextLiteral.myReflectionViewControllerDeleteUserAlertTitle, message: TextLiteral.myReflectionViewControllerDeleteUserAlertMessage, okAction: { [weak self] _ in - self?.deleteUser(type: .deleteUser) - }) - }) - ]) - ellipsisButton.showsMenuAsPrimaryAction = true - ellipsisButton.menu = menu - } - private func logoutUser() { - makeRequestAlert(title: TextLiteral.myReflectionViewControllerLogOutMessage, message: "", okTitle: "확인", cancelTitle: "취소") { _ in + makeRequestAlert(title: TextLiteral.TeamManageViewControllerLogOutMessage, message: "", okTitle: "확인", cancelTitle: "취소") { _ in guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate else { return } sceneDelegate.logout() diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift index d69b7967..e8805a30 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift @@ -173,7 +173,7 @@ extension MyReflectionDetailViewController: UITableViewDataSource { guard let cell = tableView.dequeueReusableCell(withIdentifier: MyReflectionDetailTableViewCell.className, for: indexPath) as? MyReflectionDetailTableViewCell else { return UITableViewCell() } guard let keyword = contentArray[indexPath.row].keyword, let content = contentArray[indexPath.row].content else { return UITableViewCell() } - let fromLabelText = contentArray[indexPath.row].fromUser?.userName ?? TextLiteral.myReflectionViewControllerDeleteUserTitle + let fromLabelText = contentArray[indexPath.row].fromUser?.userName ?? TextLiteral.TeamManageViewControllerDeleteUserTitle cell.configLabel(title: keyword, fromLabel: fromLabelText, content: content) tableView.isScrollEnabled = true return cell diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift index bb9a43db..c05f9b3e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift @@ -54,7 +54,7 @@ final class MyReflectionFeedbackViewController: BaseViewController { }() private lazy var feedbackFromText: UILabel = { let label = UILabel() - label.text = model.fromUser?.userName ?? TextLiteral.myReflectionViewControllerDeleteUserTitle + label.text = model.fromUser?.userName ?? TextLiteral.TeamManageViewControllerDeleteUserTitle label.textColor = .black100 label.font = .label3 return label From e84c6323d1d79a0c43eac7649d19b0f095b65c8a Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 9 May 2023 21:42:57 +0900 Subject: [PATCH 347/388] =?UTF-8?q?[CHORE]=20=EC=95=88=EC=93=B0=EB=8A=94?= =?UTF-8?q?=20=ED=95=A8=EC=88=98=20=EC=82=AD=EC=A0=9C=20(#361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyReflectionViewController.swift | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift index c8dbfd9b..8596ce51 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift @@ -77,32 +77,8 @@ final class MyReflectionViewController: BaseViewController { reflectionCollectionView.dataSource = self } - private func logoutUser() { - makeRequestAlert(title: TextLiteral.TeamManageViewControllerLogOutMessage, message: "", okTitle: "확인", cancelTitle: "취소") { _ in - guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate - as? SceneDelegate else { return } - sceneDelegate.logout() - } - } - // MARK: - api - - private func deleteUser(type: MyReflectionEndPoint) { - AF.request(type.address, - method: type.method, - headers: type.headers - ) - .responseDecodable(of: BaseModel.self) { json in - if let json = json.value { - dump(json) - UserDefaultHandler.clearAllData() - guard let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate - as? SceneDelegate else { return } - sceneDelegate.logout() - } - } - } - + private func fetchAllReflection(type: MyReflectionEndPoint) { AF.request(type.address, method: type.method, From 9f5972f7551853ac15c42c7bc35723e421b2453c Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 9 May 2023 21:59:14 +0900 Subject: [PATCH 348/388] =?UTF-8?q?[BUGFIX]=20=EC=9E=90=EC=8B=A0=EC=97=90?= =?UTF-8?q?=EA=B2=8C=20=ED=94=BC=EB=93=9C=EB=B0=B1=20=EC=A4=84=20=EC=88=98?= =?UTF-8?q?=20=EC=97=86=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 --- .../AddDetailFeedback/AddFeedbackDetailViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift index 2e1a7a83..55ea6bda 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift @@ -299,7 +299,8 @@ final class AddFeedbackDetailViewController: BaseViewController { method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let data = json.value { - guard let members = data.detail?.members else { return } + guard var members = data.detail?.members else { return } + members.removeFirst() DispatchQueue.main.async { self.selectMemberView.memberCollectionView.memberList = members } From 102f3674d15450f67981abb09d80267493bfa18f Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Tue, 9 May 2023 22:12:28 +0900 Subject: [PATCH 349/388] =?UTF-8?q?[CHORE]=20userId=20=EB=9E=91=20?= =?UTF-8?q?=EB=B9=84=EA=B5=90=ED=95=B4=EC=84=9C=20=EC=A0=9C=EA=B1=B0=20(#3?= =?UTF-8?q?63)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AddFeedbackDetailViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift index 55ea6bda..07dee048 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift @@ -299,10 +299,11 @@ final class AddFeedbackDetailViewController: BaseViewController { method: type.method, headers: type.headers).responseDecodable(of: BaseModel.self) { json in if let data = json.value { - guard var members = data.detail?.members else { return } - members.removeFirst() + guard let members = data.detail?.members else { return } + + let membersExceptMe = members.filter { $0.userId != UserDefaultStorage.userId } DispatchQueue.main.async { - self.selectMemberView.memberCollectionView.memberList = members + self.selectMemberView.memberCollectionView.memberList = membersExceptMe } } } From d9bb7651573096140648b0c4fb658378f859197c Mon Sep 17 00:00:00 2001 From: Guel-git Date: Tue, 9 May 2023 22:15:13 +0900 Subject: [PATCH 350/388] =?UTF-8?q?[ADD]=20CreateTeam=EC=97=90=20DTO=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0(#360)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/SetupEndPoint.swift | 6 ++--- .../Network/Reqeust/DTO/CreateTeamDTO.swift | 1 - .../SetNicknameViewController.swift | 22 ++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift index 0e516d94..c44ea1c6 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/SetupEndPoint.swift @@ -8,7 +8,7 @@ import Alamofire enum SetupEndPoint: EndPointable { - case dispatchCreateTeam + case dispatchCreateTeam(T) case dispatchJoinTeam(teamId: Int, T) case fetchCertainTeam(invitationCode: String) case dispatchAppleLogin(T) @@ -41,8 +41,8 @@ enum SetupEndPoint: EndPointable { var body: T? { switch self { - case .dispatchCreateTeam: - return nil + case .dispatchCreateTeam(let body): + return body case .dispatchJoinTeam(_, let body): return body case .fetchCertainTeam: diff --git a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift index 15255c89..d1c28c9d 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Reqeust/DTO/CreateTeamDTO.swift @@ -11,5 +11,4 @@ struct CreateTeamDTO: Encodable { let team_name: String let nickname: String let role: String? - let profile_image: String? } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 7e7ddda8..e5b45500 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -319,7 +319,8 @@ final class SetNicknameViewController: BaseViewController { switch fromView { case .createView: - dispatchCreateTeam(type: .dispatchCreateTeam, teamName: teamName, nickname: nickname, role: role) + let dto = CreateTeamDTO(team_name: teamName, nickname: nickname, role: role) + dispatchCreateTeam(type: .dispatchCreateTeam(dto)) case .joinView: let dto = JoinTeamDTO(nickname: nickname, role: role) dispatchJoinTeam(type: .dispatchJoinTeam(teamId: UserDefaultStorage.teamId, dto)) @@ -403,16 +404,17 @@ final class SetNicknameViewController: BaseViewController { // MARK: - api - private func dispatchCreateTeam(type: SetupEndPoint, teamName: String, nickname: String, role: String?) { + private func dispatchCreateTeam(type: SetupEndPoint) { AF.upload(multipartFormData: { multipartFormData in - let teamInfo: Dictionary = ["team_name": teamName, - "nickname": nickname, - "role": role] - for (key, value) in teamInfo { - if let value = value { - guard let data = "\(value)".data(using: .utf8) else { return } - multipartFormData.append(data, withName: key, mimeType: "text/plain") - } + guard let teamName = type.body?.team_name, + let teamNameData = teamName.utf8Encode() else { return } + multipartFormData.append(teamNameData, withName: "team_name") + guard let nickname = type.body?.nickname, + let nicknameData = nickname.utf8Encode() else { return } + multipartFormData.append(nicknameData, withName: "nickname") + if let role = type.body?.role { + guard let roleData = role.utf8Encode() else { return } + multipartFormData.append(roleData, withName: "role") } if let profileURL = self.profileURL { multipartFormData.append(profileURL, From 0278b972f827f24c3787ccc8b60c7ddce77cd7f9 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Sat, 13 May 2023 10:48:17 +0900 Subject: [PATCH 351/388] =?UTF-8?q?[FEAT]=20=ED=82=A4=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=EC=9C=84=EB=A1=9C=EC=8A=A4=ED=81=AC=EB=A1=A4=EC=8B=9C=20?= =?UTF-8?q?=EB=82=B4=EB=A6=AC=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(#365)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AddFeedbackContentViewController.swift | 1 + .../UIComponent/StartSuggestionView 2.swift | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView 2.swift diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackContentViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackContentViewController.swift index eccb1cf1..a0ffc6d1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackContentViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddFeedbackContentViewController.swift @@ -110,6 +110,7 @@ final class AddFeedbackContentViewController: BaseViewController { let view = UITextView() view.backgroundColor = .white200 view.font = .body1 + view.keyboardDismissMode = .interactive return view }() private lazy var doneButton: MainButton = { diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView 2.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView 2.swift new file mode 100644 index 00000000..e3ee034a --- /dev/null +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView 2.swift @@ -0,0 +1,61 @@ +// +// StartSuggestionView.swift +// Maddori.Apple +// +// Created by Mingwan Choi on 2022/10/23. +// + +import UIKit + +import SnapKit + +final class StartSuggestionView: UIStackView { + + // MARK: - property + + private let titleLabel: UILabel = { + let label = UILabel() + label.text = TextLiteral.startSuggestionViewStartText + label.textColor = .gray600 + label.font = .label2 + return label + }() + private let startInfoLabel: UILabel = { + let label = UILabel() + label.textColor = .gray600 + label.font = .body2 + label.numberOfLines = 0 + return label + }() + + // MARK: - life cycle + + override init(frame: CGRect) { + super.init(frame: frame) + render() + } + + required init(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func render() { + self.addSubview(titleLabel) + titleLabel.snp.makeConstraints { + $0.top.equalToSuperview().inset(22) + $0.leading.equalToSuperview().inset(16) + } + + self.addSubview(startInfoLabel) + startInfoLabel.snp.makeConstraints { + $0.leading.trailing.equalToSuperview().inset(16) + $0.top.equalTo(titleLabel.snp.bottom).offset(12) + $0.bottom.equalToSuperview().inset(22) + } + } + + func setStartInfoLabel(info: String) { + startInfoLabel.text = info + startInfoLabel.setTextWithLineHeight(text: startInfoLabel.text, lineHeight: 22) + } +} From 879f072316fe41817ffca62ff9d8e2fae4b34fcb Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Sat, 13 May 2023 10:54:41 +0900 Subject: [PATCH 352/388] =?UTF-8?q?[CHORE]=202=20=EB=B3=B5=EC=82=AC?= =?UTF-8?q?=EB=B3=B8=20=EC=82=AD=EC=A0=9C=20(#365)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIComponent/StartSuggestionView 2.swift | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView 2.swift diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView 2.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView 2.swift deleted file mode 100644 index e3ee034a..00000000 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/InProgressDetail/UIComponent/StartSuggestionView 2.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// StartSuggestionView.swift -// Maddori.Apple -// -// Created by Mingwan Choi on 2022/10/23. -// - -import UIKit - -import SnapKit - -final class StartSuggestionView: UIStackView { - - // MARK: - property - - private let titleLabel: UILabel = { - let label = UILabel() - label.text = TextLiteral.startSuggestionViewStartText - label.textColor = .gray600 - label.font = .label2 - return label - }() - private let startInfoLabel: UILabel = { - let label = UILabel() - label.textColor = .gray600 - label.font = .body2 - label.numberOfLines = 0 - return label - }() - - // MARK: - life cycle - - override init(frame: CGRect) { - super.init(frame: frame) - render() - } - - required init(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - private func render() { - self.addSubview(titleLabel) - titleLabel.snp.makeConstraints { - $0.top.equalToSuperview().inset(22) - $0.leading.equalToSuperview().inset(16) - } - - self.addSubview(startInfoLabel) - startInfoLabel.snp.makeConstraints { - $0.leading.trailing.equalToSuperview().inset(16) - $0.top.equalTo(titleLabel.snp.bottom).offset(12) - $0.bottom.equalToSuperview().inset(22) - } - } - - func setStartInfoLabel(info: String) { - startInfoLabel.text = info - startInfoLabel.setTextWithLineHeight(text: startInfoLabel.text, lineHeight: 22) - } -} From 6c48bc3d88931da17c18a6cdfb812fdc77cdd950 Mon Sep 17 00:00:00 2001 From: chemi Date: Sat, 13 May 2023 20:06:11 +0900 Subject: [PATCH 353/388] =?UTF-8?q?[CHORE]=20NavigationBar=20Hidden?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/EditTeamName/EditTeamNameViewController.swift | 5 ----- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 6 ------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index f29f73fc..ec4a1db9 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -69,11 +69,6 @@ final class EditTeamNameViewController: BaseTextFieldViewController { setupDefaultTextFieldText() } - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - navigationController?.setNavigationBarHidden(false, animated: true) - } - override func setupNavigationBar() { super.setupNavigationBar() diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index eec82bfa..4daa97a0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -98,13 +98,13 @@ final class HomeViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - navigationController?.isNavigationBarHidden = true setupDelegation() render() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + navigationController?.isNavigationBarHidden = true setLayoutTeamManageButton() fetchCertainTeamDetail(type: .fetchCertainTeamDetail) fetchCurrentReflectionDetail(type: .fetchCurrentReflectionDetail) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 4710754f..a0c72c2b 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -69,7 +69,6 @@ final class TeamDetailViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - self.navigationController?.isNavigationBarHidden = false setupBackButton() setupEditButton() setupExitButton() @@ -84,11 +83,6 @@ final class TeamDetailViewController: BaseViewController { fetchTeamInformation(type: .fetchTeamInformation) } - override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - navigationController?.setNavigationBarHidden(true, animated: true) - } - override func render() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { From fbb05f82aaf8e2b0627e8dc4f8a1d165016b6493 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Sat, 13 May 2023 21:58:44 +0900 Subject: [PATCH 354/388] =?UTF-8?q?[CHORE]=20=EB=8C=80=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(#361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Global/Literal/TextLiteral.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 8678578e..855998d0 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -224,12 +224,12 @@ enum TextLiteral { // MARK: - TeamManageViewController - static let TeamManageViewControllerLogOutTitle: String = "로그아웃" - static let TeamManageViewControllerLogOutMessage: String = "로그아웃 하시겠습니까?" - static let TeamManageViewControllerDeleteUser: String = "회원탈퇴" - static let TeamManageViewControllerDeleteUserAlertTitle: String = "회원탈퇴 하시겠습니까?" - static let TeamManageViewControllerDeleteUserAlertMessage: String = "모든 회고와 피드백 정보가 사라지며, \n되돌릴 수 없습니다." - static let TeamManageViewControllerDeleteUserTitle: String = "탈퇴한 멤버" + static let teamManageViewControllerLogOutTitle: String = "로그아웃" + static let teamManageViewControllerLogOutMessage: String = "로그아웃 하시겠습니까?" + static let teamManageViewControllerDeleteUser: String = "회원탈퇴" + static let teamManageViewControllerDeleteUserAlertTitle: String = "회원탈퇴 하시겠습니까?" + static let teamManageViewControllerDeleteUserAlertMessage: String = "모든 회고와 피드백 정보가 사라지며, \n되돌릴 수 없습니다." + static let teamManageViewControllerDeleteUserTitle: String = "탈퇴한 멤버" // MARK: - FeedbackTypeButtonView From d75a20ad47fdbd75cd7a39fd160041e31d9dc774 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Sat, 13 May 2023 22:18:00 +0900 Subject: [PATCH 355/388] =?UTF-8?q?[CHORE]=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95(#361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 6 +++--- .../MyReflectionDetailViewController.swift | 2 +- .../MyReflectionFeedbackViewController.swift | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index ea88d910..f2485701 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -157,15 +157,15 @@ final class TeamManageViewController: BaseViewController { } private func withdrawal() { - self.makeRequestAlert(title: TextLiteral.TeamManageViewControllerDeleteUserAlertTitle, - message: TextLiteral.TeamManageViewControllerDeleteUserAlertMessage, + self.makeRequestAlert(title: TextLiteral.teamManageViewControllerDeleteUserAlertTitle, + message: TextLiteral.teamManageViewControllerDeleteUserAlertMessage, okAction: { [weak self] _ in self?.deleteUser(type: .deleteUser) }) } private func logoutUser() { - makeRequestAlert(title: TextLiteral.TeamManageViewControllerLogOutMessage, + makeRequestAlert(title: TextLiteral.teamManageViewControllerLogOutMessage, message: "", okTitle: "확인", cancelTitle: "취소") { _ in diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift index e8805a30..15b3ded3 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift @@ -173,7 +173,7 @@ extension MyReflectionDetailViewController: UITableViewDataSource { guard let cell = tableView.dequeueReusableCell(withIdentifier: MyReflectionDetailTableViewCell.className, for: indexPath) as? MyReflectionDetailTableViewCell else { return UITableViewCell() } guard let keyword = contentArray[indexPath.row].keyword, let content = contentArray[indexPath.row].content else { return UITableViewCell() } - let fromLabelText = contentArray[indexPath.row].fromUser?.userName ?? TextLiteral.TeamManageViewControllerDeleteUserTitle + let fromLabelText = contentArray[indexPath.row].fromUser?.userName ?? TextLiteral.teamManageViewControllerDeleteUserTitle cell.configLabel(title: keyword, fromLabel: fromLabelText, content: content) tableView.isScrollEnabled = true return cell diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift index c05f9b3e..a2cef185 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift @@ -54,7 +54,7 @@ final class MyReflectionFeedbackViewController: BaseViewController { }() private lazy var feedbackFromText: UILabel = { let label = UILabel() - label.text = model.fromUser?.userName ?? TextLiteral.TeamManageViewControllerDeleteUserTitle + label.text = model.fromUser?.userName ?? TextLiteral.teamManageViewControllerDeleteUserTitle label.textColor = .black100 label.font = .label3 return label From ce0e0ababfb28e6d5e1bbb358a89b14931fe4b9e Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 14 May 2023 11:10:36 +0900 Subject: [PATCH 356/388] [CHORE] myfeedbackVC emptyview aligned to center (#369) --- .../View/EmptyView/EmptyFeedbackView.swift | 6 ++---- .../UIComponent/MyFeedbackCollectionView.swift | 12 +++++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/EmptyView/EmptyFeedbackView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/EmptyView/EmptyFeedbackView.swift index 6052b75c..96fa874c 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/EmptyView/EmptyFeedbackView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/View/EmptyView/EmptyFeedbackView.swift @@ -34,8 +34,7 @@ final class EmptyCollectionFeedbackView: BaseCollectionViewCell { override func render() { self.addSubview(emptyFeedbackKeyword) emptyFeedbackKeyword.snp.makeConstraints { - $0.centerX.equalToSuperview() - $0.centerY.equalToSuperview().offset(-Size.capsuleYOffset) + $0.center.equalToSuperview() $0.width.equalTo(Size.capsuleWidth) $0.height.equalTo(Size.capsuleHeight) } @@ -78,8 +77,7 @@ final class EmptyTableFeedbackView: BaseTableViewCell { override func render() { self.addSubview(emptyFeedbackKeyword) emptyFeedbackKeyword.snp.makeConstraints { - $0.centerX.equalToSuperview() - $0.centerY.equalToSuperview().offset(-Size.capsuleYOffset) + $0.center.equalToSuperview() $0.width.equalTo(Size.capsuleWidth) $0.height.equalTo(Size.capsuleHeight) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift index 36b3ea3c..0d217a33 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift @@ -161,6 +161,7 @@ extension MyFeedbackCollectionView: UICollectionViewDelegate { } } } + extension MyFeedbackCollectionView: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { guard let data = feedbackInfo else { return 0 } @@ -230,10 +231,19 @@ extension MyFeedbackCollectionView: UICollectionViewDelegateFlowLayout { return CGSize(width: 80, height: 45) } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + guard let data = feedbackInfo else { return .zero } + if data.continueArray.isEmpty && data.stopArray.isEmpty { + return .zero + } + + return Size.collectionViewInset + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { guard let data = feedbackInfo else { return .zero } if data.continueArray.isEmpty && data.stopArray.isEmpty { - return CGSize(width: 300, height: 300) + return CGSize(width: UIScreen.main.bounds.width, height: 300) } else { var feedbackList: [String] = [] guard let data = feedbackInfo else { return .zero } From 2c775dbac6e73e124723ee05f7b0fc3fa9b1162f Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 14 May 2023 11:18:25 +0900 Subject: [PATCH 357/388] =?UTF-8?q?[CHORE]=20=EC=9E=90=EC=9E=98=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C=20(#369)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyFeedback/UIComponent/MyFeedbackCollectionView.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift index 0d217a33..2ebb05e0 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyFeedback/MyFeedback/UIComponent/MyFeedbackCollectionView.swift @@ -34,7 +34,6 @@ final class MyFeedbackCollectionView: UIView { private let collectionViewFlowLayout: UICollectionViewFlowLayout = { let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical - flowLayout.sectionInset = Size.collectionViewInset flowLayout.minimumLineSpacing = 20 return flowLayout }() @@ -236,7 +235,6 @@ extension MyFeedbackCollectionView: UICollectionViewDelegateFlowLayout { if data.continueArray.isEmpty && data.stopArray.isEmpty { return .zero } - return Size.collectionViewInset } From 6911afebdc8a90608cd5258318bb5558c6d33fc5 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 14 May 2023 12:13:32 +0900 Subject: [PATCH 358/388] [CHORE] added emptyfeedback when inprogress (#369) --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 1 + .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index cb0da550..770a1278 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -76,6 +76,7 @@ enum TextLiteral { static let homeViewControllerEmptyDescriptionLabel = "아직 회고 일정이 정해지지 않았습니다" static let homeViewControllerEmptyCollectionViewList = ["첫 번째", "키워드를", "📝", "작성해보세요", "✚"] + static let homeViewControllerEmptyCollectionViewListWhenProgressing = ["이번", "회고에", "작성된", "키워드가", "없습니다", "🥲"] // MARK: - AddFeedbackViewController diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index eec82bfa..c9579775 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -280,6 +280,10 @@ final class HomeViewController: BaseViewController { keywordList = TextLiteral.homeViewControllerEmptyCollectionViewList } + private func emptyKeywordListWhenProgressing() { + keywordList = TextLiteral.homeViewControllerEmptyCollectionViewListWhenProgressing + } + private func pushTeamDetailViewController() { let viewController = TeamDetailViewController() viewController.hidesBottomBarWhenPushed = true @@ -359,6 +363,7 @@ final class HomeViewController: BaseViewController { case .SettingRequired, .Before, .Done: self.showAddFeedbackButton() case .Progressing: + self.emptyKeywordListWhenProgressing() self.hideAddFeedbackButton() if !UserDefaultStorage.hasSeenReflectionAlert { self.presentStartReflectionView() From 9f8aea7f193c2ba63483adbaabe4826f32bab392 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Sun, 14 May 2023 12:48:55 +0900 Subject: [PATCH 359/388] [CHORE] no team chevron spacing added (#373) --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index eec82bfa..5be10612 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -319,7 +319,7 @@ final class HomeViewController: BaseViewController { } } else { DispatchQueue.main.async { - self.teamButton.setTitle("팀 없음", for: .normal) + self.teamButton.setTitle("팀 없음 ", for: .normal) self.teamButton.tintColor = .gray500 } } From 60bb90f3e4168bf6e020d49c32d75707d3a58d5d Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 14 May 2023 17:36:55 +0900 Subject: [PATCH 360/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Network/Response/MemberResponse.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift index 6e5a9a93..a646bf80 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/MemberResponse.swift @@ -1,5 +1,5 @@ // -// LoginResponse.swift +// MemberResponse.swift // Maddori.Apple // // Created by Mingwan Choi on 2022/11/15. From f7acc4b752e5af0e3d638edfd69575381de0c46f Mon Sep 17 00:00:00 2001 From: Guel-git Date: Sun, 14 May 2023 18:10:45 +0900 Subject: [PATCH 361/388] =?UTF-8?q?[CHORE]=20CreateTeam=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=84=ED=95=B4=20teamId=20nil=20=EC=A7=80=EC=A0=95(#358)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/CreateTeam/CreateTeamViewController.swift | 2 +- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift index 95377448..1424dd22 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/CreateTeam/CreateTeamViewController.swift @@ -107,7 +107,7 @@ final class CreateTeamViewController: BaseTextFieldViewController { // MARK: - func private func pushSetNicknameViewController(teamName: String) { - let viewController = SetNicknameViewController(from: .createView, teamId: nil, teamName: teamName) + let viewController = SetNicknameViewController(from: .createView, teamName: teamName) navigationController?.pushViewController(viewController, animated: true) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 427718ed..295e1677 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -119,7 +119,7 @@ final class SetNicknameViewController: BaseViewController { // MARK: - life cycle - init(from: ViewType, teamId: Int?, teamName: String) { + init(from: ViewType, teamId: Int? = nil, teamName: String) { self.fromView = from self.teamId = teamId self.teamName = teamName From ff60ffde7a22c73da982a50fbf403ce40ee74611 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 10:38:06 +0900 Subject: [PATCH 362/388] =?UTF-8?q?[BUGFIX]=20=EB=8B=89=EB=84=A4=EC=9E=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=EB=90=98=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/Response/TeamInfoResponse.swift | 2 ++ .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 1 + .../Home/TeamDetail/TeamDetailViewController.swift | 5 ++++- .../MyReflection/MyReflectionViewController.swift | 9 ++++++++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift index 881b7dae..6bfb0f6b 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift @@ -12,10 +12,12 @@ struct TeamInfoResponse: Decodable { let id: Int? let teamName: String? let invitationCode: String? + let nickname: String? enum CodingKeys: String, CodingKey { case id case teamName = "team_name" case invitationCode = "invitation_code" + case nickname = "nickname" } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 16f5df72..ae56c1f5 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -114,5 +114,6 @@ extension ChangeTeamView: UICollectionViewDataSource { extension ChangeTeamView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { self.delegate?.changeTeam(teamId: self.teamList[indexPath.item].id!) + UserDefaultHandler.setNickname(nickname: self.teamList[indexPath.item].nickname!) } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 4710754f..8171fce6 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -281,8 +281,11 @@ final class TeamDetailViewController: BaseViewController { if let data = json.value { guard let teams = data.detail else { return } if !teams.isEmpty { - guard let teamId = teams.first?.id else { return } + guard let teamId = teams.first?.id, + let nickname = teams.first?.nickname + else { return } UserDefaultHandler.setTeamId(teamId: teamId) + UserDefaultHandler.setNickname(nickname: nickname) } else { UserDefaultHandler.setTeamId(teamId: 0) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift index 2387d134..9a2eda56 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflection/MyReflectionViewController.swift @@ -12,7 +12,7 @@ import SnapKit final class MyReflectionViewController: BaseViewController { - private let user = UserDefaultStorage.nickname + private var user = UserDefaultStorage.nickname private var allReflection: AllReflectionResponse? private var totalReflection: [ReflectionResponse] = [] { didSet { @@ -61,6 +61,7 @@ final class MyReflectionViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) fetchAllReflection(type: .fetchPastReflectionList(teamId: UserDefaultStorage.teamId)) + setupNickname() } override func render() { @@ -108,6 +109,12 @@ final class MyReflectionViewController: BaseViewController { } } + private func setupNickname() { + user = UserDefaultStorage.nickname + myReflectionTitleLabel.setTitleFont(text: user + "님의 회고") + myReflectionTitleLabel.applyColor(to: user, with: .blue200) + } + // MARK: - api private func deleteUser(type: MyReflectionEndPoint) { From 8d0e847cae5744cf29fae9880a515615076ae215 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 11:25:55 +0900 Subject: [PATCH 363/388] =?UTF-8?q?[CHORE]=20=ED=8F=B4=EB=8D=94=20?= =?UTF-8?q?=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple.xcodeproj/project.pbxproj | 40 +++++++++++++++---- .../Cell}/TeamManageSettingCell.swift | 0 .../{Home => TeamManage}/Model/Option.swift | 0 .../{Home => TeamManage}/Model/Section.swift | 0 .../TeamManageViewController.swift | 0 .../UIComponent/ChangeTeamView.swift | 0 .../UIComponent/EmptyTeamView.swift | 0 .../TeamChangeCollectionViewCell.swift | 0 8 files changed, 32 insertions(+), 8 deletions(-) rename Maddori.Apple/Maddori.Apple/Screen/Home/{Home => TeamManage/Cell}/TeamManageSettingCell.swift (100%) rename Maddori.Apple/Maddori.Apple/Screen/Home/{Home => TeamManage}/Model/Option.swift (100%) rename Maddori.Apple/Maddori.Apple/Screen/Home/{Home => TeamManage}/Model/Section.swift (100%) rename Maddori.Apple/Maddori.Apple/Screen/Home/{Home => TeamManage}/TeamManageViewController.swift (100%) rename Maddori.Apple/Maddori.Apple/Screen/Home/{Home => TeamManage}/UIComponent/ChangeTeamView.swift (100%) rename Maddori.Apple/Maddori.Apple/Screen/Home/{Home => TeamManage}/UIComponent/EmptyTeamView.swift (100%) rename Maddori.Apple/Maddori.Apple/Screen/Home/{Home => TeamManage}/UIComponent/TeamChangeCollectionViewCell.swift (100%) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index ae405df0..9f76e47c 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -8,11 +8,11 @@ /* Begin PBXBuildFile section */ 391596622904176500A432D9 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391596612904176500A432D9 /* UIView+Extension.swift */; }; - 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391612CD29E51F1B004AE982 /* EditTeamNameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */; }; 391612CF29E5352A004AE982 /* EditTeamNameEndPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */; }; 391612D129E5364A004AE982 /* EditTeamNameDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */; }; 391612D329E53745004AE982 /* EditTeamNameResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D229E53745004AE982 /* EditTeamNameResponse.swift */; }; + 391612D529E551BD004AE982 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391612D429E551BD004AE982 /* ToastView.swift */; }; 391CBA19290580460044CA30 /* InProgressDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */; }; 391CBA1C290582130044CA30 /* ReflectionInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */; }; 391D217C29050427003FC871 /* CustomVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391D217B29050427003FC871 /* CustomVisualEffectView.swift */; }; @@ -172,11 +172,11 @@ /* Begin PBXFileReference section */ 391596612904176500A432D9 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; - 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391612CC29E51F1B004AE982 /* EditTeamNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameViewController.swift; sourceTree = ""; }; 391612CE29E5352A004AE982 /* EditTeamNameEndPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameEndPoint.swift; sourceTree = ""; }; 391612D029E5364A004AE982 /* EditTeamNameDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameDTO.swift; sourceTree = ""; }; 391612D229E53745004AE982 /* EditTeamNameResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditTeamNameResponse.swift; sourceTree = ""; }; + 391612D429E551BD004AE982 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 391CBA18290580460044CA30 /* InProgressDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InProgressDetailViewController.swift; sourceTree = ""; }; 391CBA1B290582130044CA30 /* ReflectionInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReflectionInfoModel.swift; sourceTree = ""; }; 391D217B29050427003FC871 /* CustomVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVisualEffectView.swift; sourceTree = ""; }; @@ -595,6 +595,7 @@ 3977E11F2910CECB000E9761 /* Home */ = { isa = PBXGroup; children = ( + D7E5B7702A11CF4700DDAEB3 /* TeamManage */, 391612CB29E51F03004AE982 /* EditTeamName */, 3E557FC128FE7B9200714E46 /* Home */, 395C7E1928FEC3FB00FC2FCA /* CreateReflection */, @@ -805,9 +806,6 @@ isa = PBXGroup; children = ( 3E5195AA292B05BC00710A01 /* JoinReflectionButton.swift */, - D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */, - D7195FBB299223F6002526E7 /* TeamChangeCollectionViewCell.swift */, - D75D0D2129B2003F0013ADA5 /* EmptyTeamView.swift */, ); path = UIComponent; sourceTree = ""; @@ -815,11 +813,8 @@ 3E557FC128FE7B9200714E46 /* Home */ = { isa = PBXGroup; children = ( - D7A585252990DAE500E1F4EE /* Model */, 3E5195A9292B05B000710A01 /* UIComponent */, 3E557FC228FE7BBC00714E46 /* HomeViewController.swift */, - D7022789297F99500027EF64 /* TeamManageViewController.swift */, - D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */, ); path = Home; sourceTree = ""; @@ -1116,6 +1111,35 @@ path = MyReflectionDetail; sourceTree = ""; }; + D7E5B7702A11CF4700DDAEB3 /* TeamManage */ = { + isa = PBXGroup; + children = ( + D7022789297F99500027EF64 /* TeamManageViewController.swift */, + D7E5B7722A11CF8000DDAEB3 /* Cell */, + D7E5B7712A11CF5E00DDAEB3 /* UIComponent */, + D7A585252990DAE500E1F4EE /* Model */, + ); + path = TeamManage; + sourceTree = ""; + }; + D7E5B7712A11CF5E00DDAEB3 /* UIComponent */ = { + isa = PBXGroup; + children = ( + D7A5852A2990DCE700E1F4EE /* ChangeTeamView.swift */, + D7195FBB299223F6002526E7 /* TeamChangeCollectionViewCell.swift */, + D75D0D2129B2003F0013ADA5 /* EmptyTeamView.swift */, + ); + path = UIComponent; + sourceTree = ""; + }; + D7E5B7722A11CF8000DDAEB3 /* Cell */ = { + isa = PBXGroup; + children = ( + D7A585212990C50700E1F4EE /* TeamManageSettingCell.swift */, + ); + path = Cell; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/Cell/TeamManageSettingCell.swift similarity index 100% rename from Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageSettingCell.swift rename to Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/Cell/TeamManageSettingCell.swift diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Option.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/Model/Option.swift similarity index 100% rename from Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Option.swift rename to Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/Model/Option.swift diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/Model/Section.swift similarity index 100% rename from Maddori.Apple/Maddori.Apple/Screen/Home/Home/Model/Section.swift rename to Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/Model/Section.swift diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/TeamManageViewController.swift similarity index 100% rename from Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift rename to Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/TeamManageViewController.swift diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/UIComponent/ChangeTeamView.swift similarity index 100% rename from Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift rename to Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/UIComponent/ChangeTeamView.swift diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/EmptyTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/UIComponent/EmptyTeamView.swift similarity index 100% rename from Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/EmptyTeamView.swift rename to Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/UIComponent/EmptyTeamView.swift diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/UIComponent/TeamChangeCollectionViewCell.swift similarity index 100% rename from Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/TeamChangeCollectionViewCell.swift rename to Maddori.Apple/Maddori.Apple/Screen/Home/TeamManage/UIComponent/TeamChangeCollectionViewCell.swift From f845aca08b118901aa5180d13c966837cad0e803 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Mon, 15 May 2023 12:28:16 +0900 Subject: [PATCH 364/388] [CHORE] subtitle text changed (#356) --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index a6dae9d4..618934c3 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -139,7 +139,7 @@ enum TextLiteral { // MARK: - SelectReflectionMemberViewController static let selectReflectionMemberViewControllerTitleLabel = "각 팀원이 받은 피드백을\n공유해 보세요" - static let selectReflectionMemberViewControllerSubtitleLabel = "모든 팀원 버튼을 누르면 회고를 종료할 수 있습니다" + static let selectReflectionMemberViewControllerSubtitleLabel = "모든 팀원을 누르면 회고를 종료할 수 있습니다" static let selectReflectionMemberViewControllerDoneButtonText = "모든 회고 끝내기 " // MARK: - InProgressViewController From a4bfbc2dcb3492715a0f33b91215992963182090 Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 15 May 2023 13:15:59 +0900 Subject: [PATCH 365/388] =?UTF-8?q?[ADD]=20=EB=A8=B8=EC=A7=80=20=EC=BB=A8?= =?UTF-8?q?=ED=94=8C=EB=A6=AD=ED=8A=B8=20=ED=95=B4=EA=B2=B0(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AddDetailFeedback/AddFeedbackDetailViewController.swift | 2 +- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 2 +- .../MyReflectionDetail/MyReflectionDetailViewController.swift | 2 +- .../MyReflectionFeedbackViewController.swift | 2 +- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift index 9c7e0eea..b54af953 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/AddFeedbackDetailViewController.swift @@ -301,7 +301,7 @@ final class AddFeedbackDetailViewController: BaseViewController { if let data = json.value { guard let members = data.detail?.members else { return } - let membersExceptMe = members.filter { $0.userId != UserDefaultStorage.userId } + let membersExceptMe = members.filter { $0.id != UserDefaultStorage.userId } DispatchQueue.main.async { self.selectMemberView.memberCollectionView.memberList = membersExceptMe } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index ab5fd066..403a33fc 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -220,7 +220,7 @@ final class TeamDetailViewController: BaseViewController { private func setupMyProfileButton() { memberTableView.didTappedMyProfile = { [weak self] nickname, role, profilePath in - let viewController = SetNicknameViewController(from: .teamDetail) + let viewController = SetNicknameViewController(from: .teamDetail, teamId: UserDefaultStorage.teamId, teamName: UserDefaultStorage.teamName) viewController.nickname = nickname viewController.role = role viewController.profilePath = profilePath diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift index 1c322750..2dfebd28 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionDetail/MyReflectionDetailViewController.swift @@ -173,7 +173,7 @@ extension MyReflectionDetailViewController: UITableViewDataSource { guard let cell = tableView.dequeueReusableCell(withIdentifier: MyReflectionDetailTableViewCell.className, for: indexPath) as? MyReflectionDetailTableViewCell else { return UITableViewCell() } guard let keyword = contentArray[indexPath.row].keyword, let content = contentArray[indexPath.row].content else { return UITableViewCell() } - let fromLabelText = contentArray[indexPath.row].fromUser?.nickname ?? TextLiteral.myReflectionViewControllerDeleteUserTitle + let fromLabelText = contentArray[indexPath.row].fromUser?.nickname ?? TextLiteral.teamManageViewControllerDeleteUserTitle cell.configLabel(title: keyword, fromLabel: fromLabelText, content: content) tableView.isScrollEnabled = true return cell diff --git a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift index e00a509d..f5cca226 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/MyReflection/MyReflectionFeedback/MyReflectionFeedbackViewController.swift @@ -54,7 +54,7 @@ final class MyReflectionFeedbackViewController: BaseViewController { }() private lazy var feedbackFromText: UILabel = { let label = UILabel() - label.text = model.fromUser?.nickname ?? TextLiteral.myReflectionViewControllerDeleteUserTitle + label.text = model.fromUser?.nickname ?? TextLiteral.teamManageViewControllerDeleteUserTitle label.textColor = .black100 label.font = .label3 return label diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index f2b9c4d4..44f56ac1 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -24,7 +24,6 @@ final class SetNicknameViewController: BaseViewController { static let roleMax: Int = 20 } private let cameraPicker = UIImagePickerController() - private let teamName: String = UserDefaultStorage.teamName var nickname: String? var role: String? var profilePath: String? From a321a2da01f30c8044770ffc36351c9c9dc6463d Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 14:19:33 +0900 Subject: [PATCH 366/388] =?UTF-8?q?[FEAT]=20emptyView=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20(#379)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberCollectionView.swift | 15 ++++++++++++++- .../UIComponent/SelectMemberView.swift | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift index 22a8aa6f..b8f4b79a 100644 --- a/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift +++ b/Maddori.Apple/Maddori.Apple/Global/UIComponent/CollectionView/MemberCollectionView/MemberCollectionView.swift @@ -26,7 +26,12 @@ final class MemberCollectionView: UIView { var memberList: [MemberDetailResponse] = [] { didSet { - collectionView.reloadData() + if memberList.isEmpty { + setupEmptyView() + } + else { + collectionView.reloadData() + } } } var didTappedFeedBackMember: ((MemberDetailResponse) -> ())? @@ -51,6 +56,7 @@ final class MemberCollectionView: UIView { collectionView.register(MemberCollectionViewCell.self, forCellWithReuseIdentifier: MemberCollectionViewCell.className) return collectionView }() + lazy var emptyView = EmptyPersonView() // MARK: - life cycle @@ -67,6 +73,13 @@ final class MemberCollectionView: UIView { $0.edges.equalToSuperview() } } + + private func setupEmptyView() { + self.addSubview(self.emptyView) + self.emptyView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } } // MARK: - extension diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift index 51213dde..d80dd3c5 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/AddFeedback/AddDetailFeedback/UIComponent/SelectMemberView.swift @@ -25,6 +25,7 @@ final class SelectMemberView: UIStackView { self.layoutIfNeeded() } self.memberCollectionView.isHidden = false + self.memberCollectionView.emptyView.isHidden = false } else { self.memberCollectionView.snp.updateConstraints { @@ -34,6 +35,7 @@ final class SelectMemberView: UIStackView { self.layoutIfNeeded() } self.memberCollectionView.isHidden = false + self.memberCollectionView.emptyView.isHidden = true } } } From f7d68cb12290d462da8df217d8f9b655eb319f38 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 14:27:23 +0900 Subject: [PATCH 367/388] =?UTF-8?q?[CHORE]=20TextLiteral=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#379)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 855998d0..120d2282 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -170,7 +170,7 @@ enum TextLiteral { // MARK: - MyFeedbackViewController static let myFeedbackViewControllerTitleLabel = "내가 작성한 피드백" - static let myFeedbackViewControllerEmptyViewLabel = "아직 팀에 합류한 팀원이 없습니다\n초대코드를 공유하여 팀원을 초대해주세요" + static let myFeedbackViewControllerEmptyViewLabel = "팀에 합류한 팀원이 없습니다\n초대코드를 공유해주세요" // MARK: - MyFeedbackDetailViewController From 197bd88c47293049b5469136fb7f75bc48e68723 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 15:03:29 +0900 Subject: [PATCH 368/388] =?UTF-8?q?[FEAT]=20=EB=8B=89=EB=84=A4=EC=9E=84=20?= =?UTF-8?q?=EC=97=86=EC=9D=84=20=EB=95=8C=20=EC=95=8C=EC=88=98=20=EC=97=86?= =?UTF-8?q?=EC=9D=8C=20=EC=B2=98=EB=A6=AC=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 8171fce6..57e190be 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -288,6 +288,7 @@ final class TeamDetailViewController: BaseViewController { UserDefaultHandler.setNickname(nickname: nickname) } else { UserDefaultHandler.setTeamId(teamId: 0) + UserDefaultHandler.setNickname(nickname: "(알 수 없음)") } completion() } From 1311ee47bb4d8b86bdf279060f697b55c84f5031 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 15:17:29 +0900 Subject: [PATCH 369/388] =?UTF-8?q?[BUGFIX]=20=EC=97=A0=ED=8B=B0=20?= =?UTF-8?q?=EB=B7=B0=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20=EA=B9=A8?= =?UTF-8?q?=EC=A7=80=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?(#381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 11 +++++++++-- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index db25ffe1..d1a6f9d7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -22,8 +22,15 @@ final class TeamManageViewController: BaseViewController { private var sections: [Section] = [] private lazy var teamCount = 0 { didSet { - self.changeTeamView.snp.updateConstraints { - $0.height.equalTo((self.teamCount * Size.teamSectionHeight) + ((self.teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding + Size.teamTitleLabelHeight) + if teamCount == 0 { + self.changeTeamView.snp.updateConstraints { + $0.height.equalTo(150 + Size.teamTitleLabelHeight) + } + } + else { + self.changeTeamView.snp.updateConstraints { + $0.height.equalTo((self.teamCount * Size.teamSectionHeight) + ((self.teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding + Size.teamTitleLabelHeight) + } } } } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 02625792..224792c8 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -88,7 +88,7 @@ final class ChangeTeamView: UIView { emptyView.snp.makeConstraints { $0.top.equalTo(titleLabel.snp.bottom).offset(28) $0.directionalHorizontalEdges.equalToSuperview() - $0.height.equalToSuperview() + $0.height.equalTo(150) } } } From 497b99b0d29eb7188b35841fc86ac1041d01e90d Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 15:18:46 +0900 Subject: [PATCH 370/388] =?UTF-8?q?[CHORE]=20=EB=86=92=EC=9D=B4=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(#381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index d1a6f9d7..2832825a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -17,6 +17,7 @@ final class TeamManageViewController: BaseViewController { static let teamSectionSpacing = 8 static let teamSectionPadding = 28 static let teamTitleLabelHeight = 50 + static let emptyViewHeught = 150 } private var sections: [Section] = [] @@ -24,7 +25,7 @@ final class TeamManageViewController: BaseViewController { didSet { if teamCount == 0 { self.changeTeamView.snp.updateConstraints { - $0.height.equalTo(150 + Size.teamTitleLabelHeight) + $0.height.equalTo(Size.emptyViewHeught + Size.teamTitleLabelHeight) } } else { From aae06916cc0a50acda09af55226d8ad29aa63ebe Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 15:24:52 +0900 Subject: [PATCH 371/388] =?UTF-8?q?[CHORE]=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/TeamManageViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift index 2832825a..c1b13517 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/TeamManageViewController.swift @@ -16,8 +16,8 @@ final class TeamManageViewController: BaseViewController { static let teamSectionHeight = 59 static let teamSectionSpacing = 8 static let teamSectionPadding = 28 - static let teamTitleLabelHeight = 50 - static let emptyViewHeught = 150 + static let teamTitleLableHeight = 50 + static let emptyViewHeight = 150 } private var sections: [Section] = [] @@ -25,12 +25,12 @@ final class TeamManageViewController: BaseViewController { didSet { if teamCount == 0 { self.changeTeamView.snp.updateConstraints { - $0.height.equalTo(Size.emptyViewHeught + Size.teamTitleLabelHeight) + $0.height.equalTo(Size.emptyViewHeight + Size.teamTitleLableHeight) } } else { self.changeTeamView.snp.updateConstraints { - $0.height.equalTo((self.teamCount * Size.teamSectionHeight) + ((self.teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding + Size.teamTitleLabelHeight) + $0.height.equalTo((self.teamCount * Size.teamSectionHeight) + ((self.teamCount - 1) * Size.teamSectionSpacing) + Size.teamSectionPadding + Size.teamTitleLableHeight) } } } From e60f00dee1fe35e4f7ccc048b31ab9ad8897933e Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 15 May 2023 16:12:23 +0900 Subject: [PATCH 372/388] =?UTF-8?q?[CHORE]=20editProfile=20endpoint=20?= =?UTF-8?q?=EC=88=98=EC=A0=95(#378)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Network/EndPoint/TeamDetailEndPoint.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift index 02bdc489..5ca6d941 100644 --- a/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift +++ b/Maddori.Apple/Maddori.Apple/Network/EndPoint/TeamDetailEndPoint.swift @@ -12,7 +12,7 @@ enum TeamDetailEndPoint: EndPointable { case fetchTeamInformation case deleteTeam case fetchUserTeamList - case putEditProfile(T) + case patchEditProfile(T) var address: String { switch self { @@ -28,7 +28,7 @@ enum TeamDetailEndPoint: EndPointable { case .fetchUserTeamList: return "\(UrlLiteral.baseUrl2)/users/teams" - case .putEditProfile: + case .patchEditProfile: return "\(UrlLiteral.baseUrl2)/users/teams/\(UserDefaultStorage.teamId)/profile" } } @@ -47,8 +47,8 @@ enum TeamDetailEndPoint: EndPointable { case .fetchUserTeamList: return .get - case .putEditProfile: - return .put + case .patchEditProfile: + return .patch } } @@ -66,7 +66,7 @@ enum TeamDetailEndPoint: EndPointable { case .fetchUserTeamList: return nil - case .putEditProfile(let body): + case .patchEditProfile(let body): return body } } @@ -101,7 +101,7 @@ enum TeamDetailEndPoint: EndPointable { ] return HTTPHeaders(headers) - case .putEditProfile: + case .patchEditProfile: let headers = [ "access_token": "\(UserDefaultStorage.accessToken)", "refresh_token": "\(UserDefaultStorage.refreshToken)", From 048d027a9206cca1f0d4fd146804a494cc1b0a96 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 16:31:31 +0900 Subject: [PATCH 373/388] =?UTF-8?q?[CHORE]=20=EC=BB=A8=ED=94=8C=EB=A6=AD?= =?UTF-8?q?=ED=8A=B8=20=ED=95=B4=EA=B2=B0=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Network/Response/TeamNameResponse.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift index a638b748..84f8deb2 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamNameResponse.swift @@ -9,11 +9,13 @@ import Foundation struct TeamNameResponse: Decodable { // MARK: - getCertainTeamName, editTeamName, getUserTeamList - let id: Int + let id: Int? let teamName: String + let nickname: String? enum CodingKeys: String, CodingKey { case id case teamName = "team_name" + case nickname } } From e21b8cc09396607891e2087861ddd47fd5d36a03 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 16:46:18 +0900 Subject: [PATCH 374/388] =?UTF-8?q?[CHORE]=20=EC=B6=A9=EB=8F=8C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Network/Response/TeamInfoResponse.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift index 27a9a3b7..2a9071c8 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift @@ -12,12 +12,10 @@ struct TeamInfoResponse: Decodable { let id: Int? let teamName: String? let invitationCode: String? - let nickname: String? enum CodingKeys: String, CodingKey { case id case teamName = "team_name" case invitationCode = "invitation_code" - case nickname = "nickname" } } From 54680af52c8a74388a84aab3ffdece973b909228 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 16:46:57 +0900 Subject: [PATCH 375/388] =?UTF-8?q?[CHORE]=20=EC=98=B5=EC=85=94=EB=84=90?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Network/Response/TeamInfoResponse.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift index 2a9071c8..6f9c4273 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift @@ -9,7 +9,7 @@ import Foundation struct TeamInfoResponse: Decodable { // MARK: - getCertainTeamDetail - let id: Int? + let id: Int let teamName: String? let invitationCode: String? From cc60c757900dc653257f6afbb8a022585e22f35d Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 16:47:33 +0900 Subject: [PATCH 376/388] =?UTF-8?q?[CHORE]=20=EC=98=B5=EC=85=94=EB=84=90?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Network/Response/TeamInfoResponse.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift index 6f9c4273..2a9071c8 100644 --- a/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift +++ b/Maddori.Apple/Maddori.Apple/Network/Response/TeamInfoResponse.swift @@ -9,7 +9,7 @@ import Foundation struct TeamInfoResponse: Decodable { // MARK: - getCertainTeamDetail - let id: Int + let id: Int? let teamName: String? let invitationCode: String? From a6ab46e6ce38adb5f63f2a63323437b87e7820e0 Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 16:53:35 +0900 Subject: [PATCH 377/388] =?UTF-8?q?[CHORE]=20=EC=98=B5=EC=84=9C=EB=85=88?= =?UTF-8?q?=20=EB=B0=94=EC=9D=B8=EB=94=A9=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/Home/UIComponent/ChangeTeamView.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift index 3a33867d..0e5341e7 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/UIComponent/ChangeTeamView.swift @@ -113,7 +113,10 @@ extension ChangeTeamView: UICollectionViewDataSource { extension ChangeTeamView: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - self.delegate?.changeTeam(teamId: self.teamList[indexPath.item].id!) - UserDefaultHandler.setNickname(nickname: self.teamList[indexPath.item].nickname!) + guard let teamId = self.teamList[indexPath.item].id, + let nickname = self.teamList[indexPath.item].nickname + else { return } + self.delegate?.changeTeam(teamId: teamId) + UserDefaultHandler.setNickname(nickname: nickname) } } From a554414b54654bdc1a390f925482f8d149ee68cf Mon Sep 17 00:00:00 2001 From: Guel-git Date: Mon, 15 May 2023 17:34:58 +0900 Subject: [PATCH 378/388] =?UTF-8?q?[CHORE]=20put=20=EC=9D=84=20patch?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD(#378)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Setup/SetNickname/SetNicknameViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift index 44f56ac1..4bdd9f1c 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Setup/SetNickname/SetNicknameViewController.swift @@ -329,7 +329,7 @@ final class SetNicknameViewController: BaseViewController { } case .teamDetail: let dto = JoinTeamDTO(nickname: nickname, role: role) - putEditProfile(type: .putEditProfile(dto)) + patchEditProfile(type: .patchEditProfile(dto)) } nicknameTextField.resignFirstResponder() @@ -483,7 +483,7 @@ final class SetNicknameViewController: BaseViewController { } } - private func putEditProfile(type: TeamDetailEndPoint) { + private func patchEditProfile(type: TeamDetailEndPoint) { AF.upload(multipartFormData: { multipartFormData in guard let nickname = type.body?.nickname, let nicknameData = nickname.utf8Encode() else { return } From baec329b6987ea7195cd3dcabe0579d28b80795e Mon Sep 17 00:00:00 2001 From: LEE SUNG HO <59243274+dangsal@users.noreply.github.com> Date: Mon, 15 May 2023 21:37:43 +0900 Subject: [PATCH 379/388] =?UTF-8?q?[BUGFIX]=20=EC=85=80=20=EC=9E=AC?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?(#384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeamDetail/Cell/TeamDetailMemberTableViewCell.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift index 8a2e0718..39c5ea3a 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/Cell/TeamDetailMemberTableViewCell.swift @@ -22,6 +22,14 @@ final class TeamDetailMemberTableViewCell: BaseTableViewCell { } } + override func prepareForReuse() { + super.prepareForReuse() + + memberInfoView.profileImageView.image = ImageLiterals.imgProfileNone + memberInfoView.profileNicknameLabel.text = nil + memberInfoView.profileRoleLabel.text = nil + } + // MARK: - func func setupLayoutInfoView(nickname: String, role: String, imagePath: String?) { From 67246c20bf5ed78c50dc8e30002319e59946a6a4 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Mon, 15 May 2023 23:18:56 +0900 Subject: [PATCH 380/388] [CHORE] ux writing edited --- Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift index 770a1278..78effe66 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/TextLiteral.swift @@ -76,7 +76,7 @@ enum TextLiteral { static let homeViewControllerEmptyDescriptionLabel = "아직 회고 일정이 정해지지 않았습니다" static let homeViewControllerEmptyCollectionViewList = ["첫 번째", "키워드를", "📝", "작성해보세요", "✚"] - static let homeViewControllerEmptyCollectionViewListWhenProgressing = ["이번", "회고에", "작성된", "키워드가", "없습니다", "🥲"] + static let homeViewControllerEmptyCollectionViewListWhenProgressing = ["이번", "회고에는", "작성된", "피드백이", "없습니다", "🥲"] // MARK: - AddFeedbackViewController From 08c620075255d9cb5da5dc352b1bb7134016824b Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 17 May 2023 07:50:44 +0900 Subject: [PATCH 381/388] [CHORE] sizeliteral value changed (#356) --- .../Maddori.Apple/Global/Literal/SizeLiteral.swift | 2 +- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift b/Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift index e1883c65..d434e72f 100644 --- a/Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift +++ b/Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift @@ -21,5 +21,5 @@ enum SizeLiteral { static let labelComponentPadding: CGFloat = 10 static let componentIntervalPadding: CGFloat = 36 static let componentCornerRadius: CGFloat = 10 - static let titleSubtitleSpacing: CGFloat = 5 + static let titleSubtitleSpacing: CGFloat = 10 } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index eec82bfa..93b066eb 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -151,7 +151,7 @@ final class HomeViewController: BaseViewController { view.addSubview(keywordCollectionView) keywordCollectionView.snp.makeConstraints { - $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) + $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(5) $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) $0.bottom.equalTo(addFeedbackButton.snp.top).offset(-10) } @@ -252,7 +252,7 @@ final class HomeViewController: BaseViewController { private func showAddFeedbackButton() { addFeedbackButton.isHidden = false keywordCollectionView.snp.remakeConstraints { - $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) + $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(5) $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) $0.bottom.equalTo(addFeedbackButton.snp.top).offset(-10) } @@ -261,7 +261,7 @@ final class HomeViewController: BaseViewController { private func hideAddFeedbackButton() { addFeedbackButton.isHidden = true keywordCollectionView.snp.remakeConstraints { - $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(SizeLiteral.titleSubtitleSpacing) + $0.top.equalTo(currentReflectionLabel.snp.bottom).offset(5) $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).inset(SizeLiteral.bottomTabBarPadding) } From 459161fe18ea18f26e4cc68e479ea8333227815d Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 17 May 2023 12:09:48 +0900 Subject: [PATCH 382/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#354)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIComponent/TeamDetailMembersView.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift index 9cd19a3c..d40c1e72 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/UIComponent/TeamDetailMembersView.swift @@ -63,14 +63,16 @@ final class TeamDetailMembersView: UIView { memberTableView.dataSource = self } - private func determineEmptyTeam() { - if members.isEmpty { - memberTableView.backgroundView = EmptyPersonView() - } + private func setupEmptyView() { + memberTableView.backgroundView = EmptyPersonView() } func loadData(data: [MemberDetailResponse]) { members.removeAll() + if members.isEmpty { + setupEmptyView() + return + } data.forEach { if $0.userId == UserDefaultStorage.userId { currentMember = $0 @@ -78,7 +80,6 @@ final class TeamDetailMembersView: UIView { members.append($0) } } - determineEmptyTeam() memberTableView.reloadData() } } From 51a66b47e88cdb2bb72e8bd304ec1e03dbfb05e6 Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 17 May 2023 14:30:01 +0900 Subject: [PATCH 383/388] =?UTF-8?q?[CHORE]=20BackButton=20type=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screen/Home/EditTeamName/EditTeamNameViewController.swift | 2 +- .../Screen/Home/TeamDetail/TeamDetailViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift index 25648c66..2bd5e44e 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/EditTeamName/EditTeamNameViewController.swift @@ -53,7 +53,7 @@ final class EditTeamNameViewController: BaseTextFieldViewController { // MARK: - property private lazy var backButton: BackButton = { - let button = BackButton(type: .system) + let button = BackButton() let action = UIAction { [weak self] _ in self?.navigationController?.popViewController(animated: true) } diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift index 1106ba47..8af1cb76 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/TeamDetail/TeamDetailViewController.swift @@ -15,7 +15,7 @@ final class TeamDetailViewController: BaseViewController { // MARK: - property - private lazy var backButton = BackButton(type: .system) + private lazy var backButton = BackButton() private lazy var toastView = ToastView(type: .complete) private let titleLabel: UILabel = { let label = UILabel() From edeb324c9f0b2104a931eac230377c3375d30f93 Mon Sep 17 00:00:00 2001 From: seongmin221 Date: Wed, 17 May 2023 20:11:17 +0900 Subject: [PATCH 384/388] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#371)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maddori.Apple/Screen/Home/Home/HomeViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift index 5d4f7090..e64054ad 100644 --- a/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift +++ b/Maddori.Apple/Maddori.Apple/Screen/Home/Home/HomeViewController.swift @@ -362,7 +362,9 @@ final class HomeViewController: BaseViewController { case .SettingRequired, .Before, .Done: self.showAddFeedbackButton() case .Progressing: - self.emptyKeywordListWhenProgressing() + if reflectionKeywordList.isEmpty { + self.emptyKeywordListWhenProgressing() + } self.hideAddFeedbackButton() if !UserDefaultStorage.hasSeenReflectionAlert { self.presentStartReflectionView() From b6223751ec2595f98603001ff1d0485699f6b1ee Mon Sep 17 00:00:00 2001 From: chemi Date: Fri, 26 May 2023 20:14:12 +0900 Subject: [PATCH 385/388] =?UTF-8?q?[CHORE]=20v2.0.0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index bfaa2beb..8e370a5b 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1486,7 +1486,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.3.1; + MARKETING_VERSION = 2.0.0; PRODUCT_BUNDLE_IDENTIFIER = mingwan.Maddori.Apple.keygo; PRODUCT_NAME = Maddori.Apple; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1523,7 +1523,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.3.1; + MARKETING_VERSION = 2.0.0; PRODUCT_BUNDLE_IDENTIFIER = mingwan.Maddori.Apple.keygo; PRODUCT_NAME = Maddori.Apple; PROVISIONING_PROFILE_SPECIFIER = ""; From f16b293c88282855abff7a952cdfd5a9680f2521 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 29 May 2023 17:48:53 +0900 Subject: [PATCH 386/388] =?UTF-8?q?[CHORE]=20=EC=B9=B4=EB=A9=94=EB=9D=BC,?= =?UTF-8?q?=20=EC=82=AC=EC=A7=84=20=EC=A0=91=EA=B7=BC=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=EC=B6=94=EA=B0=80=20(#389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index bfaa2beb..8040bb7b 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1475,8 +1475,8 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; - INFOPLIST_KEY_NSCameraUsageDescription = ""; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; + INFOPLIST_KEY_NSCameraUsageDescription = "'키고'가 프로필 사진 설정을 위해 카메라에 접근하려고 합니다."; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "'키고'가 프로필 사진 설정을 위해 사용자의 사진에 접근하려고 합니다."; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -1512,8 +1512,8 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; - INFOPLIST_KEY_NSCameraUsageDescription = ""; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; + INFOPLIST_KEY_NSCameraUsageDescription = "'키고'가 프로필 사진 설정을 위해 카메라에 접근하려고 합니다."; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "'키고'가 프로필 사진 설정을 위해 사용자의 사진에 접근하려고 합니다."; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; From 0408841cad532265fbaddb8cc63301747749ac72 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 30 May 2023 14:06:27 +0900 Subject: [PATCH 387/388] =?UTF-8?q?[CHORE]=20aceess=20=EB=AC=B8=EC=9E=A5?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20(#389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index 8040bb7b..63743a97 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1475,8 +1475,8 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; - INFOPLIST_KEY_NSCameraUsageDescription = "'키고'가 프로필 사진 설정을 위해 카메라에 접근하려고 합니다."; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "'키고'가 프로필 사진 설정을 위해 사용자의 사진에 접근하려고 합니다."; + INFOPLIST_KEY_NSCameraUsageDescription = "프로필 이미지를 설정하기 위해 사용자의 카메라에 접근합니다."; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "프로필 이미지를 설정하기 위해 사용자의 사진에 접근합니다."; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; @@ -1512,8 +1512,8 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "키고"; - INFOPLIST_KEY_NSCameraUsageDescription = "'키고'가 프로필 사진 설정을 위해 카메라에 접근하려고 합니다."; - INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "'키고'가 프로필 사진 설정을 위해 사용자의 사진에 접근하려고 합니다."; + INFOPLIST_KEY_NSCameraUsageDescription = "프로필 이미지를 설정하기 위해 사용자의 카메라에 접근합니다."; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "프로필 이미지를 설정하기 위해 사용자의 사진에 접근합니다."; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; From 17557690d562afd987f5a884dd5549c578b77854 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 30 May 2023 17:21:01 +0900 Subject: [PATCH 388/388] =?UTF-8?q?[CHORE]=20v2.0.0=5F(2)=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 --- Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj index ed730bfc..3ea2d4dc 100644 --- a/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj +++ b/Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj @@ -1470,7 +1470,7 @@ CODE_SIGN_ENTITLEMENTS = Maddori.Apple/Maddori.Apple.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = HF8GHZB58X; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist; @@ -1507,7 +1507,7 @@ CODE_SIGN_ENTITLEMENTS = Maddori.Apple/Maddori.Apple.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = HF8GHZB58X; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Maddori.Apple/Global/Supports/Info.plist;