Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

프로젝트 매니저 [STEP 2-1] BMO #311

Draft
wants to merge 14 commits into
base: ic_9_bmo94
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 70 additions & 9 deletions ProjectManager/ProjectManager.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,35 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 53;
objects = {

/* Begin PBXBuildFile section */
C7431F0625F51E1D0094C4CF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7431F0525F51E1D0094C4CF /* AppDelegate.swift */; };
C7431F0825F51E1D0094C4CF /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7431F0725F51E1D0094C4CF /* SceneDelegate.swift */; };
C7431F0A25F51E1D0094C4CF /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7431F0925F51E1D0094C4CF /* ViewController.swift */; };
C7431F0A25F51E1D0094C4CF /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7431F0925F51E1D0094C4CF /* MainViewController.swift */; };
C7431F0F25F51E1E0094C4CF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7431F0E25F51E1E0094C4CF /* Assets.xcassets */; };
C7431F1225F51E1E0094C4CF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C7431F1025F51E1E0094C4CF /* LaunchScreen.storyboard */; };
CB3A11642AC99A9A00DA0B1E /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB3A11632AC99A9A00DA0B1E /* Observable.swift */; };
CB3A11662AC99C1900DA0B1E /* WorkViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB3A11652AC99C1900DA0B1E /* WorkViewModel.swift */; };
CB3A116A2AC99C6F00DA0B1E /* Work.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB3A11692AC99C6F00DA0B1E /* Work.swift */; };
CB3A11752ACA6DDC00DA0B1E /* WorkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB3A11742ACA6DDC00DA0B1E /* WorkView.swift */; };
CBC0E8EF2AC1AF3A004CC6DF /* WorkCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBC0E8EE2AC1AF3A004CC6DF /* WorkCell.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
C7431F0225F51E1D0094C4CF /* ProjectManager.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ProjectManager.app; sourceTree = BUILT_PRODUCTS_DIR; };
C7431F0525F51E1D0094C4CF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C7431F0725F51E1D0094C4CF /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
C7431F0925F51E1D0094C4CF /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
C7431F0925F51E1D0094C4CF /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
C7431F0E25F51E1E0094C4CF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
C7431F1125F51E1E0094C4CF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
C7431F1325F51E1E0094C4CF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CB3A11632AC99A9A00DA0B1E /* Observable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Observable.swift; sourceTree = "<group>"; };
CB3A11652AC99C1900DA0B1E /* WorkViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkViewModel.swift; sourceTree = "<group>"; };
CB3A11692AC99C6F00DA0B1E /* Work.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Work.swift; sourceTree = "<group>"; };
CB3A11742ACA6DDC00DA0B1E /* WorkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkView.swift; sourceTree = "<group>"; };
CBC0E8EE2AC1AF3A004CC6DF /* WorkCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkCell.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -52,16 +62,61 @@
sourceTree = "<group>";
};
C7431F0425F51E1D0094C4CF /* ProjectManager */ = {
isa = PBXGroup;
children = (
CB3A116F2ACA64EA00DA0B1E /* App */,
CB3A11702ACA651400DA0B1E /* Model */,
CB3A11722ACA652200DA0B1E /* View */,
CB3A11712ACA651B00DA0B1E /* ViewModel */,
CB3A11732ACA662600DA0B1E /* Resource */,
C7431F1325F51E1E0094C4CF /* Info.plist */,
);
path = ProjectManager;
sourceTree = "<group>";
};
CB3A116F2ACA64EA00DA0B1E /* App */ = {
isa = PBXGroup;
children = (
C7431F0525F51E1D0094C4CF /* AppDelegate.swift */,
C7431F0725F51E1D0094C4CF /* SceneDelegate.swift */,
C7431F0925F51E1D0094C4CF /* ViewController.swift */,
C7431F0E25F51E1E0094C4CF /* Assets.xcassets */,
);
path = App;
sourceTree = "<group>";
};
CB3A11702ACA651400DA0B1E /* Model */ = {
isa = PBXGroup;
children = (
CB3A11692AC99C6F00DA0B1E /* Work.swift */,
);
path = Model;
sourceTree = "<group>";
};
CB3A11712ACA651B00DA0B1E /* ViewModel */ = {
isa = PBXGroup;
children = (
CB3A11632AC99A9A00DA0B1E /* Observable.swift */,
CB3A11652AC99C1900DA0B1E /* WorkViewModel.swift */,
);
path = ViewModel;
sourceTree = "<group>";
};
CB3A11722ACA652200DA0B1E /* View */ = {
isa = PBXGroup;
children = (
C7431F1025F51E1E0094C4CF /* LaunchScreen.storyboard */,
C7431F1325F51E1E0094C4CF /* Info.plist */,
C7431F0925F51E1D0094C4CF /* MainViewController.swift */,
CB3A11742ACA6DDC00DA0B1E /* WorkView.swift */,
CBC0E8EE2AC1AF3A004CC6DF /* WorkCell.swift */,
);
path = ProjectManager;
path = View;
sourceTree = "<group>";
};
CB3A11732ACA662600DA0B1E /* Resource */ = {
isa = PBXGroup;
children = (
C7431F0E25F51E1E0094C4CF /* Assets.xcassets */,
);
path = Resource;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -90,8 +145,9 @@
C7431EFA25F51E1D0094C4CF /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1240;
LastUpgradeCheck = 1240;
LastUpgradeCheck = 1430;
TargetAttributes = {
C7431F0125F51E1D0094C4CF = {
CreatedOnToolsVersion = 12.4;
Expand Down Expand Up @@ -133,9 +189,14 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C7431F0A25F51E1D0094C4CF /* ViewController.swift in Sources */,
C7431F0A25F51E1D0094C4CF /* MainViewController.swift in Sources */,
CB3A116A2AC99C6F00DA0B1E /* Work.swift in Sources */,
CB3A11642AC99A9A00DA0B1E /* Observable.swift in Sources */,
C7431F0625F51E1D0094C4CF /* AppDelegate.swift in Sources */,
CB3A11662AC99C1900DA0B1E /* WorkViewModel.swift in Sources */,
C7431F0825F51E1D0094C4CF /* SceneDelegate.swift in Sources */,
CBC0E8EF2AC1AF3A004CC6DF /* WorkCell.swift in Sources */,
CB3A11752ACA6DDC00DA0B1E /* WorkView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
return
}

let viewController = ViewController()
let mainViewController = MainViewController()
let navigationController = UINavigationController(rootViewController: mainViewController)

window = UIWindow(windowScene: windowScene)
window?.rootViewController = viewController
window?.rootViewController = navigationController
window?.makeKeyAndVisible()
}
}
20 changes: 20 additions & 0 deletions ProjectManager/ProjectManager/Model/Work.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Work.swift
// ProjectManager
//
// Created by BMO on 2023/10/01.
//

import Foundation

struct Work: Equatable, Sendable {
let title: String
let description: String
let deadline: Date

enum Status: String {
case todo = "TODO"
case doing = "DOING"
case done = "DONE"
}
}
72 changes: 72 additions & 0 deletions ProjectManager/ProjectManager/View/MainViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
//
// ProjectManager - MainViewController.swift
// Created by yagom.
// Copyright © yagom. All rights reserved.
//

import UIKit

final class MainViewController: UIViewController {
private let todoView: WorkView
private let doingView: WorkView
private let doneView: WorkView

init() {
self.todoView = WorkView(workStatus: .todo)
self.doingView = WorkView(workStatus: .doing)
self.doneView = WorkView(workStatus: .done)

super.init(nibName: nil, bundle: nil)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

private let mainStackView: UIStackView = {
let stackView = UIStackView()
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .horizontal
stackView.spacing = 10
stackView.distribution = .fillEqually

return stackView
}()

override func viewDidLoad() {
super.viewDidLoad()

setNavigationItem()
setUI()
}

private func setNavigationItem() {
navigationItem.title = "Project Manager"

let addAction = UIAction { _ in
// TODO: + 버튼 터치 시 동작 작성

print("touch addAction")
}

navigationItem.rightBarButtonItem = UIBarButtonItem(systemItem: .add, primaryAction: addAction)
}

private func setUI() {
view.backgroundColor = .systemBackground

view.addSubview(mainStackView)
mainStackView.addArrangedSubview(todoView)
mainStackView.addArrangedSubview(doingView)
mainStackView.addArrangedSubview(doneView)

mainStackView.backgroundColor = .systemGray4

NSLayoutConstraint.activate([
mainStackView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
mainStackView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
mainStackView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
mainStackView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor)
])
}
}
81 changes: 81 additions & 0 deletions ProjectManager/ProjectManager/View/WorkCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
//
// WorkCell.swift
// ProjectManager
//
// Created by BMO on 2023/09/25.
//

import UIKit

final class WorkCell: UITableViewCell {
static let identifier: String = "WorkCell"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요런건 항상 프로토콜을 사용하는 습관이 좋을 듯 합니당


private let stackView: UIStackView = {
let stackView = UIStackView()
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .vertical
stackView.spacing = 8
stackView.distribution = .equalSpacing

return stackView
}()

private let titleLabel: UILabel = {
let label = UILabel()

return label
}()

private let descriptionLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 3
label.textColor = .gray

return label
}()

private let deadlineLabel: UILabel = {
let label = UILabel()

return label
}()

required init?(coder: NSCoder) {
super.init(coder: coder)
setUI()
}

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setUI()
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepare for reuse를 처리하는 부분이 없네요

override func prepareForReuse() {
titleLabel.text = ""
deadlineLabel.text = ""
deadlineLabel.text = ""
}

private func setUI() {
separatorInset = UIEdgeInsets.zero

addSubview(stackView)

stackView.addArrangedSubview(titleLabel)
stackView.addArrangedSubview(descriptionLabel)
stackView.addArrangedSubview(deadlineLabel)

NSLayoutConstraint.activate([
stackView.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor),
stackView.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor),
stackView.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor),
stackView.bottomAnchor.constraint(equalTo: layoutMarginsGuide.bottomAnchor)
])
}

func config(title: String, description: String, deadline: Date) {
titleLabel.text = title
descriptionLabel.text = description
deadlineLabel.text = deadline.description
}
}
Loading