From e8808f2f4b3d743654513db5f504f87dbe3bb6ab Mon Sep 17 00:00:00 2001 From: Kim Minjae Date: Tue, 5 Jul 2022 21:13:58 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT]=20:=20Home=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20=EC=97=B0=EC=8A=B5=20#4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HousLab_iOS.xcodeproj/project.pbxproj | 116 +++++- .../xcshareddata/swiftpm/Package.resolved | 60 ++-- .../Cells/EventsCollectionViewCell.swift | 68 ++++ .../Cells/ProfileCollectionViewCell.swift | 92 +++++ .../MinJae/HomeViewController.swift | 334 ++++++++++++++++++ .../MinJae/MinJaeViewController.swift | 8 - .../MinJae/Model/EventsDataModel.swift | 29 ++ .../MinJae/Model/ProfileDataModel.swift | 23 ++ .../MinJae/Model/RulesDataModel.swift | 23 ++ .../MinJae/Model/TodoDataModels.swift | 24 ++ .../HousLab_iOS/MinJae/RulesTodosView.swift | 66 ++++ .../HousLab_iOS/Supports/SceneDelegate.swift | 2 +- 12 files changed, 801 insertions(+), 44 deletions(-) create mode 100644 HousLab_iOS/HousLab_iOS/MinJae/Cells/EventsCollectionViewCell.swift create mode 100644 HousLab_iOS/HousLab_iOS/MinJae/Cells/ProfileCollectionViewCell.swift create mode 100644 HousLab_iOS/HousLab_iOS/MinJae/HomeViewController.swift delete mode 100644 HousLab_iOS/HousLab_iOS/MinJae/MinJaeViewController.swift create mode 100644 HousLab_iOS/HousLab_iOS/MinJae/Model/EventsDataModel.swift create mode 100644 HousLab_iOS/HousLab_iOS/MinJae/Model/ProfileDataModel.swift create mode 100644 HousLab_iOS/HousLab_iOS/MinJae/Model/RulesDataModel.swift create mode 100644 HousLab_iOS/HousLab_iOS/MinJae/Model/TodoDataModels.swift create mode 100644 HousLab_iOS/HousLab_iOS/MinJae/RulesTodosView.swift diff --git a/HousLab_iOS/HousLab_iOS.xcodeproj/project.pbxproj b/HousLab_iOS/HousLab_iOS.xcodeproj/project.pbxproj index cbb3dff..6995d09 100644 --- a/HousLab_iOS/HousLab_iOS.xcodeproj/project.pbxproj +++ b/HousLab_iOS/HousLab_iOS.xcodeproj/project.pbxproj @@ -8,8 +8,30 @@ /* Begin PBXBuildFile section */ 7713C62B2872F26C00F674BF /* Inject in Frameworks */ = {isa = PBXBuildFile; productRef = 7713C62A2872F26C00F674BF /* Inject */; }; + B59C9451287423BD005865CA /* RulesDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59C9450287423BD005865CA /* RulesDataModel.swift */; }; + B59C945328742440005865CA /* TodoDataModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59C945228742440005865CA /* TodoDataModels.swift */; }; + B59C94552874274F005865CA /* RulesTodosView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59C94542874274F005865CA /* RulesTodosView.swift */; }; + B59C945928744DAE005865CA /* ProfileDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59C945828744DAE005865CA /* ProfileDataModel.swift */; }; + B59C945B28744ED5005865CA /* ProfileCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59C945A28744ED5005865CA /* ProfileCollectionViewCell.swift */; }; B5B5C11D2872E3DB00FC5134 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = B5B5C11C2872E3DB00FC5134 /* SnapKit */; }; B5B5C1202872E43E00FC5134 /* Then in Frameworks */ = {isa = PBXBuildFile; productRef = B5B5C11F2872E43E00FC5134 /* Then */; }; + B5B5C1222872E63C00FC5134 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1212872E63C00FC5134 /* HomeViewController.swift */; }; + B5B5C1252872E7A000FC5134 /* UIFont+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1242872E7A000FC5134 /* UIFont+Extension.swift */; }; + B5B5C1272872E7BC00FC5134 /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1262872E7BC00FC5134 /* UIColor+Extension.swift */; }; + B5B5C1292872E7FC00FC5134 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1282872E7FC00FC5134 /* UIView+Extension.swift */; }; + B5B5C12B2872E81F00FC5134 /* UITextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C12A2872E81F00FC5134 /* UITextField+Extension.swift */; }; + B5B5C12D2872E83C00FC5134 /* UILabel+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C12C2872E83C00FC5134 /* UILabel+Extension.swift */; }; + B5B5C12F2872E85200FC5134 /* UIButton+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C12E2872E85200FC5134 /* UIButton+Extension.swift */; }; + B5B5C1312872E86600FC5134 /* UIViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1302872E86600FC5134 /* UIViewController+Extension.swift */; }; + B5B5C1332872E87900FC5134 /* Adjusted+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1322872E87900FC5134 /* Adjusted+Extension.swift */; }; + B5B5C1352872E89F00FC5134 /* NSObject+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1342872E89F00FC5134 /* NSObject+Extension.swift */; }; + B5B5C1372872E8BD00FC5134 /* UITableView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1362872E8BD00FC5134 /* UITableView+Extension.swift */; }; + B5B5C1392872E8FA00FC5134 /* UICollectionView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1382872E8FA00FC5134 /* UICollectionView+Extension.swift */; }; + B5B5C13B2872E91E00FC5134 /* UIStackView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C13A2872E91E00FC5134 /* UIStackView+Extension.swift */; }; + B5B5C13D2872E94B00FC5134 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C13C2872E94B00FC5134 /* String+Extension.swift */; }; + B5B5C13F2872E95C00FC5134 /* Date+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C13E2872E95C00FC5134 /* Date+Extension.swift */; }; + B5B5C1422872F3C300FC5134 /* EventsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1412872F3C300FC5134 /* EventsCollectionViewCell.swift */; }; + B5B5C1452872F3CE00FC5134 /* EventsDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5B5C1442872F3CE00FC5134 /* EventsDataModel.swift */; }; B85302A628728F6300F06234 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85302A528728F6300F06234 /* AppDelegate.swift */; }; B85302A828728F6300F06234 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85302A728728F6300F06234 /* SceneDelegate.swift */; }; B85302AA28728F6300F06234 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85302A928728F6300F06234 /* ViewController.swift */; }; @@ -17,11 +39,32 @@ B85302B228728F6400F06234 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B85302B028728F6400F06234 /* LaunchScreen.storyboard */; }; B85302C12872A1EC00F06234 /* HoseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85302C02872A1EC00F06234 /* HoseViewController.swift */; }; B85302C32872A1F900F06234 /* EuiJinViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85302C22872A1F900F06234 /* EuiJinViewController.swift */; }; - B85302C52872A1FF00F06234 /* MinJaeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85302C42872A1FF00F06234 /* MinJaeViewController.swift */; }; B85302C72872A20600F06234 /* JiHyeonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85302C62872A20600F06234 /* JiHyeonViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + B59C9450287423BD005865CA /* RulesDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RulesDataModel.swift; sourceTree = ""; }; + B59C945228742440005865CA /* TodoDataModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoDataModels.swift; sourceTree = ""; }; + B59C94542874274F005865CA /* RulesTodosView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RulesTodosView.swift; sourceTree = ""; }; + B59C945828744DAE005865CA /* ProfileDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileDataModel.swift; sourceTree = ""; }; + B59C945A28744ED5005865CA /* ProfileCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileCollectionViewCell.swift; sourceTree = ""; }; + B5B5C1212872E63C00FC5134 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; + B5B5C1242872E7A000FC5134 /* UIFont+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+Extension.swift"; sourceTree = ""; }; + B5B5C1262872E7BC00FC5134 /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = ""; }; + B5B5C1282872E7FC00FC5134 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; + B5B5C12A2872E81F00FC5134 /* UITextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Extension.swift"; sourceTree = ""; }; + B5B5C12C2872E83C00FC5134 /* UILabel+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+Extension.swift"; sourceTree = ""; }; + B5B5C12E2872E85200FC5134 /* UIButton+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+Extension.swift"; sourceTree = ""; }; + B5B5C1302872E86600FC5134 /* UIViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extension.swift"; sourceTree = ""; }; + B5B5C1322872E87900FC5134 /* Adjusted+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Adjusted+Extension.swift"; sourceTree = ""; }; + B5B5C1342872E89F00FC5134 /* NSObject+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSObject+Extension.swift"; sourceTree = ""; }; + B5B5C1362872E8BD00FC5134 /* UITableView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableView+Extension.swift"; sourceTree = ""; }; + B5B5C1382872E8FA00FC5134 /* UICollectionView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Extension.swift"; sourceTree = ""; }; + B5B5C13A2872E91E00FC5134 /* UIStackView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackView+Extension.swift"; sourceTree = ""; }; + B5B5C13C2872E94B00FC5134 /* String+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = ""; }; + B5B5C13E2872E95C00FC5134 /* Date+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+Extension.swift"; sourceTree = ""; }; + B5B5C1412872F3C300FC5134 /* EventsCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventsCollectionViewCell.swift; sourceTree = ""; }; + B5B5C1442872F3CE00FC5134 /* EventsDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventsDataModel.swift; sourceTree = ""; }; B85302A228728F6300F06234 /* HousLab_iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HousLab_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; B85302A528728F6300F06234 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; B85302A728728F6300F06234 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -31,7 +74,6 @@ B85302B328728F6400F06234 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B85302C02872A1EC00F06234 /* HoseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HoseViewController.swift; sourceTree = ""; }; B85302C22872A1F900F06234 /* EuiJinViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EuiJinViewController.swift; sourceTree = ""; }; - B85302C42872A1FF00F06234 /* MinJaeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MinJaeViewController.swift; sourceTree = ""; }; B85302C62872A20600F06234 /* JiHyeonViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JiHyeonViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -49,6 +91,47 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + B5B5C1232872E75D00FC5134 /* Extensions */ = { + isa = PBXGroup; + children = ( + B5B5C1242872E7A000FC5134 /* UIFont+Extension.swift */, + B5B5C1262872E7BC00FC5134 /* UIColor+Extension.swift */, + B5B5C1282872E7FC00FC5134 /* UIView+Extension.swift */, + B5B5C12A2872E81F00FC5134 /* UITextField+Extension.swift */, + B5B5C12C2872E83C00FC5134 /* UILabel+Extension.swift */, + B5B5C12E2872E85200FC5134 /* UIButton+Extension.swift */, + B5B5C1302872E86600FC5134 /* UIViewController+Extension.swift */, + B5B5C1322872E87900FC5134 /* Adjusted+Extension.swift */, + B5B5C1342872E89F00FC5134 /* NSObject+Extension.swift */, + B5B5C1362872E8BD00FC5134 /* UITableView+Extension.swift */, + B5B5C1382872E8FA00FC5134 /* UICollectionView+Extension.swift */, + B5B5C13A2872E91E00FC5134 /* UIStackView+Extension.swift */, + B5B5C13C2872E94B00FC5134 /* String+Extension.swift */, + B5B5C13E2872E95C00FC5134 /* Date+Extension.swift */, + ); + path = Extensions; + sourceTree = ""; + }; + B5B5C1402872F3AB00FC5134 /* Cells */ = { + isa = PBXGroup; + children = ( + B5B5C1412872F3C300FC5134 /* EventsCollectionViewCell.swift */, + B59C945A28744ED5005865CA /* ProfileCollectionViewCell.swift */, + ); + path = Cells; + sourceTree = ""; + }; + B5B5C1432872F3C700FC5134 /* Model */ = { + isa = PBXGroup; + children = ( + B5B5C1442872F3CE00FC5134 /* EventsDataModel.swift */, + B59C9450287423BD005865CA /* RulesDataModel.swift */, + B59C945228742440005865CA /* TodoDataModels.swift */, + B59C945828744DAE005865CA /* ProfileDataModel.swift */, + ); + path = Model; + sourceTree = ""; + }; B853029928728F6300F06234 = { isa = PBXGroup; children = ( @@ -90,7 +173,11 @@ B85302BA28728F8100F06234 /* MinJae */ = { isa = PBXGroup; children = ( - B85302C42872A1FF00F06234 /* MinJaeViewController.swift */, + B5B5C1432872F3C700FC5134 /* Model */, + B5B5C1402872F3AB00FC5134 /* Cells */, + B5B5C1232872E75D00FC5134 /* Extensions */, + B5B5C1212872E63C00FC5134 /* HomeViewController.swift */, + B59C94542874274F005865CA /* RulesTodosView.swift */, ); path = MinJae; sourceTree = ""; @@ -218,12 +305,33 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B85302C52872A1FF00F06234 /* MinJaeViewController.swift in Sources */, + B59C945928744DAE005865CA /* ProfileDataModel.swift in Sources */, + B5B5C1392872E8FA00FC5134 /* UICollectionView+Extension.swift in Sources */, + B59C945328742440005865CA /* TodoDataModels.swift in Sources */, B85302AA28728F6300F06234 /* ViewController.swift in Sources */, B85302C72872A20600F06234 /* JiHyeonViewController.swift in Sources */, + B5B5C12F2872E85200FC5134 /* UIButton+Extension.swift in Sources */, + B5B5C1352872E89F00FC5134 /* NSObject+Extension.swift in Sources */, B85302C12872A1EC00F06234 /* HoseViewController.swift in Sources */, + B5B5C13B2872E91E00FC5134 /* UIStackView+Extension.swift in Sources */, + B5B5C1312872E86600FC5134 /* UIViewController+Extension.swift in Sources */, + B59C945B28744ED5005865CA /* ProfileCollectionViewCell.swift in Sources */, + B5B5C13D2872E94B00FC5134 /* String+Extension.swift in Sources */, + B5B5C1372872E8BD00FC5134 /* UITableView+Extension.swift in Sources */, + B5B5C1272872E7BC00FC5134 /* UIColor+Extension.swift in Sources */, + B59C94552874274F005865CA /* RulesTodosView.swift in Sources */, + B5B5C13F2872E95C00FC5134 /* Date+Extension.swift in Sources */, B85302A628728F6300F06234 /* AppDelegate.swift in Sources */, + B5B5C1332872E87900FC5134 /* Adjusted+Extension.swift in Sources */, B85302C32872A1F900F06234 /* EuiJinViewController.swift in Sources */, + B5B5C12B2872E81F00FC5134 /* UITextField+Extension.swift in Sources */, + B5B5C1222872E63C00FC5134 /* HomeViewController.swift in Sources */, + B5B5C1452872F3CE00FC5134 /* EventsDataModel.swift in Sources */, + B5B5C12D2872E83C00FC5134 /* UILabel+Extension.swift in Sources */, + B5B5C1252872E7A000FC5134 /* UIFont+Extension.swift in Sources */, + B5B5C1422872F3C300FC5134 /* EventsCollectionViewCell.swift in Sources */, + B59C9451287423BD005865CA /* RulesDataModel.swift in Sources */, + B5B5C1292872E7FC00FC5134 /* UIView+Extension.swift in Sources */, B85302A828728F6300F06234 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/HousLab_iOS/HousLab_iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/HousLab_iOS/HousLab_iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6946662..0f4c7f5 100644 --- a/HousLab_iOS/HousLab_iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/HousLab_iOS/HousLab_iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,34 +1,32 @@ { - "object": { - "pins": [ - { - "package": "Inject", - "repositoryURL": "https://github.com/krzysztofzablocki/Inject.git", - "state": { - "branch": "main", - "revision": "81d942634f359dc1d00a904e70328410aefd23fb", - "version": null - } - }, - { - "package": "SnapKit", - "repositoryURL": "https://github.com/SnapKit/SnapKit.git", - "state": { - "branch": null, - "revision": "f222cbdf325885926566172f6f5f06af95473158", - "version": "5.6.0" - } - }, - { - "package": "Then", - "repositoryURL": "https://github.com/devxoul/Then.git", - "state": { - "branch": null, - "revision": "d41ef523faef0f911369f79c0b96815d9dbb6d7a", - "version": "3.0.0" - } + "pins" : [ + { + "identity" : "inject", + "kind" : "remoteSourceControl", + "location" : "https://github.com/krzysztofzablocki/Inject.git", + "state" : { + "branch" : "main", + "revision" : "81d942634f359dc1d00a904e70328410aefd23fb" } - ] - }, - "version": 1 + }, + { + "identity" : "snapkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SnapKit/SnapKit.git", + "state" : { + "revision" : "f222cbdf325885926566172f6f5f06af95473158", + "version" : "5.6.0" + } + }, + { + "identity" : "then", + "kind" : "remoteSourceControl", + "location" : "https://github.com/devxoul/Then.git", + "state" : { + "revision" : "d41ef523faef0f911369f79c0b96815d9dbb6d7a", + "version" : "3.0.0" + } + } + ], + "version" : 2 } diff --git a/HousLab_iOS/HousLab_iOS/MinJae/Cells/EventsCollectionViewCell.swift b/HousLab_iOS/HousLab_iOS/MinJae/Cells/EventsCollectionViewCell.swift new file mode 100644 index 0000000..cfdd814 --- /dev/null +++ b/HousLab_iOS/HousLab_iOS/MinJae/Cells/EventsCollectionViewCell.swift @@ -0,0 +1,68 @@ +// +// EventsCollectionViewCell.swift +// HousLab_iOS +// +// Created by 김민재 on 2022/07/04. +// + +import UIKit + +class EventsCollectionViewCell: UICollectionViewCell { + + let addIcon = UIImageView().then { + $0.image = UIImage(systemName: "plus") + $0.contentMode = .scaleAspectFit + $0.tintColor = UIColor(hex: "FFD66D") + $0.isHidden = true + } + + let d_dayLabel = UILabel().then { + $0.textColor = .white + $0.font = .systemFont(ofSize: 22, weight: .semibold) + } + + let backgroudImageView = UIImageView().then { + $0.image = UIImage(systemName: "clock") + $0.tintColor = .white.withAlphaComponent(0.3) + $0.contentMode = .scaleAspectFit + } + + override init(frame: CGRect) { + super.init(frame: frame) + render() + configUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func render() { + addSubview(backgroudImageView) + backgroudImageView.addSubview(d_dayLabel) + backgroudImageView.addSubview(addIcon) + + backgroudImageView.snp.makeConstraints { + $0.top.bottom.leading.trailing.equalToSuperview() + } + + d_dayLabel.snp.makeConstraints { + $0.center.equalToSuperview() + } + + addIcon.snp.makeConstraints { + $0.center.equalToSuperview() + } + } + + private func configUI() { + layer.cornerRadius = self.bounds.width / 4 + } + + func setEventCellData(_ data: EventDataModel) { + d_dayLabel.text = data.ddayString + } + + + +} diff --git a/HousLab_iOS/HousLab_iOS/MinJae/Cells/ProfileCollectionViewCell.swift b/HousLab_iOS/HousLab_iOS/MinJae/Cells/ProfileCollectionViewCell.swift new file mode 100644 index 0000000..7163e85 --- /dev/null +++ b/HousLab_iOS/HousLab_iOS/MinJae/Cells/ProfileCollectionViewCell.swift @@ -0,0 +1,92 @@ +// +// ProfileCollectionViewCell.swift +// HousLab_iOS +// +// Created by 김민재 on 2022/07/05. +// + +import UIKit + +class ProfileCollectionViewCell: UICollectionViewCell { + + private let profileImage = UIImageView().then { + $0.image = UIImage(systemName: "person") + $0.contentMode = .scaleAspectFit + $0.layer.cornerRadius = $0.bounds.width / 2 + } + + private let profileNameLabel = UILabel().then { + $0.font = .systemFont(ofSize: 18, weight: .bold) + } + + lazy var profileStack = UIStackView(arrangedSubviews: [profileImage, profileNameLabel]).then { + $0.axis = .vertical + $0.spacing = 12 + $0.alignment = .center + } + + private let codeImage = UIImageView().then { + $0.image = UIImage(systemName: "rectangle") + $0.tintColor = .black + $0.contentMode = .scaleAspectFit + } + + private let codeLabel = UILabel().then { + $0.text = "코드로 룸메이트를 초대해보세요" + $0.font = .systemFont(ofSize: 13, weight: .medium) + $0.lineBreakMode = .byCharWrapping + $0.lineBreakStrategy = .hangulWordPriority + $0.textAlignment = .center + $0.numberOfLines = 0 + } + + lazy var codeViewStack = UIStackView(arrangedSubviews: [codeImage, codeLabel]).then { + $0.axis = .vertical + $0.spacing = 12 + $0.alignment = .center + $0.isHidden = true + } + + + override init(frame: CGRect) { + super.init(frame: frame) + configUI() + render() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func render() { + addSubViews([profileStack, codeViewStack]) + + codeLabel.snp.makeConstraints { + $0.width.equalTo(self.bounds.width / 2) + } + + profileStack.snp.makeConstraints { + $0.center.equalToSuperview() + } + + codeViewStack.snp.makeConstraints { + $0.center.equalToSuperview() + } + + } + + private func configUI() { + self.backgroundColor = UIColor(hex: "FFD66D") + layer.cornerRadius = self.bounds.width / 4 + } + + func setProfileData(_ data: ProfileDataModel) { + if data.isTested { + profileImage.image = UIImage(systemName: "person.fill") + } else { + profileImage.image = UIImage(systemName: "person") + } + profileNameLabel.text = data.profileName + } + +} diff --git a/HousLab_iOS/HousLab_iOS/MinJae/HomeViewController.swift b/HousLab_iOS/HousLab_iOS/MinJae/HomeViewController.swift new file mode 100644 index 0000000..268dd5d --- /dev/null +++ b/HousLab_iOS/HousLab_iOS/MinJae/HomeViewController.swift @@ -0,0 +1,334 @@ +// +// HomeViewController.swift +// HousLab_iOS +// +// Created by 김민재 on 2022/07/04. +// + +import UIKit +import SnapKit +import Then + + +class HomeViewController: UIViewController { + + enum Size { + static let screenWidth = UIScreen.main.bounds.width + static let addEventCellSize = CGSize(width: 72, height: 88) + static let eventCellSize = CGSize(width: 88, height: 88) + } + + //MARK: Properties + private var rules: [RulesDataModel]? + private var todos: [TodoDataModel]? + + //MARK: UI Compononents + private let titleLabel = UILabel().then { + $0.text = "Hous-" + $0.font = .systemFont(ofSize: 30, weight: .semibold) + $0.textAlignment = .left + } + + private let comingUpLabel = UILabel().then { + $0.text = "Coming up-" + $0.font = .systemFont(ofSize: 20, weight: .semibold) + $0.textAlignment = .left + } + + private var incomingEventsCollectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewLayout()).then { + let layout = UICollectionViewFlowLayout() + layout.scrollDirection = .horizontal + $0.collectionViewLayout = layout + $0.showsHorizontalScrollIndicator = false + } + + private lazy var eventStackView = UIStackView(arrangedSubviews: [comingUpLabel, incomingEventsCollectionView]).then { + $0.axis = .vertical + $0.spacing = 12 + $0.distribution = .fillProportionally + } + + private let ruleTitleLabel = UILabel().then { + $0.text = "Rules" + $0.font = .systemFont(ofSize: 20, weight: .semibold) + $0.textAlignment = .left + } + + private let ruleLabel1 = RulesTodosView() + + private let ruleLabel2 = RulesTodosView() + + private let ruleLabel3 = RulesTodosView() + + private let ruleLabel4 = RulesTodosView() + + private let ruleLabel5 = RulesTodosView() + + private lazy var ruleStackView = UIStackView(arrangedSubviews: [ruleLabel1, ruleLabel2, ruleLabel3, ruleLabel4, ruleLabel5]).then { + ruleLabel1.checkButton.isHidden = true + ruleLabel2.checkButton.isHidden = true + ruleLabel3.checkButton.isHidden = true + ruleLabel4.checkButton.isHidden = true + ruleLabel5.checkButton.isHidden = true + + $0.axis = .vertical + $0.spacing = 8 + $0.backgroundColor = UIColor(hex: "EFF5FF") + } + + private lazy var ruleTotalStackView = UIStackView(arrangedSubviews: [ruleTitleLabel, ruleStackView]).then { + $0.axis = .vertical + $0.spacing = 12 + } + + private let todoTitleLabel = UILabel().then { + $0.text = "To-Do" + $0.font = .systemFont(ofSize: 20, weight: .semibold) + $0.textAlignment = .left + } + + private let todoLabel1 = RulesTodosView() + + private let todoLabel2 = RulesTodosView() + + private let todoLabel3 = RulesTodosView() + + private let todoLabel4 = RulesTodosView() + + private let todoLabel5 = RulesTodosView() + + private lazy var todosStackView = UIStackView(arrangedSubviews: [todoLabel1, todoLabel2, todoLabel3, todoLabel4, todoLabel5]).then { + todoLabel1.circleImageView.isHidden = true + todoLabel2.circleImageView.isHidden = true + todoLabel3.circleImageView.isHidden = true + todoLabel4.circleImageView.isHidden = true + todoLabel5.circleImageView.isHidden = true + + $0.axis = .vertical + $0.spacing = 8 + $0.backgroundColor = UIColor(hex: "EFF5FF") + } + + private lazy var todosTotalStackView = UIStackView(arrangedSubviews: [todoTitleLabel, todosStackView]).then { + $0.axis = .vertical + $0.spacing = 12 + } + + private lazy var rulesTodoStackView = UIStackView(arrangedSubviews: [ruleTotalStackView,todosTotalStackView]).then { + $0.axis = .horizontal + $0.spacing = 15 + $0.distribution = .fillEqually + } + + private let homeProfileLabel = UILabel().then { + $0.text = "Home Profile-" + $0.font = .systemFont(ofSize: 20, weight: .semibold) + $0.textAlignment = .left + } + + private let profileCollectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewLayout()).then { + let layout = UICollectionViewFlowLayout() + layout.scrollDirection = .vertical + $0.collectionViewLayout = layout + $0.showsVerticalScrollIndicator = false + } + + private lazy var profileStackView = UIStackView(arrangedSubviews: [homeProfileLabel, profileCollectionView]).then { + $0.axis = .vertical + $0.spacing = 12 + $0.distribution = .fillProportionally + } + + + + //MARK: LifeCycle + + override func viewDidLoad() { + super.viewDidLoad() + render() + setCollectionView() + getRulesAndTodoList() + setRuleLabel() + setTodoLabel() + setCheckBoxIsDone() + } + + private func setCheckBoxImage(_ button: UIButton,_ isDone: Bool) { + button.isSelected = isDone + } + + //MARK: Custom Methods + private func getRulesAndTodoList() { + rules = RulesDataModel.sampleData + todos = TodoDataModel.sampleData + } + + private func setCollectionView() { + incomingEventsCollectionView.register(cell: EventsCollectionViewCell.self) + profileCollectionView.register(cell: ProfileCollectionViewCell.self) + + + incomingEventsCollectionView.delegate = self + incomingEventsCollectionView.dataSource = self + + profileCollectionView.delegate = self + profileCollectionView.dataSource = self + } + + private func setCheckBoxIsDone() { + setCheckBoxImage(todoLabel1.checkButton, todos?[0].isDone ?? false) + setCheckBoxImage(todoLabel2.checkButton, todos?[1].isDone ?? false) + setCheckBoxImage(todoLabel3.checkButton, todos?[2].isDone ?? false) + setCheckBoxImage(todoLabel4.checkButton, todos?[3].isDone ?? false) + setCheckBoxImage(todoLabel5.checkButton, todos?[4].isDone ?? false) + } + + private func setRuleLabel() { + ruleLabel1.setRulesLabelData(rule: rules?[0].ruleString ?? "") + ruleLabel2.setRulesLabelData(rule: rules?[1].ruleString ?? "") + ruleLabel3.setRulesLabelData(rule: rules?[2].ruleString ?? "") + ruleLabel4.setRulesLabelData(rule: rules?[3].ruleString ?? "") + ruleLabel5.setRulesLabelData(rule: rules?[4].ruleString ?? "") + } + + private func setTodoLabel() { + todoLabel1.setRulesLabelData(rule: todos?[0].todoString ?? "") + todoLabel2.setRulesLabelData(rule: todos?[1].todoString ?? "") + todoLabel3.setRulesLabelData(rule: todos?[2].todoString ?? "") + todoLabel4.setRulesLabelData(rule: todos?[3].todoString ?? "") + todoLabel5.setRulesLabelData(rule: todos?[4].todoString ?? "") + } + + private func render() { + view.addSubViews([titleLabel,eventStackView, rulesTodoStackView, profileStackView]) + + titleLabel.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide).offset(19) + $0.leading.equalToSuperview().offset(24) + $0.trailing.equalToSuperview() + } + + incomingEventsCollectionView.snp.makeConstraints { + $0.height.equalTo(95) + } + + eventStackView.snp.makeConstraints { + $0.top.equalTo(titleLabel.snp.bottom).offset(24) + $0.leading.equalTo(titleLabel.snp.leading) + $0.trailing.equalToSuperview() + } + + ruleTotalStackView.snp.makeConstraints { + $0.width.equalTo(Size.screenWidth * (156 / 375)) + } + + todosTotalStackView.snp.makeConstraints { + $0.width.equalTo(Size.screenWidth * (156 / 375)) + } + + rulesTodoStackView.snp.makeConstraints { + $0.leading.equalTo(eventStackView.snp.leading) + $0.top.equalTo(eventStackView.snp.bottom).offset(28) + $0.leading.equalToSuperview().inset(24) + } + + profileCollectionView.snp.makeConstraints { + $0.height.equalTo(160) + } + + profileStackView.snp.makeConstraints { + $0.leading.equalTo(eventStackView.snp.leading) + $0.top.equalTo(rulesTodoStackView.snp.bottom).offset(25) + $0.trailing.equalToSuperview().inset(24) + + } + } +} + + +//MARK: Delegate & Datasource +extension HomeViewController: UICollectionViewDelegate { + +} + +extension HomeViewController: UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + if collectionView == incomingEventsCollectionView { + return EventDataModel.sampleData.count + 1 + } + + return ProfileDataModel.sampleData.count + 1 + + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + if collectionView == incomingEventsCollectionView { + guard let cell = incomingEventsCollectionView.dequeueReusableCell(withReuseIdentifier: EventsCollectionViewCell.className, for: indexPath) as? EventsCollectionViewCell else { return UICollectionViewCell() } + + if indexPath.row == 0 { + cell.d_dayLabel.isHidden = true + cell.addIcon.isHidden = false + cell.backgroudImageView.image = nil + cell.backgroundColor = UIColor(hex: "FFF8E6") + return cell + } else { + cell.d_dayLabel.isHidden = false + cell.addIcon.isHidden = true + cell.backgroudImageView.image = UIImage(systemName: "clock") + cell.backgroundColor = UIColor(hex: "FFDE8A") + } + + cell.setEventCellData(EventDataModel.sampleData[indexPath.row - 1]) + return cell + } + + guard let cell = profileCollectionView.dequeueReusableCell(withReuseIdentifier: ProfileCollectionViewCell.className, for: indexPath) as? ProfileCollectionViewCell else { return UICollectionViewCell() } + + if indexPath.row == ProfileDataModel.sampleData.count { + cell.profileStack.isHidden = true + cell.codeViewStack.isHidden = false + + return cell + } + + cell.setProfileData(ProfileDataModel.sampleData[indexPath.row]) + + return cell + } +} + +extension HomeViewController: UICollectionViewDelegateFlowLayout { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + + if collectionView == incomingEventsCollectionView { + if indexPath.row == 0 { + return Size.addEventCellSize + } + + return Size.eventCellSize + } + + return CGSize(width: 156, height: 156) + + + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + return UIEdgeInsets(top: 5, left: 0, bottom: 0, right: 0) + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + if collectionView == incomingEventsCollectionView { + return 0 + } + + return 15 + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { + if collectionView == incomingEventsCollectionView { + return 8 + } + return 15 + } +} diff --git a/HousLab_iOS/HousLab_iOS/MinJae/MinJaeViewController.swift b/HousLab_iOS/HousLab_iOS/MinJae/MinJaeViewController.swift deleted file mode 100644 index 8fa91de..0000000 --- a/HousLab_iOS/HousLab_iOS/MinJae/MinJaeViewController.swift +++ /dev/null @@ -1,8 +0,0 @@ -// -// MinJaeViewController.swift -// HousLab_iOS -// -// Created by 김지현 on 2022/07/04. -// - -import Foundation diff --git a/HousLab_iOS/HousLab_iOS/MinJae/Model/EventsDataModel.swift b/HousLab_iOS/HousLab_iOS/MinJae/Model/EventsDataModel.swift new file mode 100644 index 0000000..16932d4 --- /dev/null +++ b/HousLab_iOS/HousLab_iOS/MinJae/Model/EventsDataModel.swift @@ -0,0 +1,29 @@ +// +// EventsDataModel.swift +// HousLab_iOS +// +// Created by 김민재 on 2022/07/04. +// + +import Foundation + +struct EventDataModel { + let dday: Int + var ddayString: String { + return "D-\(dday)" + } +} + +extension EventDataModel { + static let sampleData: [EventDataModel] = [ + EventDataModel(dday: 1), + EventDataModel(dday: 3), + EventDataModel(dday: 4), + EventDataModel(dday: 11), + EventDataModel(dday: 42), + EventDataModel(dday: 11), + EventDataModel(dday: 1), + EventDataModel(dday: 4), + EventDataModel(dday: 5) + ] +} diff --git a/HousLab_iOS/HousLab_iOS/MinJae/Model/ProfileDataModel.swift b/HousLab_iOS/HousLab_iOS/MinJae/Model/ProfileDataModel.swift new file mode 100644 index 0000000..2f4e4d7 --- /dev/null +++ b/HousLab_iOS/HousLab_iOS/MinJae/Model/ProfileDataModel.swift @@ -0,0 +1,23 @@ +// +// ProfileDataModel.swift +// HousLab_iOS +// +// Created by 김민재 on 2022/07/05. +// + +import Foundation + +struct ProfileDataModel { + let profileName: String + let isTested: Bool +} + + +extension ProfileDataModel { + static let sampleData: [ProfileDataModel] = [ + ProfileDataModel(profileName: "김민재", isTested: false), + ProfileDataModel(profileName: "김지현", isTested: false), + ProfileDataModel(profileName: "김호세", isTested: true), + ProfileDataModel(profileName: "이의진", isTested: true), + ] +} diff --git a/HousLab_iOS/HousLab_iOS/MinJae/Model/RulesDataModel.swift b/HousLab_iOS/HousLab_iOS/MinJae/Model/RulesDataModel.swift new file mode 100644 index 0000000..3c59899 --- /dev/null +++ b/HousLab_iOS/HousLab_iOS/MinJae/Model/RulesDataModel.swift @@ -0,0 +1,23 @@ +// +// RulesDataModel.swift +// HousLab_iOS +// +// Created by 김민재 on 2022/07/05. +// + +import Foundation + +struct RulesDataModel { + let ruleString: String +} + + +extension RulesDataModel { + static let sampleData: [RulesDataModel] = [ + RulesDataModel(ruleString: "00시~불끄기"), + RulesDataModel(ruleString: "23시~이어폰 필수"), + RulesDataModel(ruleString: "세탁기는 화수토"), + RulesDataModel(ruleString: "일 청소하는날"), + RulesDataModel(ruleString: "2,4주 토~장보기") + ] +} diff --git a/HousLab_iOS/HousLab_iOS/MinJae/Model/TodoDataModels.swift b/HousLab_iOS/HousLab_iOS/MinJae/Model/TodoDataModels.swift new file mode 100644 index 0000000..d5ed7ce --- /dev/null +++ b/HousLab_iOS/HousLab_iOS/MinJae/Model/TodoDataModels.swift @@ -0,0 +1,24 @@ +// +// TodoDataModels.swift +// HousLab_iOS +// +// Created by 김민재 on 2022/07/05. +// + +import Foundation + +struct TodoDataModel { + let todoString: String + let isDone: Bool +} + + +extension TodoDataModel { + static let sampleData: [TodoDataModel] = [ + TodoDataModel(todoString: "다영언니랑 마트", isDone: false), + TodoDataModel(todoString: "거실 청소기 돌리기", isDone: false), + TodoDataModel(todoString: "저녁 설거지", isDone: false), + TodoDataModel(todoString: "야식 설거지", isDone: true), + TodoDataModel(todoString: "급하게 산 물 청구", isDone: true) + ] +} diff --git a/HousLab_iOS/HousLab_iOS/MinJae/RulesTodosView.swift b/HousLab_iOS/HousLab_iOS/MinJae/RulesTodosView.swift new file mode 100644 index 0000000..668e941 --- /dev/null +++ b/HousLab_iOS/HousLab_iOS/MinJae/RulesTodosView.swift @@ -0,0 +1,66 @@ +// +// RulesView.swift +// HousLab_iOS +// +// Created by 김민재 on 2022/07/05. +// + +import UIKit + +class RulesTodosView: UIView { + + let circleImageView = UIImageView().then { + $0.image = UIImage(systemName: "circle.fill") + $0.tintColor = .blue + } + + let checkButton = UIButton().then { + $0.setImage(UIImage(systemName: "checkmark.square"), for: .normal) + $0.setImage(UIImage(systemName: "checkmark.square.fill"), for: .selected) + $0.tintColor = UIColor(hex: "5E9EFF") + } + + private let ruleLabel = UILabel().then { + $0.font = .systemFont(ofSize: 13, weight: .medium) + $0.lineBreakMode = .byWordWrapping + $0.numberOfLines = 0 + } + + private lazy var stackView = UIStackView(arrangedSubviews: [circleImageView, checkButton, ruleLabel]).then { + $0.axis = .horizontal + $0.alignment = .center + $0.spacing = 8 + } + + override init(frame: CGRect) { + super.init(frame: frame) + render() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func render() { + addSubViews([stackView]) + circleImageView.snp.makeConstraints { + $0.height.width.equalTo(8) + } + + checkButton.snp.makeConstraints { + $0.height.width.equalTo(14) + } + + ruleLabel.snp.makeConstraints { + $0.leading.equalTo(circleImageView.snp.trailing).offset(8) + } + + stackView.snp.makeConstraints { + $0.top.bottom.leading.trailing.equalToSuperview() + } + } + + func setRulesLabelData(rule: String) { + ruleLabel.text = rule + } +} diff --git a/HousLab_iOS/HousLab_iOS/Supports/SceneDelegate.swift b/HousLab_iOS/HousLab_iOS/Supports/SceneDelegate.swift index 7a46cb1..3dbaca8 100644 --- a/HousLab_iOS/HousLab_iOS/Supports/SceneDelegate.swift +++ b/HousLab_iOS/HousLab_iOS/Supports/SceneDelegate.swift @@ -22,7 +22,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { let window = UIWindow(windowScene: windowScene) window.backgroundColor = .white // MARK: - ViewControllerHost에 Hot reload 하고 싶은 ViewController instance를 넣기 - window.rootViewController = Inject.ViewControllerHost(HoseViewController()) + window.rootViewController = Inject.ViewControllerHost(HomeViewController()) // window.rootViewController = ViewController() window.makeKeyAndVisible() self.window = window