diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS.xcodeproj/project.pbxproj b/SOPKATHON_33-iOS/SOPKATHON_33-iOS.xcodeproj/project.pbxproj index 5aa5d61..6c13f3c 100644 --- a/SOPKATHON_33-iOS/SOPKATHON_33-iOS.xcodeproj/project.pbxproj +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS.xcodeproj/project.pbxproj @@ -10,6 +10,11 @@ 0003BFBC2B1247EF00C29757 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0003BFBB2B1247EF00C29757 /* DetailViewController.swift */; }; 0083D6FC2B127C030084766E /* UIColor+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0083D6FB2B127C030084766E /* UIColor+.swift */; }; 0083D6FE2B1280C30084766E /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0083D6FD2B1280C30084766E /* Image.swift */; }; + 0083D7002B12A0150084766E /* SupportViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0083D6FF2B12A0150084766E /* SupportViewController.swift */; }; + 0083D7022B12A2280084766E /* SupportView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0083D7012B12A2280084766E /* SupportView.swift */; }; + 0083D7042B12A3450084766E /* SupportTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0083D7032B12A3450084766E /* SupportTopView.swift */; }; + 0083D7062B12A38B0084766E /* SupportCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0083D7052B12A38B0084766E /* SupportCollectionView.swift */; }; + 0083D7082B12A3BD0084766E /* SupportCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0083D7072B12A3BD0084766E /* SupportCollectionViewCell.swift */; }; 00B6F46D2B1224F3008F7396 /* Tabman in Frameworks */ = {isa = PBXBuildFile; productRef = 00B6F46C2B1224F3008F7396 /* Tabman */; }; A13161452B12749800883CB2 /* UserInfoChipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A13161442B12749800883CB2 /* UserInfoChipView.swift */; }; A19A1F522B12451B0077ACEC /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A19A1F512B12451B0077ACEC /* MainViewController.swift */; }; @@ -84,6 +89,11 @@ 0003BFBB2B1247EF00C29757 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; 0083D6FB2B127C030084766E /* UIColor+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+.swift"; sourceTree = ""; }; 0083D6FD2B1280C30084766E /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = ""; }; + 0083D6FF2B12A0150084766E /* SupportViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportViewController.swift; sourceTree = ""; }; + 0083D7012B12A2280084766E /* SupportView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportView.swift; sourceTree = ""; }; + 0083D7032B12A3450084766E /* SupportTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportTopView.swift; sourceTree = ""; }; + 0083D7052B12A38B0084766E /* SupportCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportCollectionView.swift; sourceTree = ""; }; + 0083D7072B12A3BD0084766E /* SupportCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportCollectionViewCell.swift; sourceTree = ""; }; A13161442B12749800883CB2 /* UserInfoChipView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserInfoChipView.swift; sourceTree = ""; }; A19A1F512B12451B0077ACEC /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; A19A1F542B1245330077ACEC /* IdCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdCardView.swift; sourceTree = ""; }; @@ -265,6 +275,7 @@ isa = PBXGroup; children = ( D26AFFD72B1254AA007B90DF /* AssitantView */, + 0083D7012B12A2280084766E /* SupportView.swift */, D26AFFD52B125479007B90DF /* ProgramView.swift */, ); path = View; @@ -274,6 +285,7 @@ isa = PBXGroup; children = ( D26AFFD32B12546F007B90DF /* ProgramViewController.swift */, + 0083D6FF2B12A0150084766E /* SupportViewController.swift */, ); path = ViewController; sourceTree = ""; @@ -282,6 +294,7 @@ isa = PBXGroup; children = ( D26AFFDC2B125AF8007B90DF /* ProgramCollectionViewCell.swift */, + 0083D7072B12A3BD0084766E /* SupportCollectionViewCell.swift */, ); path = Cell; sourceTree = ""; @@ -290,7 +303,9 @@ isa = PBXGroup; children = ( D26AFFD82B1254BC007B90DF /* ProgramTopView.swift */, + 0083D7032B12A3450084766E /* SupportTopView.swift */, D26AFFDA2B125825007B90DF /* ProgramCollectionView.swift */, + 0083D7052B12A38B0084766E /* SupportCollectionView.swift */, ); path = AssitantView; sourceTree = ""; @@ -591,10 +606,13 @@ buildActionMask = 2147483647; files = ( D28379C12B0FBC1D00A1903B /* UIImageView+.swift in Sources */, + 0083D7002B12A0150084766E /* SupportViewController.swift in Sources */, A19A1F552B1245330077ACEC /* IdCardView.swift in Sources */, D28379B92B0FBBEA00A1903B /* UIApplication+.swift in Sources */, D28379E22B0FC04C00A1903B /* VoidResult.swift in Sources */, D28379D72B0FBDDC00A1903B /* MoyaLoggerPlugin.swift in Sources */, + 0083D7042B12A3450084766E /* SupportTopView.swift in Sources */, + 0083D7022B12A2280084766E /* SupportView.swift in Sources */, A19A1F5B2B1255CF0077ACEC /* ActivityStackView.swift in Sources */, D28379E42B0FC06C00A1903B /* SimpleResponse.swift in Sources */, D26AFFDD2B125AF8007B90DF /* ProgramCollectionViewCell.swift in Sources */, @@ -604,6 +622,7 @@ D28379BB2B0FBBF500A1903B /* UIButton+.swift in Sources */, D26AFFEC2B127B0F007B90DF /* BaseViewController.swift in Sources */, D26AFFEA2B12767B007B90DF /* MoyaAPI.swift in Sources */, + 0083D7082B12A3BD0084766E /* SupportCollectionViewCell.swift in Sources */, D28379D92B0FBE5C00A1903B /* NetworkResult.swift in Sources */, A19A1F522B12451B0077ACEC /* MainViewController.swift in Sources */, D26AFFF22B129A8F007B90DF /* ProgramModel.swift in Sources */, @@ -632,6 +651,7 @@ D26AFFD62B125479007B90DF /* ProgramView.swift in Sources */, D206CAD82B0FB748007ECC1B /* AppDelegate.swift in Sources */, D26AFFD92B1254BC007B90DF /* ProgramTopView.swift in Sources */, + 0083D7062B12A38B0084766E /* SupportCollectionView.swift in Sources */, D28379E62B0FC08200A1903B /* GenericResponse.swift in Sources */, D28379DB2B0FBE7500A1903B /* BaseTargetType.swift in Sources */, D28379DF2B0FBFFC00A1903B /* Adjusted+.swift in Sources */, diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/Cell/ProgramCollectionViewCell.swift b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/Cell/ProgramCollectionViewCell.swift index 03a044a..98e249c 100644 --- a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/Cell/ProgramCollectionViewCell.swift +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/Cell/ProgramCollectionViewCell.swift @@ -47,7 +47,7 @@ final class ProgramCollectionViewCell: UICollectionViewCell { } backgroundImageView.do { - $0.contentMode = .scaleAspectFit + $0.contentMode = .scaleAspectFill $0.image = Image.dummy1 } diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/Cell/SupportCollectionViewCell.swift b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/Cell/SupportCollectionViewCell.swift new file mode 100644 index 0000000..49da4fd --- /dev/null +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/Cell/SupportCollectionViewCell.swift @@ -0,0 +1,107 @@ +// +// SupportCollectionViewCell.swift +// SOPKATHON_33-iOS +// +// Created by 티모시 킴 on 11/26/23. +// + +import UIKit + +import SnapKit +import Then + +final class SupportCollectionViewCell: UICollectionViewCell { + + // MARK: - UI Components + + private let backgroundImageView = UIImageView() + private let titleLabel = UILabel() + private let areaLabel = UILabel() + private let updateLabel = UILabel() + + // MARK: - Life Cycle + + override init(frame: CGRect) { + super.init(frame: frame) + + style() + hieararchy() + layout() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Custom Method + + private func style() { + contentView.do { + $0.backgroundColor = .gray700 + $0.makeCornerRound(ratio: 10) + } + + backgroundImageView.do { + $0.contentMode = .scaleAspectFill + $0.image = Image.dummy1 + } + + titleLabel.do { + $0.text = "프로그램 명을 입력해주세요." + $0.font = UIFont(name: "Pretendard-SemiBold", size: 14) + $0.textColor = .white + $0.textAlignment = .left + $0.numberOfLines = 0 + } + + areaLabel.do { + $0.text = "솝트광역시" + $0.font = UIFont(name: "Pretendard-regular", size: 12) + $0.textColor = .gray400 + $0.textAlignment = .left + } + updateLabel.do { + $0.text = "00.00" + $0.font = UIFont(name: "Pretendard-regular", size: 12) + $0.textColor = .gray400 + $0.textAlignment = .left + } + + } + + private func hieararchy() { + contentView.addSubviews( + backgroundImageView, + titleLabel, + areaLabel, + updateLabel + ) + } + + private func layout() { + backgroundImageView.snp.makeConstraints { + $0.top.leading.trailing.equalToSuperview() + $0.height.equalTo(115) + } + + titleLabel.snp.makeConstraints { + $0.top.equalToSuperview().offset(130.adjusted) + $0.leading.trailing.equalToSuperview().inset(12.adjusted) + } + + areaLabel.snp.makeConstraints { + $0.top.equalTo(titleLabel.snp.bottom).offset(10.adjusted) + $0.leading.equalTo(titleLabel) + } + + updateLabel.snp.makeConstraints { + $0.leading.equalTo(areaLabel.snp.trailing).offset(10.adjusted) + $0.top.equalTo(areaLabel) + } + } + + func dataBind() { + } +} + + diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/AssitantView/SupportCollectionView.swift b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/AssitantView/SupportCollectionView.swift new file mode 100644 index 0000000..2f644f5 --- /dev/null +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/AssitantView/SupportCollectionView.swift @@ -0,0 +1,53 @@ +// +// SupportCollectionView.swift +// SOPKATHON_33-iOS +// +// Created by 티모시 킴 on 11/26/23. +// + +import UIKit + +import SnapKit +import Then + +final class SupportCollectionView: UICollectionView { + + // MARK: - Life Cycle + + override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) { + super.init(frame: .zero, collectionViewLayout: .init()) + + register() + style() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Custom Method + + private func register() { + self.register( + SupportCollectionViewCell.self, + forCellWithReuseIdentifier: SupportCollectionViewCell.cellIdentifier + ) + } + + private func style() { + self.do { + let layout = UICollectionViewFlowLayout() + layout.scrollDirection = .vertical + layout.minimumLineSpacing = 17 + layout.minimumInteritemSpacing = 17 + + $0.collectionViewLayout = layout + $0.showsHorizontalScrollIndicator = false + } + } +} + + + + + diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/AssitantView/SupportTopView.swift b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/AssitantView/SupportTopView.swift new file mode 100644 index 0000000..2778cbd --- /dev/null +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/AssitantView/SupportTopView.swift @@ -0,0 +1,75 @@ +// +// SupportTopView.swift +// SOPKATHON_33-iOS +// +// Created by 티모시 킴 on 11/26/23. +// + +import UIKit + +import SnapKit +import Then + +final class SupportTopView: UIView { + + // MARK: - Properties + + lazy var backButton = UIButton() + let supportLabel = UILabel() + + // MARK: - UI Components + + // MARK: - Life Cycle + + override init(frame: CGRect) { + super.init(frame: frame) + + style() + hieararchy() + layout() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Custom Method + + private func style() { + backButton.do { + $0.setImage(UIImage(systemName: "chevron.backward"), for: .normal) + $0.tintColor = .white + } + + supportLabel.do { + $0.font = UIFont(name: "Pretendard-SemiBold", size: 18) + $0.text = "지원 현황" + $0.textColor = .white + } + } + + private func hieararchy() { + self.addSubviews( + backButton, supportLabel + ) + } + + private func layout() { + backButton.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.equalToSuperview().offset(30) + $0.size.equalTo(24) + } + + supportLabel.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalTo(backButton.snp.trailing).offset(10) + } + } +} + + + + + + diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/SupportView.swift b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/SupportView.swift new file mode 100644 index 0000000..ba8d88b --- /dev/null +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/View/SupportView.swift @@ -0,0 +1,73 @@ +// +// SupportView.swift +// SOPKATHON_33-iOS +// +// Created by 티모시 킴 on 11/26/23. +// + +import UIKit + +import SnapKit +import Then + +final class SupportView: UIView { + + // MARK: - Properties + + let supportTopView = SupportTopView() + let supportCollectionView = SupportCollectionView() + + + // MARK: - UI Components + + // MARK: - Life Cycle + + override init(frame: CGRect) { + super.init(frame: frame) + + style() + hieararchy() + layout() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Custom Method + + private func style() { + self.backgroundColor = .gray800 + + supportCollectionView.do { + $0.backgroundColor = .gray800 + } + } + + private func hieararchy() { + self.addSubviews( + supportTopView, + supportCollectionView + ) + } + + private func layout() { + supportTopView.snp.makeConstraints { + $0.top.equalTo(safeAreaLayoutGuide).offset(25) + $0.width.equalToSuperview() + $0.height.equalTo(24) + } + + supportCollectionView.snp.makeConstraints { + $0.top.equalTo(supportTopView.snp.bottom).offset(26) + $0.leading.trailing.equalToSuperview().inset(20) + $0.bottom.equalToSuperview() + } + } +} + + + + + + diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/ViewController/ProgramViewController.swift b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/ViewController/ProgramViewController.swift index 2a49eb0..e071a52 100644 --- a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/ViewController/ProgramViewController.swift +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/ViewController/ProgramViewController.swift @@ -60,7 +60,8 @@ final class ProgramViewController: BaseViewController { rootView.programTopView.employmentButton.setTitleColor(.white, for: .normal) } @objc func statusSupportButtonDidTap() { - print(#function) + let supportViewController = SupportViewController() + self.navigationController?.pushViewController(supportViewController, animated: true) } private func requestProgramAPI(type: String) { diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/ViewController/SupportViewController.swift b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/ViewController/SupportViewController.swift new file mode 100644 index 0000000..d9b88c0 --- /dev/null +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Program/ViewController/SupportViewController.swift @@ -0,0 +1,69 @@ +// +// SupportViewController.swift +// SOPKATHON_33-iOS +// +// Created by 티모시 킴 on 11/26/23. +// + +import UIKit + +import SnapKit +import Then + +final class SupportViewController: UIViewController { + + //MARK: - UI Components + + private let rootView = SupportView() + + //MARK: - Life Cycle + + override func loadView() { + self.view = rootView + } + + override func viewDidLoad() { + super.viewDidLoad() + + target() + delegate() + } + + private func target() { + rootView.supportTopView.backButton.addTarget(self, action: #selector(backButtonDidTap), for: .touchUpInside) + } + private func delegate() { + rootView.supportCollectionView.delegate = self + rootView.supportCollectionView.dataSource = self + } + + //MARK: - Action Method + + @objc func backButtonDidTap() { + navigationController?.popViewController(animated: true) + } + +} + + +extension SupportViewController: UICollectionViewDelegateFlowLayout { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return CGSize( + width: CGFloat((Device.width - 57) / 2), + height: 209 + ) + } +} + +extension SupportViewController: UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return 20 + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: SupportCollectionViewCell.cellIdentifier, for: indexPath) as! SupportCollectionViewCell + return cell + } + + +} diff --git a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Splash/SplashView.swift b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Splash/SplashView.swift index f8dd8be..cefbcae 100644 --- a/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Splash/SplashView.swift +++ b/SOPKATHON_33-iOS/SOPKATHON_33-iOS/Presentation/Splash/SplashView.swift @@ -18,7 +18,7 @@ class SplashView: UIViewController { view.backgroundColor = .black setLayout() DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { - self.present(TabBarController(), animated: false) + self.navigationController?.pushViewController(TabBarController(), animated: false) } }