From 30960d839608479e8d60fa43b8d6f653d7bfff02 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 12:18:12 +0900 Subject: [PATCH 01/16] =?UTF-8?q?[Feat]=20#459=20-=20=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=EC=97=B4=20=EB=A6=AC=ED=84=B0=EB=9F=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Literals/StringLiterals.swift | 4 +++ .../HomeCalendarDetailPresentable.swift | 9 ++++++ .../Cells/HomeCalendarDetailCVC.swift | 13 ++++++++ .../VC/HomeCalendarDetailVC.swift | 30 +++++++++++++++++++ .../HomeCalendarDetailViewModel.swift | 13 ++++++++ 5 files changed, 69 insertions(+) create mode 100644 SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeCalendarDetailPresentable.swift create mode 100644 SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/Cells/HomeCalendarDetailCVC.swift create mode 100644 SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift create mode 100644 SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/ViewModel/HomeCalendarDetailViewModel.swift diff --git a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift index c94b4159..289eefcd 100644 --- a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift +++ b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift @@ -283,6 +283,10 @@ public struct I18N { public static let instagram = "인스타" public static let youtube = "유튜브" } + + public struct CalendarDetail { + public static let attendance = "출석하러 가기" + } } public struct Soptlog { diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeCalendarDetailPresentable.swift b/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeCalendarDetailPresentable.swift new file mode 100644 index 00000000..79cb1d2f --- /dev/null +++ b/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeCalendarDetailPresentable.swift @@ -0,0 +1,9 @@ +// +// HomeCalendarDetailPresentable.swift +// HomeFeatureDemo +// +// Created by 강윤서 on 12/12/24. +// Copyright © 2024 SOPT-iOS. All rights reserved. +// + +import Foundation diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/Cells/HomeCalendarDetailCVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/Cells/HomeCalendarDetailCVC.swift new file mode 100644 index 00000000..516202e3 --- /dev/null +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/Cells/HomeCalendarDetailCVC.swift @@ -0,0 +1,13 @@ +// +// HomeCalendarDetailCVC.swift +// HomeFeatureDemo +// +// Created by 강윤서 on 12/12/24. +// Copyright © 2024 SOPT-iOS. All rights reserved. +// + +import UIKit + +class HomeCalendarDetailCVC: UICollectionViewCell { + +} diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift new file mode 100644 index 00000000..86800c90 --- /dev/null +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift @@ -0,0 +1,30 @@ +// +// CalendarDetailVC.swift +// HomeFeatureDemo +// +// Created by 강윤서 on 12/12/24. +// Copyright © 2024 SOPT-iOS. All rights reserved. +// + +import UIKit + +final class CalendarDetailVC: UIViewController { + + // MARK: - Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + } +} + +// MARK: - UI & Layout + +extension CalendarDetailVC { + private func setUI() { + + } + + private func setLayout() { + + } +} diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/ViewModel/HomeCalendarDetailViewModel.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/ViewModel/HomeCalendarDetailViewModel.swift new file mode 100644 index 00000000..78a3a24a --- /dev/null +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/ViewModel/HomeCalendarDetailViewModel.swift @@ -0,0 +1,13 @@ +// +// CalendarDetailViewModel.swift +// HomeFeatureDemo +// +// Created by 강윤서 on 12/12/24. +// Copyright © 2024 SOPT-iOS. All rights reserved. +// + +import Foundation + +public class CalendarDetailViewModel { + +} From 45a8ad0becd49d40ea9a5a152d474b40b7e670c6 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 12:19:03 +0900 Subject: [PATCH 02/16] =?UTF-8?q?[Feat]=20#459=20-=20HomeCalendarDetail=20?= =?UTF-8?q?View=20=EC=9D=B8=ED=84=B0=ED=8E=98=EC=9D=B4=EC=8A=A4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/HomeCalendarDetailPresentable.swift | 10 ++++++++++ .../Interface/Sources/HomeFeatureBuildable.swift | 1 + 2 files changed, 11 insertions(+) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeCalendarDetailPresentable.swift b/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeCalendarDetailPresentable.swift index 79cb1d2f..b3a329c7 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeCalendarDetailPresentable.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeCalendarDetailPresentable.swift @@ -7,3 +7,13 @@ // import Foundation + +import BaseFeatureDependency +import Core + +public protocol HomeCalendarDetailViewControllable: ViewControllable {} +public protocol HomeCalendarDetailCoordinatable { + +} +public typealias HomeCalendarDetailViewModelType = ViewModelType & HomeCalendarDetailCoordinatable +public typealias HomeCalendarDetailPresentable = (vc: HomeCalendarDetailViewControllable, vm: any HomeCalendarDetailViewModelType) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeFeatureBuildable.swift b/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeFeatureBuildable.swift index 553ec320..486b04cc 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeFeatureBuildable.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeFeatureBuildable.swift @@ -11,4 +11,5 @@ import Core public protocol HomeFeatureBuildable { func makeHomeForMember() -> HomeForMemberPresentable func makeHomeForVisitor() -> HomeForVisitorPresentable + func makeHomeCalendarDetail() -> HomeCalendarDetailPresentable } From ca8bc0fab25439200ad64eb43b418f83d2d7f6f6 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 12:20:22 +0900 Subject: [PATCH 03/16] =?UTF-8?q?[Fix]=20#459=20-=20DashboardCalendarCateg?= =?UTF-8?q?oryTag=EC=97=90=20=EB=88=84=EB=9D=BD=EB=90=9C=20=EB=B0=B0?= =?UTF-8?q?=EA=B2=BD=20=EC=83=89=EC=83=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/TagTypes/DashBoardCalenderCategoryTagType.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Components/TagTypes/DashBoardCalenderCategoryTagType.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Components/TagTypes/DashBoardCalenderCategoryTagType.swift index d1f41c76..d1f3cfea 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Components/TagTypes/DashBoardCalenderCategoryTagType.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Components/TagTypes/DashBoardCalenderCategoryTagType.swift @@ -29,7 +29,7 @@ enum DashBoardCalenderCategoryTagType { case .event: return DSKitAsset.Colors.success.color case .seminar: - return DSKitAsset.Colors.success.color + return DSKitAsset.Colors.secondary.color } } From 3203d7037a0f160b73645b7894e7c1a835412061 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 12:20:50 +0900 Subject: [PATCH 04/16] =?UTF-8?q?[Feat]=20#459=20-=20=EC=BA=98=EB=A6=B0?= =?UTF-8?q?=EB=8D=94=EB=B7=B0=20=EC=85=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cells/HomeCalendarDetailCVC.swift | 91 ++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/Cells/HomeCalendarDetailCVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/Cells/HomeCalendarDetailCVC.swift index 516202e3..0bb03b3f 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/Cells/HomeCalendarDetailCVC.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/Cells/HomeCalendarDetailCVC.swift @@ -8,6 +8,95 @@ import UIKit -class HomeCalendarDetailCVC: UICollectionViewCell { +import Then +import DSKit + +final class HomeCalendarDetailCVC: UICollectionViewCell { + + // MARK: UI Components + + private let circleView = UIView().then { + $0.backgroundColor = DSKitAsset.Colors.gray500.color + $0.layer.cornerRadius = 7.5 + } + + private let stickView = UIView().then { + $0.backgroundColor = DSKitAsset.Colors.gray500.color + } + + private let dateLabel = UILabel().then { + $0.font = DSKitFontFamily.Suit.medium.font(size: 14) + $0.textColor = DSKitAsset.Colors.gray300.color + } + + private let homeCategoryTagView = HomeSquareTagView() + + private let calendarTitleLabel = UILabel().then { + $0.font = DSKitFontFamily.Suit.bold.font(size: 18) + $0.textColor = DSKitAsset.Colors.gray10.color + } + + // MARK: - Initialization + override init(frame: CGRect) { + super.init(frame: frame) + + setUI() + setLayout() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +// MARK: UI & Layout + +extension HomeCalendarDetailCVC { + private func setUI() { + contentView.backgroundColor = .clear + } + + private func setLayout() { + contentView.addSubviews(circleView, stickView, dateLabel, homeCategoryTagView, calendarTitleLabel) + + circleView.snp.makeConstraints { make in + make.width.height.equalTo(13) + make.top.equalToSuperview().inset(15) + make.leading.equalToSuperview().inset(1.5) + } + + stickView.snp.makeConstraints { make in + make.top.equalTo(circleView.snp.bottom) + make.centerX.equalTo(circleView) + make.width.equalTo(1) + make.bottom.equalToSuperview().offset(90) + } + + dateLabel.snp.makeConstraints { make in + make.leading.equalTo(circleView.snp.trailing).offset(9.5) + make.centerY.equalTo(circleView) + } + + homeCategoryTagView.snp.makeConstraints { make in + make.top.equalTo(dateLabel.snp.bottom).offset(17) + make.leading.equalTo(dateLabel) + } + + calendarTitleLabel.snp.makeConstraints { make in + make.centerY.equalTo(homeCategoryTagView) + make.leading.equalTo(homeCategoryTagView.snp.trailing).offset(10) + } + } +} + +extension HomeCalendarDetailCVC { + func configureCell(_ model: CalendarDetail) { + dateLabel.text = model.date + calendarTitleLabel.text = model.title + homeCategoryTagView.setData(title: model.type.text, + titleColor: model.type.textColor, + backgroundColor: model.type.backgroundColor) + circleView.backgroundColor = model.isRecentSchedule ? DSKitAsset.Colors.white.color : DSKitAsset.Colors.gray500.color + } } From 096f4611629697e621ea4a08c71489518ae05bfa Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 12:21:32 +0900 Subject: [PATCH 05/16] =?UTF-8?q?[Feat]=20#459=20-=20ViewController=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84(gradientView=20=EC=B6=94=EA=B0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VC/HomeCalendarDetailVC.swift | 118 +++++++++++++++++- 1 file changed, 114 insertions(+), 4 deletions(-) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift index 86800c90..7fe0a745 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift @@ -1,5 +1,5 @@ // -// CalendarDetailVC.swift +// HomeCalendarDetailVC.swift // HomeFeatureDemo // // Created by 강윤서 on 12/12/24. @@ -7,24 +7,134 @@ // import UIKit +import DSKit +import Core -final class CalendarDetailVC: UIViewController { +final class HomeCalendarDetailVC: UIViewController, HomeCalendarDetailViewControllable { + // MARK: Properties + + public let viewModel: HomeCalendarDetailViewModel + + // MARK: UI Components + + private lazy var collectionView = UICollectionView( + frame: .zero, + collectionViewLayout: UICollectionViewFlowLayout() + ).then { + $0.isScrollEnabled = true + $0.showsHorizontalScrollIndicator = false + $0.showsVerticalScrollIndicator = false + $0.contentInset = UIEdgeInsets(top: 16, left: 0, bottom: 138, right: 0) + $0.backgroundColor = .clear + } + + private let attendanceButton = AppCustomButton(title: I18N.Home.CalendarDetail.attendance) + .changeCornerRadius(radius: 12) + .setConfigForState(enabledFont: DSKitFontFamily.Suit.semiBold.font(size: 18)) + + private let gradationView = UIView().then { + let gradientLayer = CAGradientLayer() + gradientLayer.colors = [DSKitAsset.Colors.black.color.withAlphaComponent(0.0).cgColor, DSKitAsset.Colors.black.color.cgColor] + gradientLayer.startPoint = CGPoint(x: 0.5, y: 0) + gradientLayer.endPoint = CGPoint(x: 0.5, y: 1) + $0.layer.addSublayer(gradientLayer) + $0.isUserInteractionEnabled = false + } + + // MARK: - Initialization + + init(viewModel: HomeCalendarDetailViewModel) { + self.viewModel = viewModel + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + // MARK: - Life Cycle override func viewDidLoad() { super.viewDidLoad() + + setUI() + setLayout() + setDelegate() + registerCells() + } + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + if let gradientLayer = gradationView.layer.sublayers?.first as? CAGradientLayer { + gradientLayer.frame = gradationView.bounds + } } } // MARK: - UI & Layout -extension CalendarDetailVC { +extension HomeCalendarDetailVC { private func setUI() { - + view.backgroundColor = DSKitAsset.Colors.semanticBackground.color + self.navigationController?.isNavigationBarHidden = true } private func setLayout() { + view.addSubviews(collectionView, gradationView, attendanceButton) + + collectionView.snp.makeConstraints { make in + make.top.equalTo(view.safeAreaLayoutGuide) // navigation 추가 후 변경 + make.leading.trailing.equalToSuperview().inset(20) + make.bottom.equalToSuperview() + } + gradationView.snp.makeConstraints { make in + make.leading.trailing.bottom.equalToSuperview() + make.height.equalTo(209.adjustedH) + } + + attendanceButton.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(20) + make.bottom.equalToSuperview().inset(34) + make.height.equalTo(56) + } + } +} + +// MARK: - Methods + +extension HomeCalendarDetailVC { + private func setDelegate() { + collectionView.dataSource = self + collectionView.delegate = self + } + + private func registerCells() { + collectionView.register(HomeCalendarDetailCVC.self, forCellWithReuseIdentifier: HomeCalendarDetailCVC.className) + } +} + +extension HomeCalendarDetailVC: UICollectionViewDelegateFlowLayout, UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return viewModel.calendarDetailList.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: HomeCalendarDetailCVC.className, for: indexPath) as? HomeCalendarDetailCVC else { return UICollectionViewCell() } + + cell.configureCell(viewModel.calendarDetailList[indexPath.row]) + + return cell + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + let length = self.collectionView.frame.size.width + return CGSize(width: length, height: 96.adjustedH) + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + return 0 } } From c6be09b8086bc53bc79366f7bd93f08fda5b004d Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 12:22:01 +0900 Subject: [PATCH 06/16] =?UTF-8?q?[Chore]=20#459=20-=20=EB=8D=94=EB=AF=B8?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HomeCalendarDetailViewModel.swift | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/ViewModel/HomeCalendarDetailViewModel.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/ViewModel/HomeCalendarDetailViewModel.swift index 78a3a24a..5e0b42c5 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/ViewModel/HomeCalendarDetailViewModel.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/ViewModel/HomeCalendarDetailViewModel.swift @@ -1,5 +1,5 @@ // -// CalendarDetailViewModel.swift +// HomeCalendarDetailViewModel.swift // HomeFeatureDemo // // Created by 강윤서 on 12/12/24. @@ -8,6 +8,49 @@ import Foundation -public class CalendarDetailViewModel { +import Core +import HomeFeatureInterface + +struct CalendarDetail { + let date: String + let title: String + let isRecentSchedule: Bool + let type: DashBoardCalenderCategoryTagType +} + + +public class HomeCalendarDetailViewModel: HomeCalendarDetailViewModelType { + + // TODO: - 서버 연결 필요 + + let calendarDetailList: [CalendarDetail] = [ + CalendarDetail(date: "9월 28일 토요일", title: "OT", isRecentSchedule: false, type: .event), + CalendarDetail(date: "9월 28일 토요일", title: "1차 세미나", isRecentSchedule: false, type: .seminar), + CalendarDetail(date: "9월 28일 토요일", title: "2차 세미나", isRecentSchedule: false, type: .seminar), + CalendarDetail(date: "9월 28일 토요일", title: "3차 세미나", isRecentSchedule: true, type: .seminar), + CalendarDetail(date: "9월 28일 토요일", title: "4차 세미나", isRecentSchedule: false, type: .seminar), + CalendarDetail(date: "9월 28일 토요일", title: "5차 세미나", isRecentSchedule: false, type: .seminar), + CalendarDetail(date: "9월 28일 토요일", title: "6차 세미나", isRecentSchedule: false, type: .seminar), + CalendarDetail(date: "9월 28일 토요일", title: "7차 세미나", isRecentSchedule: false, type: .seminar), + CalendarDetail(date: "9월 28일 토요일", title: "8차 세미나", isRecentSchedule: false, type: .seminar) + ] + + // MARK: - Inputs + public struct Input { } + + // MARK: - Outputs + + public struct Output { } + + // MARK: - initialization + + public init() { } +} + +extension HomeCalendarDetailViewModel { + public func transform(from input: Input, cancelBag: CancelBag) -> Output { + let output = Output() + return output + } } From 42bf6837584886b839ec9f40e102fdfa09f541f4 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 12:26:13 +0900 Subject: [PATCH 07/16] =?UTF-8?q?[Feat]=20=20-=20CalendarDetail=20ViewBuil?= =?UTF-8?q?der=20=EB=A9=94=EC=86=8C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/HomeScene/Coordinator/HomeBuilder.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Coordinator/HomeBuilder.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Coordinator/HomeBuilder.swift index 48286587..9bdb51c4 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Coordinator/HomeBuilder.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Coordinator/HomeBuilder.swift @@ -22,8 +22,14 @@ extension HomeBuilder: HomeFeatureBuildable { } public func makeHomeForVisitor() -> HomeForVisitorPresentable { - let homeForVisitorVC = HomeForVisitorVC() let viewModel = HomeForVisitorViewModel() + let homeForVisitorVC = HomeForVisitorVC() return (homeForVisitorVC, viewModel) } + + public func makeHomeCalendarDetail() -> HomeCalendarDetailPresentable { + let viewModel = HomeCalendarDetailViewModel() + let homeCalendarDetailVC = HomeCalendarDetailVC(viewModel: viewModel) + return (homeCalendarDetailVC, viewModel) + } } From 7598fed2b7ebf1e61d13626bbf9f0e1207fb7de7 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 12:49:26 +0900 Subject: [PATCH 08/16] =?UTF-8?q?[Feat]=20#459=20-=20=EC=9D=BC=EC=A0=95=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CalendarDetailScene/VC/HomeCalendarDetailVC.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift index 7fe0a745..0eec473a 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift @@ -70,6 +70,8 @@ final class HomeCalendarDetailVC: UIViewController, HomeCalendarDetailViewContro if let gradientLayer = gradationView.layer.sublayers?.first as? CAGradientLayer { gradientLayer.frame = gradationView.bounds } + + scrollToRecentSchedule() } } @@ -114,6 +116,15 @@ extension HomeCalendarDetailVC { private func registerCells() { collectionView.register(HomeCalendarDetailCVC.self, forCellWithReuseIdentifier: HomeCalendarDetailCVC.className) } + + @MainActor + private func scrollToRecentSchedule() { + if let index = self.viewModel.calendarDetailList.firstIndex(where: {$0.isRecentSchedule}) { + self.collectionView.scrollToItem(at: IndexPath(item: index, section: 0), + at: .top, + animated: true) + } + } } extension HomeCalendarDetailVC: UICollectionViewDelegateFlowLayout, UICollectionViewDataSource { From 453d7c20c1d1ca57b3023c37e3b855cbbb0bc036 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 16:26:14 +0900 Subject: [PATCH 09/16] =?UTF-8?q?[Feat]=20#459=20-=20navigation=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Sources/Literals/StringLiterals.swift | 1 + .../VC/HomeCalendarDetailVC.swift | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift index 289eefcd..18f0aa63 100644 --- a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift +++ b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift @@ -285,6 +285,7 @@ public struct I18N { } public struct CalendarDetail { + public static let navigationTitle = "일정" public static let attendance = "출석하러 가기" } } diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift index 0eec473a..4aeb7a59 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift @@ -18,6 +18,12 @@ final class HomeCalendarDetailVC: UIViewController, HomeCalendarDetailViewContro // MARK: UI Components + private lazy var naviBar = OPNavigationBar(self, + type: .oneLeftButton, + backgroundColor: DSKitAsset.Colors.semanticBackground.color) + .addMiddleLabel(title: I18N.Home.CalendarDetail.navigationTitle, font: DSKitFontFamily.Suit.medium.font(size: 16)) + + private lazy var collectionView = UICollectionView( frame: .zero, collectionViewLayout: UICollectionViewFlowLayout() @@ -84,10 +90,15 @@ extension HomeCalendarDetailVC { } private func setLayout() { - view.addSubviews(collectionView, gradationView, attendanceButton) + view.addSubviews(naviBar, collectionView, gradationView, attendanceButton) + + naviBar.snp.makeConstraints { make in + make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + + } collectionView.snp.makeConstraints { make in - make.top.equalTo(view.safeAreaLayoutGuide) // navigation 추가 후 변경 + make.top.equalTo(naviBar.snp.bottom) make.leading.trailing.equalToSuperview().inset(20) make.bottom.equalToSuperview() } From fb4075d32dbf52e4be15f144c8283f736e2dc0e7 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 18:24:00 +0900 Subject: [PATCH 10/16] =?UTF-8?q?[Feat]=20#459=20-=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=A0=84=ED=99=98=20=ED=81=B4=EB=A1=9C=EC=A0=80=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HomeFeature/Interface/Sources/HomeForMemberPresentable.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeForMemberPresentable.swift b/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeForMemberPresentable.swift index dacb95d2..3d55e753 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeForMemberPresentable.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Interface/Sources/HomeForMemberPresentable.swift @@ -13,6 +13,7 @@ import Core public protocol HomeForMemberViewControllable: ViewControllable { } public protocol HomeForMemberCoordinatable { + var onDashBoardCellTapped: (() -> Void)? { get set } } public typealias HomeForMemberViewModelType = ViewModelType & HomeForMemberCoordinatable From 2e9f5fabf307c1f925356ab5543c71ac14a38b15 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 18:25:10 +0900 Subject: [PATCH 11/16] =?UTF-8?q?[Feat]=20#459=20-=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=A0=84=ED=99=98=EC=9D=84=20=EC=9C=84=ED=95=9C=20=EB=B7=B0=20?= =?UTF-8?q?=EB=B0=94=EC=9D=B8=EB=94=A9=20-=20cell=20=ED=81=B4=EB=A6=AD=20?= =?UTF-8?q?=EC=8B=9C=20indexPath=20=EC=A0=84=EB=8B=AC=ED=95=98=EC=97=AC=20?= =?UTF-8?q?section=EA=B3=BC=20item=20=EA=B0=92=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20viewModel=EC=97=90=EC=84=9C=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HomeScene/VC/HomeForMemberVC.swift | 18 +++++++++++++++++- .../ViewModel/HomeForMemberViewModel.swift | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift index df9a114d..ab200216 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift @@ -7,6 +7,7 @@ // import UIKit +import Combine import Core import Domain @@ -14,11 +15,13 @@ import DSKit import BaseFeatureDependency -final class HomeForMemberVC: UIViewController, HomeForMemberViewControllable { +final public class HomeForMemberVC: UIViewController, HomeForMemberViewControllable { // MARK: - Properties public let viewModel: HomeForMemberViewModel + private var cancelBag = CancelBag() + private var cellTapped = PassthroughSubject() // MARK: - UI Components @@ -54,6 +57,7 @@ final class HomeForMemberVC: UIViewController, HomeForMemberViewControllable { setLayout() setDelegate() registerCells() + bindViewModels() } } @@ -122,6 +126,14 @@ extension HomeForMemberVC { self.collectionView.register(SocialLinkCardCVC.self, forCellWithReuseIdentifier: SocialLinkCardCVC.className) } + + private func bindViewModels() { + let input = HomeForMemberViewModel.Input( + cellTapped: cellTapped.asDriver() + ) + + let output = self.viewModel.transform(from: input, cancelBag: self.cancelBag) + } } // MARK: - UICollectionViewDelegate @@ -133,6 +145,10 @@ extension HomeForMemberVC: UICollectionViewDelegate { // MARK: - UICollectionViewDataSource extension HomeForMemberVC: UICollectionViewDataSource { + public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + cellTapped.send(indexPath) + } + public func numberOfSections(in collectionView: UICollectionView) -> Int { return HomeForMemberSectionLayoutKind.allCases.count } diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift index 0b95fc7f..10869136 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift @@ -122,20 +122,35 @@ public class HomeForMemberViewModel: HomeForMemberViewModelType { // MARK: - Inputs - public struct Input { } + public struct Input { + let cellTapped: Driver + } // MARK: - Outputs public struct Output { } + // MARK: - HomeForeMemberCoordinating + + public var onDashBoardCellTapped: (() -> Void)? + + // MARK: - initialization public init() { } } extension HomeForMemberViewModel { - public func transform(from input: Input, cancelBag: Core.CancelBag) -> Output { + public func transform(from input: Input, cancelBag: CancelBag) -> Output { let output = Output() + + input.cellTapped + .filter{ $0.section == 0 } + .withUnretained(self) + .sink(receiveValue: { owner, indexPath in + self.onDashBoardCellTapped?() + }) + .store(in: cancelBag) return output } } From ab45eebc665ef6982de2bb4d4bff678f76eae25d Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 18:25:47 +0900 Subject: [PATCH 12/16] =?UTF-8?q?[Feat]=20#459=20-=20viewModel=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=ED=81=B4=EB=A1=9C=EC=A0=80=20=ED=98=B8=EC=B6=9C=20?= =?UTF-8?q?=EC=8B=9C=20=ED=99=94=EB=A9=B4=EC=A0=84=ED=99=98=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=8B=A4=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/HomeScene/Coordinator/HomeCoordinator.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Coordinator/HomeCoordinator.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Coordinator/HomeCoordinator.swift index daeb0d6a..721924f2 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Coordinator/HomeCoordinator.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Coordinator/HomeCoordinator.swift @@ -45,6 +45,11 @@ public final class HomeCoordinator: DefaultCoordinator { public func showHomeForMember() { var homeForMember = factory.makeHomeForMember() + + homeForMember.vm.onDashBoardCellTapped = { [weak self] in + let homeCalendarDetail = self?.factory.makeHomeCalendarDetail() + self?.router.push(homeCalendarDetail?.vc) + } router.replaceRootWindow(homeForMember.vc, withAnimation: true) } From ea8e3901eac744137d3fb6cb827af90c1f318c93 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 18:26:35 +0900 Subject: [PATCH 13/16] =?UTF-8?q?[Fix]=20#459=20-=20Soptlog=20navigationBa?= =?UTF-8?q?r=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20section=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=8B=9C=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Literals/StringLiterals.swift | 1 + .../SoptlogCompositinalLayout.swift | 40 ++----------------- .../Sources/SoptlogScene/VC/SoptlogVC.swift | 11 ++++- 3 files changed, 14 insertions(+), 38 deletions(-) diff --git a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift index 18f0aa63..fa868777 100644 --- a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift +++ b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift @@ -291,6 +291,7 @@ public struct I18N { } public struct Soptlog { + public static let navigationTitle = "솝트로그" public static let editProfile = "프로필 수정" public static let enrollIntroduce = "프로필 수정에서 한 줄 소개 등록해보세요!" } diff --git a/SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/CollectionView/SoptlogCompositinalLayout.swift b/SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/CollectionView/SoptlogCompositinalLayout.swift index 44874c6b..56e5dc57 100644 --- a/SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/CollectionView/SoptlogCompositinalLayout.swift +++ b/SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/CollectionView/SoptlogCompositinalLayout.swift @@ -54,15 +54,7 @@ extension SoptlogVC { subitems: [introduceItem]) /// section 지정 - let section = NSCollectionLayoutSection( - group: NSCollectionLayoutGroup.vertical( - layoutSize: NSCollectionLayoutSize( - widthDimension: .fractionalWidth(1.0), - heightDimension: .estimated(80) - ), - subitems: [introduceGroup] - ) - ) + let section = NSCollectionLayoutSection(group: introduceGroup) section.boundarySupplementaryItems = [header] section.contentInsets = NSDirectionalEdgeInsets(top: 16, leading: Metric.collectionViewDefaultSideInset, @@ -86,15 +78,7 @@ extension SoptlogVC { productGroup.interItemSpacing = .fixed(Metric.productItemSpacing) /// section 지정 - let section = NSCollectionLayoutSection( - group: NSCollectionLayoutGroup.vertical( - layoutSize: NSCollectionLayoutSize( - widthDimension: .fractionalWidth(1.0), - heightDimension: .estimated(126) - ), - subitems: [productGroup] - ) - ) + let section = NSCollectionLayoutSection(group: productGroup) let backgroundItem = NSCollectionLayoutDecorationItem.background( elementKind: AppServiceSectionBackgroundView.className) backgroundItem.contentInsets = NSDirectionalEdgeInsets(top: Metric.defaultGroupSpacing, @@ -123,15 +107,7 @@ extension SoptlogVC { subitems: [editProfileItem]) /// section 지정 - let section = NSCollectionLayoutSection( - group: NSCollectionLayoutGroup.vertical( - layoutSize: NSCollectionLayoutSize( - widthDimension: .fractionalWidth(1.0), - heightDimension: .estimated(36) - ), - subitems: [editProfileGroup] - ) - ) + let section = NSCollectionLayoutSection(group: editProfileGroup) section.contentInsets = NSDirectionalEdgeInsets(top: 20, leading: Metric.collectionViewDefaultSideInset, bottom: 0, @@ -153,15 +129,7 @@ extension SoptlogVC { subitems: [alarmItem]) /// section 지정 - let section = NSCollectionLayoutSection( - group: NSCollectionLayoutGroup.vertical( - layoutSize: NSCollectionLayoutSize( - widthDimension: .fractionalWidth(1.0), - heightDimension: .estimated(295) - ), - subitems: [alarmGroup] - ) - ) + let section = NSCollectionLayoutSection(group: alarmGroup) section.contentInsets = NSDirectionalEdgeInsets(top: 40, leading: 0, bottom: 0, diff --git a/SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/VC/SoptlogVC.swift b/SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/VC/SoptlogVC.swift index 455653fc..a2f24e0b 100644 --- a/SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/VC/SoptlogVC.swift +++ b/SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/VC/SoptlogVC.swift @@ -22,6 +22,9 @@ final class SoptlogVC: UIViewController, SoptlogViewControllable { // MARK: - UI Components + private lazy var naviBar = OPNavigationBar(self, type: .oneLeftButton) + .addMiddleLabel(title: I18N.Soptlog.navigationTitle, font: DSKitFontFamily.Suit.medium.font(size: 16)) + private lazy var collectionView = UICollectionView(frame: .zero, collectionViewLayout: self.createLayout()).then { $0.isScrollEnabled = true $0.showsHorizontalScrollIndicator = false @@ -61,10 +64,14 @@ extension SoptlogVC { } private func setLayout() { - view.addSubviews(collectionView) + view.addSubviews(naviBar, collectionView) + + naviBar.snp.makeConstraints { make in + make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + } collectionView.snp.makeConstraints { make in - make.top.equalTo(view.safeAreaLayoutGuide).offset(16) + make.top.equalTo(naviBar.snp.bottom).offset(16) make.leading.trailing.bottom.equalTo(view.safeAreaLayoutGuide) } } From d9cdb51b00ac5532f1b514154600353e720e641d Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 18:29:18 +0900 Subject: [PATCH 14/16] =?UTF-8?q?[Fix]=20#459=20-=20public=20=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=EC=A0=9C=ED=95=9C=EC=9E=90=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/HomeScene/VC/HomeForMemberVC.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift index ab200216..2a3a4635 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift @@ -15,7 +15,7 @@ import DSKit import BaseFeatureDependency -final public class HomeForMemberVC: UIViewController, HomeForMemberViewControllable { +final class HomeForMemberVC: UIViewController, HomeForMemberViewControllable { // MARK: - Properties @@ -145,15 +145,15 @@ extension HomeForMemberVC: UICollectionViewDelegate { // MARK: - UICollectionViewDataSource extension HomeForMemberVC: UICollectionViewDataSource { - public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { cellTapped.send(indexPath) } - public func numberOfSections(in collectionView: UICollectionView) -> Int { + func numberOfSections(in collectionView: UICollectionView) -> Int { return HomeForMemberSectionLayoutKind.allCases.count } - public func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { + func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { guard let sectionKind = HomeForMemberSectionLayoutKind(rawValue: indexPath.section) else { return UICollectionReusableView() } /// Header View @@ -193,7 +193,7 @@ extension HomeForMemberVC: UICollectionViewDataSource { return UICollectionReusableView() } - public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { guard let sectionKind = HomeForMemberSectionLayoutKind(rawValue: section) else { return 0 } switch sectionKind { @@ -209,7 +209,7 @@ extension HomeForMemberVC: UICollectionViewDataSource { } } - public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let sectionKind = HomeForMemberSectionLayoutKind(rawValue: indexPath.section) else { return UICollectionViewCell() } switch sectionKind { From 9c823f96d4d2388f779c97f92d1f0b3fd7fea960 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Mon, 16 Dec 2024 18:29:41 +0900 Subject: [PATCH 15/16] =?UTF-8?q?[Feat]=20#459=20-=20runHomeFlow()=20?= =?UTF-8?q?=EB=A9=94=EC=86=8C=EB=93=9C=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/ApplicationCoordinator.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift b/SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift index 7e39e4aa..ac5bc33c 100644 --- a/SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift +++ b/SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift @@ -13,6 +13,7 @@ import BaseFeatureDependency import SplashFeature import AuthFeature import MainFeature +import HomeFeature import AppMyPageFeature import NotificationFeature import StampFeature @@ -196,6 +197,19 @@ extension ApplicationCoordinator { coordinator.start() } + internal func runHomeFlow(type: UserType) { + let coordinator = HomeCoordinator( + router: router, + factory: HomeBuilder(), + userType: type + ) + coordinator.finishFlow = { [weak self, weak coordinator] in + self?.removeDependency(coordinator) + } + addDependency(coordinator) + coordinator.start() + } + @discardableResult internal func runAttendanceFlow() -> AttendanceCoordinator { let coordinator = AttendanceCoordinator( From 5929e2827467120576f8bb60811f62f4aae3b7aa Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Sun, 19 Jan 2025 01:31:11 +0900 Subject: [PATCH 16/16] =?UTF-8?q?[Fix]=20#459=20-=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81(MainActor=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VC/HomeCalendarDetailVC.swift | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift index 4aeb7a59..47335798 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/CalendarDetailScene/VC/HomeCalendarDetailVC.swift @@ -39,7 +39,7 @@ final class HomeCalendarDetailVC: UIViewController, HomeCalendarDetailViewContro .changeCornerRadius(radius: 12) .setConfigForState(enabledFont: DSKitFontFamily.Suit.semiBold.font(size: 18)) - private let gradationView = UIView().then { + private let gradientView = UIView().then { let gradientLayer = CAGradientLayer() gradientLayer.colors = [DSKitAsset.Colors.black.color.withAlphaComponent(0.0).cgColor, DSKitAsset.Colors.black.color.cgColor] gradientLayer.startPoint = CGPoint(x: 0.5, y: 0) @@ -73,8 +73,8 @@ final class HomeCalendarDetailVC: UIViewController, HomeCalendarDetailViewContro override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() - if let gradientLayer = gradationView.layer.sublayers?.first as? CAGradientLayer { - gradientLayer.frame = gradationView.bounds + if let gradientLayer = gradientView.layer.sublayers?.first as? CAGradientLayer { + gradientLayer.frame = gradientView.bounds } scrollToRecentSchedule() @@ -90,11 +90,10 @@ extension HomeCalendarDetailVC { } private func setLayout() { - view.addSubviews(naviBar, collectionView, gradationView, attendanceButton) + view.addSubviews(naviBar, collectionView, gradientView, attendanceButton) naviBar.snp.makeConstraints { make in make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - } collectionView.snp.makeConstraints { make in @@ -103,7 +102,7 @@ extension HomeCalendarDetailVC { make.bottom.equalToSuperview() } - gradationView.snp.makeConstraints { make in + gradientView.snp.makeConstraints { make in make.leading.trailing.bottom.equalToSuperview() make.height.equalTo(209.adjustedH) } @@ -128,7 +127,6 @@ extension HomeCalendarDetailVC { collectionView.register(HomeCalendarDetailCVC.self, forCellWithReuseIdentifier: HomeCalendarDetailCVC.className) } - @MainActor private func scrollToRecentSchedule() { if let index = self.viewModel.calendarDetailList.firstIndex(where: {$0.isRecentSchedule}) { self.collectionView.scrollToItem(at: IndexPath(item: index, section: 0),