From 6a33b8baa1918358d2529575f5afe4a8213ede42 Mon Sep 17 00:00:00 2001 From: youz2me Date: Tue, 16 Jul 2024 17:04:51 +0900 Subject: [PATCH] =?UTF-8?q?refactor/#188=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/CheckInviteCodeView.swift | 7 +++++ .../CheckInviteCode/View/JoinButtonView.swift | 14 ++++++++- .../CheckInviteCodeViewController.swift | 19 ++++++++++-- .../View/CreateMeetingView.swift | 7 +++++ .../CreateMeetingViewController.swift | 29 +++++++++++++++---- .../ViewModel/CreateMeetingViewModel.swift | 15 ++++++++-- .../View/FinishCreateNavigationView.swift | 7 +++++ .../FinishCreateViewController.swift | 13 ++++++++- .../InviteCode/View/InviteCodeView.swift | 7 +++++ .../InviteCodeViewController.swift | 16 ++++++++++ .../ViewModel/InviteCodeViewModel.swift | 16 ++++++++-- .../View/PagePromiseSegmentedControl.swift | 18 +++++++++--- .../PagePromiseViewController.swift | 23 ++++++++++++++- .../ViewModel/PagePromiseViewModel.swift | 11 ++++++- .../Cell/ParticipantCollectionViewCell.swift | 7 +++++ .../PromiseInfo/View/PromiseInfoView.swift | 7 +++++ .../PromiseInfoViewController.swift | 13 +++++++++ .../View/EnterReadyInfoButtonView.swift | 4 +++ .../ReadyStatus/View/ReadyPlanInfoView.swift | 4 +++ .../ReadyStatus/View/ReadyStatusView.swift | 4 +++ .../ReadyStatusViewController.swift | 4 +++ .../Tardy/Cell/TardyCollectionViewCell.swift | 7 +++++ .../Promise/Tardy/View/ArriveView.swift | 7 +++++ .../Promise/Tardy/View/TardyEmptyView.swift | 7 +++++ .../Promise/Tardy/View/TardyPenaltyView.swift | 7 +++++ .../Source/Promise/Tardy/View/TardyView.swift | 7 +++++ .../ViewController/TardyViewController.swift | 12 ++++++++ .../Tardy/ViewModel/TardyViewModel.swift | 7 +++++ 28 files changed, 280 insertions(+), 19 deletions(-) diff --git a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/CheckInviteCodeView.swift b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/CheckInviteCodeView.swift index 1c40147f..acb3395d 100644 --- a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/CheckInviteCodeView.swift +++ b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/CheckInviteCodeView.swift @@ -8,6 +8,10 @@ import UIKit class CheckInviteCodeView: BaseView { + + + // MARK: Property + private let checkInviteLabel: UILabel = UILabel().then { $0.setText("친구에게 받은\n모임 초대 코드가 있으신가요?", style: .head01, color: .gray8) } @@ -20,6 +24,9 @@ class CheckInviteCodeView: BaseView { $0.setJoinButtonViewStatus(isReceived: false) } + + // MARK: - Setup + override func setupView() { self.addSubviews( checkInviteLabel, diff --git a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/JoinButtonView.swift b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/JoinButtonView.swift index 42c68ab4..5c561834 100644 --- a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/JoinButtonView.swift +++ b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/View/JoinButtonView.swift @@ -8,6 +8,10 @@ import UIKit class JoinButtonView: BaseView { + + + // MARK: Property + private let subTitleLabel: UILabel = UILabel().then { $0.setText("subTitleLabel", style: .caption02, color: .gray5) } @@ -21,6 +25,9 @@ class JoinButtonView: BaseView { $0.contentMode = .scaleAspectFit } + + // MARK: - Setup + override func setupView() { self.backgroundColor = .green1 @@ -50,7 +57,12 @@ class JoinButtonView: BaseView { $0.width.equalTo(chevronImageView.snp.height) } } - +} + + +// MARK: - Extension + +extension JoinButtonView { func setJoinButtonViewStatus(isReceived: Bool) { subTitleLabel.setText( isReceived ? "초대 코드를 받았다면" : "초대 코드가 없다면", diff --git a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/ViewController/CheckInviteCodeViewController.swift b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/ViewController/CheckInviteCodeViewController.swift index 037f6c42..6b5a79c0 100644 --- a/KkuMulKum/Source/MeetingCreate/CheckInviteCode/ViewController/CheckInviteCodeViewController.swift +++ b/KkuMulKum/Source/MeetingCreate/CheckInviteCode/ViewController/CheckInviteCodeViewController.swift @@ -8,12 +8,22 @@ import UIKit class CheckInviteCodeViewController: BaseViewController { + + + // MARK: Property + private let checkInviteCodeView: CheckInviteCodeView = CheckInviteCodeView() + + // MARK: LifeCycle + override func loadView() { view = checkInviteCodeView } + + // MARK: Setup + override func setupView() { view.backgroundColor = .white self.tabBarController?.tabBar.isHidden = true @@ -34,8 +44,12 @@ class CheckInviteCodeViewController: BaseViewController { } } + +// MARK: Extension + private extension CheckInviteCodeViewController { - @objc private func inviteCodeViewDidTap() { + @objc + func inviteCodeViewDidTap() { let inviteCodeViewController = InviteCodeViewController( viewModel: InviteCodeViewModel( service: MockInviteCodeService() @@ -48,7 +62,8 @@ private extension CheckInviteCodeViewController { navigationController?.pushViewController(inviteCodeViewController, animated: true) } - @objc private func createMeetingViewDidTap() { + @objc + private func createMeetingViewDidTap() { let createMeetingViewController = CreateMeetingViewController( viewModel: CreateMeetingViewModel( service: CreateMeetingService() diff --git a/KkuMulKum/Source/MeetingCreate/CreateMeeting/View/CreateMeetingView.swift b/KkuMulKum/Source/MeetingCreate/CreateMeeting/View/CreateMeetingView.swift index ef9d27df..53655331 100644 --- a/KkuMulKum/Source/MeetingCreate/CreateMeeting/View/CreateMeetingView.swift +++ b/KkuMulKum/Source/MeetingCreate/CreateMeeting/View/CreateMeetingView.swift @@ -8,6 +8,10 @@ import UIKit class CreateMeetingView: BaseView { + + + // MARK: Property + private let mainTitleLabel: UILabel = UILabel().then { $0.setText("모임 이름을\n입력해 주세요", style: .head01) } @@ -25,6 +29,9 @@ class CreateMeetingView: BaseView { isEnabled: false ) + + // MARK: - Setup + override func setupView() { addSubviews( mainTitleLabel, diff --git a/KkuMulKum/Source/MeetingCreate/CreateMeeting/ViewController/CreateMeetingViewController.swift b/KkuMulKum/Source/MeetingCreate/CreateMeeting/ViewController/CreateMeetingViewController.swift index 469a9a68..d49eabce 100644 --- a/KkuMulKum/Source/MeetingCreate/CreateMeeting/ViewController/CreateMeetingViewController.swift +++ b/KkuMulKum/Source/MeetingCreate/CreateMeeting/ViewController/CreateMeetingViewController.swift @@ -8,10 +8,17 @@ import UIKit class CreateMeetingViewController: BaseViewController { + + + // MARK: Property + private let createMeetingViewModel: CreateMeetingViewModel private let createMeetingView: CreateMeetingView = CreateMeetingView() + + // MARK: Initialize + init(viewModel: CreateMeetingViewModel) { self.createMeetingViewModel = viewModel @@ -22,6 +29,9 @@ class CreateMeetingViewController: BaseViewController { fatalError("init(coder:) has not been implemented") } + + // MARK: - LifeCycle + override func loadView() { view = createMeetingView } @@ -33,6 +43,9 @@ class CreateMeetingViewController: BaseViewController { setupTapGesture() } + + // MARK: - Setup + override func setupView() { setupNavigationBarTitle(with: "내 모임 추가하기") setupNavigationBarBackButton() @@ -52,8 +65,11 @@ class CreateMeetingViewController: BaseViewController { } } + +// MARK: - Extension + private extension CreateMeetingViewController { - private func setupBinding() { + func setupBinding() { createMeetingViewModel.inviteCodeState.bind(with: self) { owner, state in switch state { case .empty, .invalid: @@ -68,21 +84,24 @@ private extension CreateMeetingViewController { } } - private func setupTapGesture() { + func setupTapGesture() { let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) view.addGestureRecognizer(tapGesture) } - @objc private func textFieldDidChange(_ textField: UITextField) { + @objc + func textFieldDidChange(_ textField: UITextField) { createMeetingViewModel.validateName(textField.text ?? "") } - @objc private func dismissKeyboard() { + @objc + func dismissKeyboard() { view.endEditing(true) createMeetingView.nameTextField.layer.borderColor = UIColor.gray3.cgColor } - @objc private func presentButtonDidTapped() { + @objc + func presentButtonDidTapped() { // TODO: 서버 연결해서 초대 코드 받아올 수 있게 처리 let inviteCodePopUpViewController = InvitationCodePopUpViewController( invitationCode: createMeetingViewModel.inviteCode.value diff --git a/KkuMulKum/Source/MeetingCreate/CreateMeeting/ViewModel/CreateMeetingViewModel.swift b/KkuMulKum/Source/MeetingCreate/CreateMeeting/ViewModel/CreateMeetingViewModel.swift index 4af98d92..ceefe921 100644 --- a/KkuMulKum/Source/MeetingCreate/CreateMeeting/ViewModel/CreateMeetingViewModel.swift +++ b/KkuMulKum/Source/MeetingCreate/CreateMeeting/ViewModel/CreateMeetingViewModel.swift @@ -14,6 +14,10 @@ enum MeetingNameState { } class CreateMeetingViewModel { + + + // MARK: Property + let meetingName = ObservablePattern("") let inviteCodeState = ObservablePattern(.empty) let inviteCode = ObservablePattern("") @@ -22,10 +26,18 @@ class CreateMeetingViewModel { private let service: CreateMeetingServiceType + + // MARK: Initialize + init(service: CreateMeetingServiceType) { self.service = service } - +} + + +// MARK: - Extension + +extension CreateMeetingViewModel { func validateName(_ name: String) { meetingName.value = name characterCount.value = "\(name.count)/10" @@ -42,4 +54,3 @@ class CreateMeetingViewModel { } } } - diff --git a/KkuMulKum/Source/MeetingCreate/FinishCreate/View/FinishCreateNavigationView.swift b/KkuMulKum/Source/MeetingCreate/FinishCreate/View/FinishCreateNavigationView.swift index e6e3ed15..3b189fa7 100644 --- a/KkuMulKum/Source/MeetingCreate/FinishCreate/View/FinishCreateNavigationView.swift +++ b/KkuMulKum/Source/MeetingCreate/FinishCreate/View/FinishCreateNavigationView.swift @@ -8,12 +8,19 @@ import UIKit class FinishCreateNavigationView: BaseView { + + + // MARK: Property + let titleLabel = UILabel().then { $0.setText("내 모임 추가하기", style: .body03, color: .gray8) } let separatorView = UIView(backgroundColor: .gray1) + + // MARK: - Setup + override func setupView() { backgroundColor = .white diff --git a/KkuMulKum/Source/MeetingCreate/FinishCreate/ViewController/FinishCreateViewController.swift b/KkuMulKum/Source/MeetingCreate/FinishCreate/ViewController/FinishCreateViewController.swift index 8a90638d..5f0cb059 100644 --- a/KkuMulKum/Source/MeetingCreate/FinishCreate/ViewController/FinishCreateViewController.swift +++ b/KkuMulKum/Source/MeetingCreate/FinishCreate/ViewController/FinishCreateViewController.swift @@ -8,6 +8,10 @@ import UIKit class FinishCreateViewController: BaseViewController { + + + // MARK: Property + private let peopleImageView: UIImageView = UIImageView().then { $0.image = .imgCreateGroup $0.contentMode = .scaleAspectFit @@ -25,6 +29,9 @@ class FinishCreateViewController: BaseViewController { $0.backgroundColor = .maincolor } + + // MARK: - Setup + override func setupView() { view.backgroundColor = .green1 @@ -71,8 +78,12 @@ class FinishCreateViewController: BaseViewController { } } + +// MARK: - Extension + private extension FinishCreateViewController { - @objc func presentMeetingInfoViewControllerDidTapped() { + @objc + func presentMeetingInfoViewControllerDidTapped() { // TODO: 모임 상세 화면 띄우기 } } diff --git a/KkuMulKum/Source/MeetingCreate/InviteCode/View/InviteCodeView.swift b/KkuMulKum/Source/MeetingCreate/InviteCode/View/InviteCodeView.swift index a7cb29b4..1366af5d 100644 --- a/KkuMulKum/Source/MeetingCreate/InviteCode/View/InviteCodeView.swift +++ b/KkuMulKum/Source/MeetingCreate/InviteCode/View/InviteCodeView.swift @@ -8,6 +8,10 @@ import UIKit class InviteCodeView: BaseView { + + + // MARK: Property + private let mainTitleLabel: UILabel = UILabel().then { $0.setText("모임 초대 코드를\n입력해 주세요", style: .head01) } @@ -29,6 +33,9 @@ class InviteCodeView: BaseView { let presentButton: CustomButton = CustomButton(title: "모임 가입하기", isEnabled: false) + + // MARK: - Setup + override func setupView() { backgroundColor = .white diff --git a/KkuMulKum/Source/MeetingCreate/InviteCode/ViewController/InviteCodeViewController.swift b/KkuMulKum/Source/MeetingCreate/InviteCode/ViewController/InviteCodeViewController.swift index fed5f3ff..7379c789 100644 --- a/KkuMulKum/Source/MeetingCreate/InviteCode/ViewController/InviteCodeViewController.swift +++ b/KkuMulKum/Source/MeetingCreate/InviteCode/ViewController/InviteCodeViewController.swift @@ -8,10 +8,17 @@ import UIKit class InviteCodeViewController: BaseViewController { + + + // MARK: Property + private let inviteCodeViewModel: InviteCodeViewModel private let inviteCodeView: InviteCodeView = InviteCodeView() + + // MARK: Initialize + init(viewModel: InviteCodeViewModel) { self.inviteCodeViewModel = viewModel super.init(nibName: nil, bundle: nil) @@ -21,6 +28,9 @@ class InviteCodeViewController: BaseViewController { fatalError("init(coder:) has not been implemented") } + + // MARK: - LifeCycle + override func loadView() { view = inviteCodeView } @@ -32,6 +42,9 @@ class InviteCodeViewController: BaseViewController { setupTapGesture() } + + // MARK: - Setup + override func setupView() { setupNavigationBarTitle(with: "내 모임 추가하기") setupNavigationBarBackButton() @@ -56,6 +69,9 @@ class InviteCodeViewController: BaseViewController { } } + +// MARK: - Extension + extension InviteCodeViewController { private func setupBinding() { inviteCodeViewModel.inviteCodeState.bind(with: self) { owner, state in diff --git a/KkuMulKum/Source/MeetingCreate/InviteCode/ViewModel/InviteCodeViewModel.swift b/KkuMulKum/Source/MeetingCreate/InviteCode/ViewModel/InviteCodeViewModel.swift index 83c28704..bae6f038 100644 --- a/KkuMulKum/Source/MeetingCreate/InviteCode/ViewModel/InviteCodeViewModel.swift +++ b/KkuMulKum/Source/MeetingCreate/InviteCode/ViewModel/InviteCodeViewModel.swift @@ -15,16 +15,28 @@ enum InviteCodeState { } class InviteCodeViewModel { + + + // MARK: Property + let inviteCode = ObservablePattern("") let inviteCodeState = ObservablePattern(.empty) let isNextButtonEnabled = ObservablePattern(false) private let service: InviteCodeServiceType + + // MARK: Initialize + init(service: InviteCodeServiceType) { self.service = service } - +} + + +// MARK: - Extension + +private extension InviteCodeViewModel { func validateCode(_ code: String) { inviteCode.value = code @@ -34,7 +46,7 @@ class InviteCodeViewModel { } else if code.count == 6 && code != "eeeeee" { inviteCodeState.value = .valid isNextButtonEnabled.value = true - } + } // TODO: 서버 검증 성공했을 때 조건 변경 else if code == "eeeeee" { inviteCodeState.value = .success diff --git a/KkuMulKum/Source/Promise/PagePromise/View/PagePromiseSegmentedControl.swift b/KkuMulKum/Source/Promise/PagePromise/View/PagePromiseSegmentedControl.swift index 819ea24c..155a2b8b 100644 --- a/KkuMulKum/Source/Promise/PagePromise/View/PagePromiseSegmentedControl.swift +++ b/KkuMulKum/Source/Promise/PagePromise/View/PagePromiseSegmentedControl.swift @@ -10,12 +10,19 @@ import UIKit import SnapKit class PagePromiseSegmentedControl: UISegmentedControl { + + + // MARK: Property + private let backgroundLineView: UIView = UIView(backgroundColor: .gray2) let selectedUnderLineView: UIView = UIView(backgroundColor: .black).then { $0.layer.cornerRadius = 1 } + + // MARK: Initialize + override init(items: [Any]?) { super.init(items: items) @@ -30,14 +37,17 @@ class PagePromiseSegmentedControl: UISegmentedControl { } } + +// MARK: - Extension + private extension PagePromiseSegmentedControl { - private func setupSegment() { + func setupSegment() { addSubviews(backgroundLineView, selectedUnderLineView) selectedSegmentIndex = 0 } - private func setupBackgroundAndDivider() { + func setupBackgroundAndDivider() { setBackgroundImage(UIImage(), for: .normal, barMetrics: .default) setBackgroundImage(UIImage(), for: .selected, barMetrics: .default) setBackgroundImage(UIImage(), for: .highlighted, barMetrics: .default) @@ -50,7 +60,7 @@ private extension PagePromiseSegmentedControl { ) } - private func setupTextAttribute() { + func setupTextAttribute() { setTitleTextAttributes([ NSAttributedString.Key.foregroundColor: UIColor.gray3, NSAttributedString.Key.font: UIFont.pretendard(.body05) @@ -61,7 +71,7 @@ private extension PagePromiseSegmentedControl { ], for: .selected) } - private func setupBackgroundLineView() { + func setupBackgroundLineView() { backgroundLineView.snp.makeConstraints { $0.bottom.leading.trailing.equalToSuperview() $0.height.equalTo(2) diff --git a/KkuMulKum/Source/Promise/PagePromise/ViewController/PagePromiseViewController.swift b/KkuMulKum/Source/Promise/PagePromise/ViewController/PagePromiseViewController.swift index 9250d24a..13efd288 100644 --- a/KkuMulKum/Source/Promise/PagePromise/ViewController/PagePromiseViewController.swift +++ b/KkuMulKum/Source/Promise/PagePromise/ViewController/PagePromiseViewController.swift @@ -8,6 +8,10 @@ import UIKit class PagePromiseViewController: BaseViewController { + + + // MARK: Property + private let promiseViewModel = PagePromiseViewModel() private let promiseViewControllerList: [BaseViewController] = [ @@ -31,6 +35,9 @@ class PagePromiseViewController: BaseViewController { navigationOrientation: .vertical ) + + // MARK: - Setup + override func setupView() { view.backgroundColor = .white @@ -73,6 +80,9 @@ class PagePromiseViewController: BaseViewController { } } + +// MARK: - Extension + extension PagePromiseViewController { @objc private func didSegmentedControlIndexUpdated() { let condition = promiseViewModel.currentPage.value <= promiseSegmentedControl.selectedSegmentIndex @@ -97,7 +107,18 @@ extension PagePromiseViewController { } } -extension PagePromiseViewController: UIPageViewControllerDelegate, UIPageViewControllerDataSource { + + +// MARK: - UIPageViewControllerDelegate + +extension PagePromiseViewController: UIPageViewControllerDelegate { + +} + + +// MARK: - UIPageViewControllerDataSource + +extension PagePromiseViewController: UIPageViewControllerDataSource { func pageViewController( _ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController diff --git a/KkuMulKum/Source/Promise/PagePromise/ViewModel/PagePromiseViewModel.swift b/KkuMulKum/Source/Promise/PagePromise/ViewModel/PagePromiseViewModel.swift index eb68a471..3be9e9b9 100644 --- a/KkuMulKum/Source/Promise/PagePromise/ViewModel/PagePromiseViewModel.swift +++ b/KkuMulKum/Source/Promise/PagePromise/ViewModel/PagePromiseViewModel.swift @@ -9,8 +9,17 @@ import Foundation class PagePromiseViewModel { - var currentPage = ObservablePattern(0) + + // MARK: Property + + var currentPage = ObservablePattern(0) +} + + +// MARK: - Extension + +private extension PagePromiseViewModel { func didSegmentIndexChanged(index: Int) { currentPage.value = index } diff --git a/KkuMulKum/Source/Promise/PromiseInfo/Cell/ParticipantCollectionViewCell.swift b/KkuMulKum/Source/Promise/PromiseInfo/Cell/ParticipantCollectionViewCell.swift index 3d6489a3..aaab9903 100644 --- a/KkuMulKum/Source/Promise/PromiseInfo/Cell/ParticipantCollectionViewCell.swift +++ b/KkuMulKum/Source/Promise/PromiseInfo/Cell/ParticipantCollectionViewCell.swift @@ -10,6 +10,10 @@ import UIKit import SnapKit class ParticipantCollectionViewCell: BaseCollectionViewCell { + + + // MARK: Property + private lazy var profileImageView: UIImageView = UIImageView().then { $0.image = .imgProfile $0.contentMode = .scaleAspectFit @@ -19,6 +23,9 @@ class ParticipantCollectionViewCell: BaseCollectionViewCell { $0.setText("userName", style: .caption02, color: .gray6) } + + // MARK: - Setup + override func setupView() { contentView.addSubviews(profileImageView, userNameLabel) } diff --git a/KkuMulKum/Source/Promise/PromiseInfo/View/PromiseInfoView.swift b/KkuMulKum/Source/Promise/PromiseInfo/View/PromiseInfoView.swift index ff067ceb..64fb7149 100644 --- a/KkuMulKum/Source/Promise/PromiseInfo/View/PromiseInfoView.swift +++ b/KkuMulKum/Source/Promise/PromiseInfo/View/PromiseInfoView.swift @@ -8,6 +8,10 @@ import UIKit class PromiseInfoView: BaseView { + + + // MARK: Property + private let participantNumberLabel: UILabel = UILabel().then { $0.setText("약속 참여 인원 n명", style: .body01) $0.setHighlightText("n명", style: .body01, color: .maincolor) @@ -93,6 +97,9 @@ class PromiseInfoView: BaseView { $0.setText("ssss하기", style: .body04, color: .gray7) } + + // MARK: - Setup + override func setupView() { addSubviews( participantNumberLabel, diff --git a/KkuMulKum/Source/Promise/PromiseInfo/ViewController/PromiseInfoViewController.swift b/KkuMulKum/Source/Promise/PromiseInfo/ViewController/PromiseInfoViewController.swift index 6a752587..7c5b2009 100644 --- a/KkuMulKum/Source/Promise/PromiseInfo/ViewController/PromiseInfoViewController.swift +++ b/KkuMulKum/Source/Promise/PromiseInfo/ViewController/PromiseInfoViewController.swift @@ -8,8 +8,15 @@ import UIKit class PromiseInfoViewController: BaseViewController { + + + // MARK: Property + private let promiseInfoView: PromiseInfoView = PromiseInfoView() + + // MARK: - Setup + override func setupView() { view.addSubview(promiseInfoView) self.navigationController?.navigationBar.shadowImage = nil @@ -25,6 +32,9 @@ class PromiseInfoViewController: BaseViewController { } } + +// MARK: - UICollectionViewDataSource + extension PromiseInfoViewController: UICollectionViewDataSource { func collectionView( _ collectionView: UICollectionView, @@ -34,6 +44,9 @@ extension PromiseInfoViewController: UICollectionViewDataSource { } } + +// MARK: - UICollectionViewDelegateFlowLayout + extension PromiseInfoViewController: UICollectionViewDelegateFlowLayout { func collectionView( _ collectionView: UICollectionView, diff --git a/KkuMulKum/Source/Promise/ReadyStatus/View/EnterReadyInfoButtonView.swift b/KkuMulKum/Source/Promise/ReadyStatus/View/EnterReadyInfoButtonView.swift index 46c21e86..47bf272e 100644 --- a/KkuMulKum/Source/Promise/ReadyStatus/View/EnterReadyInfoButtonView.swift +++ b/KkuMulKum/Source/Promise/ReadyStatus/View/EnterReadyInfoButtonView.swift @@ -8,6 +8,10 @@ import UIKit class EnterReadyInfoButtonView: BaseView { + + + // MARK: Property + private let descriptionLabel: UILabel = UILabel().then { $0.setText("준비 정보 입력하기", style: .body03) } diff --git a/KkuMulKum/Source/Promise/ReadyStatus/View/ReadyPlanInfoView.swift b/KkuMulKum/Source/Promise/ReadyStatus/View/ReadyPlanInfoView.swift index 355010eb..432b6c2c 100644 --- a/KkuMulKum/Source/Promise/ReadyStatus/View/ReadyPlanInfoView.swift +++ b/KkuMulKum/Source/Promise/ReadyStatus/View/ReadyPlanInfoView.swift @@ -8,6 +8,10 @@ import UIKit class ReadyPlanInfoView: BaseView { + + + // MARK: Property + private let readyTimeLabel: UILabel = UILabel().then { $0.setText("12시 30분에 준비하고,\n1시에 이동을 시작해야 해요", style: .body03) $0.setHighlightText("12시 30분", "1시", style: .body03, color: .maincolor) diff --git a/KkuMulKum/Source/Promise/ReadyStatus/View/ReadyStatusView.swift b/KkuMulKum/Source/Promise/ReadyStatus/View/ReadyStatusView.swift index 37ce3d08..c077e901 100644 --- a/KkuMulKum/Source/Promise/ReadyStatus/View/ReadyStatusView.swift +++ b/KkuMulKum/Source/Promise/ReadyStatus/View/ReadyStatusView.swift @@ -8,6 +8,10 @@ import UIKit class ReadyStatusView: BaseView { + + + // MARK: Initialize + override init(frame: CGRect) { super.init(frame: frame) } diff --git a/KkuMulKum/Source/Promise/ReadyStatus/ViewController/ReadyStatusViewController.swift b/KkuMulKum/Source/Promise/ReadyStatus/ViewController/ReadyStatusViewController.swift index 78876385..26d2d69f 100644 --- a/KkuMulKum/Source/Promise/ReadyStatus/ViewController/ReadyStatusViewController.swift +++ b/KkuMulKum/Source/Promise/ReadyStatus/ViewController/ReadyStatusViewController.swift @@ -8,6 +8,10 @@ import UIKit class ReadyStatusViewController: BaseViewController { + + + // MARK: Property + private let readyStatusView: ReadyStatusView = ReadyStatusView() override func viewDidLoad() { diff --git a/KkuMulKum/Source/Promise/Tardy/Cell/TardyCollectionViewCell.swift b/KkuMulKum/Source/Promise/Tardy/Cell/TardyCollectionViewCell.swift index 178847eb..fee4e556 100644 --- a/KkuMulKum/Source/Promise/Tardy/Cell/TardyCollectionViewCell.swift +++ b/KkuMulKum/Source/Promise/Tardy/Cell/TardyCollectionViewCell.swift @@ -8,6 +8,10 @@ import UIKit class TardyCollectionViewCell: BaseCollectionViewCell { + + + // MARK: Property + private let profileImageView: UIImageView = UIImageView().then { $0.image = .imgProfile $0.contentMode = .scaleAspectFill @@ -18,6 +22,9 @@ class TardyCollectionViewCell: BaseCollectionViewCell { $0.setText("이름", style: .body06, color: .gray6) } + + // MARK: - Setup + override func setupView() { addSubviews(profileImageView, nameLabel) diff --git a/KkuMulKum/Source/Promise/Tardy/View/ArriveView.swift b/KkuMulKum/Source/Promise/Tardy/View/ArriveView.swift index 1e553886..993fa399 100644 --- a/KkuMulKum/Source/Promise/Tardy/View/ArriveView.swift +++ b/KkuMulKum/Source/Promise/Tardy/View/ArriveView.swift @@ -8,6 +8,10 @@ import UIKit class ArriveView: BaseView { + + + // MARK: Property + private let giftImageView: UIImageView = UIImageView().then { $0.image = .imgGift $0.contentMode = .scaleAspectFit @@ -28,6 +32,9 @@ class ArriveView: BaseView { $0.backgroundColor = .maincolor } + + // MARK: - Setup + override func setupView() { backgroundColor = .green1 diff --git a/KkuMulKum/Source/Promise/Tardy/View/TardyEmptyView.swift b/KkuMulKum/Source/Promise/Tardy/View/TardyEmptyView.swift index b2402d9e..84fba014 100644 --- a/KkuMulKum/Source/Promise/Tardy/View/TardyEmptyView.swift +++ b/KkuMulKum/Source/Promise/Tardy/View/TardyEmptyView.swift @@ -8,6 +8,10 @@ import UIKit class TardyEmptyView: BaseView { + + + // MARK: Property + private let characterImageView: UIImageView = UIImageView().then { $0.image = .imgEmptyTardy $0.contentMode = .scaleAspectFit @@ -17,6 +21,9 @@ class TardyEmptyView: BaseView { $0.setText("꾸물이들이 도착하길\n기다리는 중이에요", style: .body05, color: .gray3) } + + // MARK: - Setup + override func setupView() { addSubviews(characterImageView, emptyContentLabel) } diff --git a/KkuMulKum/Source/Promise/Tardy/View/TardyPenaltyView.swift b/KkuMulKum/Source/Promise/Tardy/View/TardyPenaltyView.swift index 437ea036..9d495b10 100644 --- a/KkuMulKum/Source/Promise/Tardy/View/TardyPenaltyView.swift +++ b/KkuMulKum/Source/Promise/Tardy/View/TardyPenaltyView.swift @@ -8,6 +8,10 @@ import UIKit class TardyPenaltyView: BaseView { + + + // MARK: Property + private let penaltyImageView: UIImageView = UIImageView().then { $0.image = .iconPenalty $0.contentMode = .scaleAspectFit @@ -21,6 +25,9 @@ class TardyPenaltyView: BaseView { $0.setText("탕후루 릴스 찍기", style: .body03, color: .gray8) } + + // MARK: - Setup + override func setupView() { backgroundColor = .green1 diff --git a/KkuMulKum/Source/Promise/Tardy/View/TardyView.swift b/KkuMulKum/Source/Promise/Tardy/View/TardyView.swift index c7491460..eb1be060 100644 --- a/KkuMulKum/Source/Promise/Tardy/View/TardyView.swift +++ b/KkuMulKum/Source/Promise/Tardy/View/TardyView.swift @@ -8,6 +8,10 @@ import UIKit class TardyView: BaseView { + + + // MARK: Property + private let tardyPenaltyView: TardyPenaltyView = TardyPenaltyView().then { $0.layer.cornerRadius = 8 } @@ -40,6 +44,9 @@ class TardyView: BaseView { $0.backgroundColor = .maincolor } + + // MARK: - Setup + override func setupView() { backgroundColor = .white diff --git a/KkuMulKum/Source/Promise/Tardy/ViewController/TardyViewController.swift b/KkuMulKum/Source/Promise/Tardy/ViewController/TardyViewController.swift index 2a6571e0..7c790762 100644 --- a/KkuMulKum/Source/Promise/Tardy/ViewController/TardyViewController.swift +++ b/KkuMulKum/Source/Promise/Tardy/ViewController/TardyViewController.swift @@ -8,10 +8,17 @@ import UIKit class TardyViewController: BaseViewController { + + + // MARK: Property + private let tardyViewModel: TardyViewModel private let tardyView: TardyView = TardyView() private let arriveView: ArriveView = ArriveView() + + // MARK: Initialize + init(tardyViewModel: TardyViewModel) { self.tardyViewModel = tardyViewModel @@ -22,6 +29,9 @@ class TardyViewController: BaseViewController { fatalError("init(coder:) has not been implemented") } + + // MARK: - Setup + override func loadView() { view = tardyViewModel.hasTardy.value ? tardyView : arriveView } @@ -41,6 +51,8 @@ class TardyViewController: BaseViewController { } +// MARK: - Extension + private extension TardyViewController { @objc func finishMeetingButtonDidTapped() { diff --git a/KkuMulKum/Source/Promise/Tardy/ViewModel/TardyViewModel.swift b/KkuMulKum/Source/Promise/Tardy/ViewModel/TardyViewModel.swift index 1b8ae007..fce0415e 100644 --- a/KkuMulKum/Source/Promise/Tardy/ViewModel/TardyViewModel.swift +++ b/KkuMulKum/Source/Promise/Tardy/ViewModel/TardyViewModel.swift @@ -8,9 +8,16 @@ import Foundation class TardyViewModel { + + + // MARK: Property + var isPastDue: ObservablePattern var hasTardy: ObservablePattern + + // MARK: Initialize + init( isPastDue: ObservablePattern, hasTardy: ObservablePattern