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-2] Moon #312

Open
wants to merge 48 commits into
base: ic_9_etialmoon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
04eb67b
chore: MVVM 폴더 구조 생성
Sep 24, 2023
d1af0ff
refactor: ViewController에서 ListViewController로 네이밍 수정
Sep 24, 2023
4749fcc
feat: ListViewController에 tableView 추가
Sep 24, 2023
9ecf43d
chore: ListViewController 파일 이름 수정
Sep 24, 2023
55d04a8
feat: ListViewCell 생성 및 구현
Sep 24, 2023
e7f8af1
feat: ListViewHeader 생성 및 구현
Sep 25, 2023
c3c89b7
refactor: ListViewCell의 subView들을 contentView의 subView로 수정
Sep 25, 2023
d1eedda
feat: ListViewController의 TableView에 Cell 사이 간격 추가
Sep 25, 2023
6ee0f75
refactor: 뷰들의 배경색 수정
Sep 25, 2023
35a2646
refactor: ListViewCell의 deadlineLabel 네이밍 수정
Sep 25, 2023
9f35f8e
feat: Todo 모델 생성
Sep 25, 2023
2ca8a15
feat: ListViewModel 생성
Sep 25, 2023
eadf176
refactor: ListHeader, ListCell 네이밍 수정
Sep 25, 2023
0941e91
feat: identifier를 위한 Reusable 프로토콜 생성
Sep 25, 2023
d2fdb28
feat: ListCellViewModel 생성
Sep 25, 2023
5b4b6ec
refactor: ListHeader와 바인딩할 수 있도록 수정
Sep 25, 2023
5b4b5cd
feat: ListCell과 ListCellViewModel 바인딩
Sep 25, 2023
15cc06c
feat: ListHeader와 ListViewModel 바인딩
Sep 25, 2023
76e9c4f
refactor: ListViewController에서 ViewModel을 사용할 수 있도록 수정
Sep 25, 2023
ddc2e9b
feat: TodoDateFormatter, DateFormat 생성
Sep 28, 2023
0752eea
refactor: Cell에서 ViewModel을 사용하지 않도록 수정
Sep 28, 2023
588d154
refactor: todoList 모델 로드 시점 수정
Sep 28, 2023
cfbe0fd
feat: Array extension 생성 및 safe subscript 구현
Sep 28, 2023
5693a3a
refactor: 배열 접근을 safe subscript로 하도록 수정
Sep 28, 2023
65dd71b
fix: ListHeader의 배경색을 회색으로 수정
Sep 30, 2023
0ffc468
feat: NavigationController 추가
Sep 30, 2023
4302422
feat: ToDo CoreData 모델 생성
Sep 30, 2023
a780746
feat: Category 생성
Sep 30, 2023
d8b8f57
refactor: Category의 rawValue를 대문자로 수정
Oct 1, 2023
cfdc5e2
feat: UIFont extension으로 TextStyle과 Weight를 동시에 적용할 수 있도록 기능 추가
Oct 1, 2023
eb5d9fa
feat: UITextField에 inset을 적용하기 위한 InsetTextField 생성
Oct 1, 2023
9078bed
feat: ToDoDetailViewController 생성
Oct 1, 2023
1b347a1
feat: Cell을 선택했을 때 선택 표시가 사라지도록 수정
Oct 1, 2023
51ce58b
feat: DataManager 생성
Oct 1, 2023
9893c7e
feat: CoreData를 활용하도록 기능 추가
Oct 1, 2023
24548ca
chore: ToDoDetailViewController 주석 추가
Oct 1, 2023
b501c8f
refactor: 더 이상 사용하지 않는 Todo 타입 제거
Oct 1, 2023
06f65e3
feat: ToDoDetailViewController의 viewWillDisappear에서 저장 기능 추가
Oct 2, 2023
4365f4f
chore: LaunchScreen 폴더 위치 이동
Oct 3, 2023
7a55746
chore: ToDo 파일 이동
Oct 3, 2023
c1af24f
refactor: 불필요한 코드 정리
Oct 3, 2023
61880a0
feat: ToDoDetailViewModel 생성
Oct 3, 2023
05cc628
feat: 저장을 수행할 때 모델이 변경됨을 알리는 기능 추가
Oct 3, 2023
49e1b6a
refactor: ToDoDetailViewController의 데이터 바인딩을 Combine으로 수정
Oct 3, 2023
505db35
feat: 스와이프하여 삭제 기능 추가
Oct 3, 2023
883741b
feat: UITextView extension으로 바인딩을 위한 textPublisher 추가
Oct 4, 2023
16ad845
fix: datePicker와 bodyTextView의 바인딩 수정
Oct 4, 2023
aba4994
chore: 주석 추가
Oct 4, 2023
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
165 changes: 157 additions & 8 deletions ProjectManager/ProjectManager.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,50 @@
objects = {

/* Begin PBXBuildFile section */
28913B732AC5666D00E626F7 /* TodoDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28913B722AC5666D00E626F7 /* TodoDateFormatter.swift */; };
28913B762AC5950E00E626F7 /* Array+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28913B752AC5950E00E626F7 /* Array+.swift */; };
28913B7A2AC5AC9A00E626F7 /* ToDo.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 28913B782AC5AC9A00E626F7 /* ToDo.xcdatamodeld */; };
28913B7C2AC5AD1300E626F7 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28913B7B2AC5AD1300E626F7 /* Category.swift */; };
28913B7F2AC8033000E626F7 /* ToDo+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28913B7D2AC8033000E626F7 /* ToDo+CoreDataClass.swift */; };
28913B802AC8033000E626F7 /* ToDo+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28913B7E2AC8033000E626F7 /* ToDo+CoreDataProperties.swift */; };
28913B832AC8114F00E626F7 /* DataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28913B822AC8114F00E626F7 /* DataManager.swift */; };
28913B852AC83ACE00E626F7 /* ToDoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28913B842AC83ACE00E626F7 /* ToDoDetailViewController.swift */; };
28CA66E52AC0F72600FFD7A9 /* ListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28CA66E42AC0F72600FFD7A9 /* ListCell.swift */; };
28CA66E72AC0FE3100FFD7A9 /* ListHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28CA66E62AC0FE3100FFD7A9 /* ListHeader.swift */; };
28CA66EB2AC1805300FFD7A9 /* ListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28CA66EA2AC1805300FFD7A9 /* ListViewModel.swift */; };
28CA66F22AC1A08600FFD7A9 /* Reusable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28CA66F12AC1A08600FFD7A9 /* Reusable.swift */; };
28DBCB962AC9292C00DFC58E /* InsetTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28DBCB952AC9292C00DFC58E /* InsetTextField.swift */; };
28DBCB982AC94A5F00DFC58E /* UIFont+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28DBCB972AC94A5F00DFC58E /* UIFont+.swift */; };
28DBCB9A2ACAD19500DFC58E /* ToDoDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28DBCB992ACAD19500DFC58E /* ToDoDetailViewModel.swift */; };
28DBCBA22ACD40E600DFC58E /* UITextView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28DBCBA12ACD40E600DFC58E /* UITextView+.swift */; };
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 /* ListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7431F0925F51E1D0094C4CF /* ListViewController.swift */; };
C7431F0F25F51E1E0094C4CF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7431F0E25F51E1E0094C4CF /* Assets.xcassets */; };
C7431F1225F51E1E0094C4CF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C7431F1025F51E1E0094C4CF /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
28913B722AC5666D00E626F7 /* TodoDateFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoDateFormatter.swift; sourceTree = "<group>"; };
28913B752AC5950E00E626F7 /* Array+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+.swift"; sourceTree = "<group>"; };
28913B792AC5AC9A00E626F7 /* ToDoModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = ToDoModel.xcdatamodel; sourceTree = "<group>"; };
28913B7B2AC5AD1300E626F7 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = "<group>"; };
28913B7D2AC8033000E626F7 /* ToDo+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ToDo+CoreDataClass.swift"; sourceTree = "<group>"; };
28913B7E2AC8033000E626F7 /* ToDo+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ToDo+CoreDataProperties.swift"; sourceTree = "<group>"; };
28913B822AC8114F00E626F7 /* DataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataManager.swift; sourceTree = "<group>"; };
28913B842AC83ACE00E626F7 /* ToDoDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToDoDetailViewController.swift; sourceTree = "<group>"; };
28CA66E42AC0F72600FFD7A9 /* ListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListCell.swift; sourceTree = "<group>"; };
28CA66E62AC0FE3100FFD7A9 /* ListHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListHeader.swift; sourceTree = "<group>"; };
28CA66EA2AC1805300FFD7A9 /* ListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListViewModel.swift; sourceTree = "<group>"; };
28CA66F12AC1A08600FFD7A9 /* Reusable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reusable.swift; sourceTree = "<group>"; };
28DBCB952AC9292C00DFC58E /* InsetTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InsetTextField.swift; sourceTree = "<group>"; };
28DBCB972AC94A5F00DFC58E /* UIFont+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+.swift"; sourceTree = "<group>"; };
28DBCB992ACAD19500DFC58E /* ToDoDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToDoDetailViewModel.swift; sourceTree = "<group>"; };
28DBCBA12ACD40E600DFC58E /* UITextView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextView+.swift"; sourceTree = "<group>"; };
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 /* ListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListViewController.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>"; };
Expand All @@ -35,6 +67,93 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
28913B742AC594EE00E626F7 /* Extension */ = {
isa = PBXGroup;
children = (
28913B752AC5950E00E626F7 /* Array+.swift */,
28DBCB972AC94A5F00DFC58E /* UIFont+.swift */,
);
path = Extension;
sourceTree = "<group>";
};
28913B772AC5AC3100E626F7 /* ToDo */ = {
isa = PBXGroup;
children = (
28913B782AC5AC9A00E626F7 /* ToDo.xcdatamodeld */,
28913B7D2AC8033000E626F7 /* ToDo+CoreDataClass.swift */,
28913B7E2AC8033000E626F7 /* ToDo+CoreDataProperties.swift */,
28913B7B2AC5AD1300E626F7 /* Category.swift */,
28913B822AC8114F00E626F7 /* DataManager.swift */,
);
path = ToDo;
sourceTree = "<group>";
};
2897D3752AC05F8400662BAA /* ViewModel */ = {
isa = PBXGroup;
children = (
28CA66EA2AC1805300FFD7A9 /* ListViewModel.swift */,
28DBCB992ACAD19500DFC58E /* ToDoDetailViewModel.swift */,
);
path = ViewModel;
sourceTree = "<group>";
};
2897D3762AC05F8D00662BAA /* View */ = {
isa = PBXGroup;
children = (
28DBCBA02ACD40DC00DFC58E /* Extension */,
C7431F0925F51E1D0094C4CF /* ListViewController.swift */,
28CA66E62AC0FE3100FFD7A9 /* ListHeader.swift */,
28CA66E42AC0F72600FFD7A9 /* ListCell.swift */,
28913B842AC83ACE00E626F7 /* ToDoDetailViewController.swift */,
28DBCB952AC9292C00DFC58E /* InsetTextField.swift */,
);
path = View;
sourceTree = "<group>";
};
2897D3772AC05F9500662BAA /* Model */ = {
isa = PBXGroup;
children = (
28913B772AC5AC3100E626F7 /* ToDo */,
);
path = Model;
sourceTree = "<group>";
};
2897D3782AC05F9D00662BAA /* Application */ = {
isa = PBXGroup;
children = (
C7431F0525F51E1D0094C4CF /* AppDelegate.swift */,
C7431F0725F51E1D0094C4CF /* SceneDelegate.swift */,
);
path = Application;
sourceTree = "<group>";
};
2897D3792AC05FBE00662BAA /* Resource */ = {
isa = PBXGroup;
children = (
C7431F1025F51E1E0094C4CF /* LaunchScreen.storyboard */,
C7431F0E25F51E1E0094C4CF /* Assets.xcassets */,
);
path = Resource;
sourceTree = "<group>";
};
28CA66F02AC1A02C00FFD7A9 /* Utility */ = {
isa = PBXGroup;
children = (
28913B742AC594EE00E626F7 /* Extension */,
28CA66F12AC1A08600FFD7A9 /* Reusable.swift */,
28913B722AC5666D00E626F7 /* TodoDateFormatter.swift */,
);
path = Utility;
sourceTree = "<group>";
};
28DBCBA02ACD40DC00DFC58E /* Extension */ = {
isa = PBXGroup;
children = (
28DBCBA12ACD40E600DFC58E /* UITextView+.swift */,
);
path = Extension;
sourceTree = "<group>";
};
C7431EF925F51E1D0094C4CF = {
isa = PBXGroup;
children = (
Expand All @@ -54,11 +173,12 @@
C7431F0425F51E1D0094C4CF /* ProjectManager */ = {
isa = PBXGroup;
children = (
C7431F0525F51E1D0094C4CF /* AppDelegate.swift */,
C7431F0725F51E1D0094C4CF /* SceneDelegate.swift */,
C7431F0925F51E1D0094C4CF /* ViewController.swift */,
C7431F0E25F51E1E0094C4CF /* Assets.xcassets */,
C7431F1025F51E1E0094C4CF /* LaunchScreen.storyboard */,
2897D3782AC05F9D00662BAA /* Application */,
2897D3772AC05F9500662BAA /* Model */,
2897D3762AC05F8D00662BAA /* View */,
2897D3752AC05F8400662BAA /* ViewModel */,
2897D3792AC05FBE00662BAA /* Resource */,
28CA66F02AC1A02C00FFD7A9 /* Utility */,
C7431F1325F51E1E0094C4CF /* Info.plist */,
);
path = ProjectManager;
Expand Down Expand Up @@ -133,9 +253,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C7431F0A25F51E1D0094C4CF /* ViewController.swift in Sources */,
28913B732AC5666D00E626F7 /* TodoDateFormatter.swift in Sources */,
28913B852AC83ACE00E626F7 /* ToDoDetailViewController.swift in Sources */,
28913B832AC8114F00E626F7 /* DataManager.swift in Sources */,
28DBCB962AC9292C00DFC58E /* InsetTextField.swift in Sources */,
28CA66E52AC0F72600FFD7A9 /* ListCell.swift in Sources */,
28913B802AC8033000E626F7 /* ToDo+CoreDataProperties.swift in Sources */,
28CA66F22AC1A08600FFD7A9 /* Reusable.swift in Sources */,
C7431F0A25F51E1D0094C4CF /* ListViewController.swift in Sources */,
28CA66EB2AC1805300FFD7A9 /* ListViewModel.swift in Sources */,
28DBCBA22ACD40E600DFC58E /* UITextView+.swift in Sources */,
28DBCB9A2ACAD19500DFC58E /* ToDoDetailViewModel.swift in Sources */,
28DBCB982AC94A5F00DFC58E /* UIFont+.swift in Sources */,
C7431F0625F51E1D0094C4CF /* AppDelegate.swift in Sources */,
28CA66E72AC0FE3100FFD7A9 /* ListHeader.swift in Sources */,
28913B7F2AC8033000E626F7 /* ToDo+CoreDataClass.swift in Sources */,
C7431F0825F51E1D0094C4CF /* SceneDelegate.swift in Sources */,
28913B7A2AC5AC9A00E626F7 /* ToDo.xcdatamodeld in Sources */,
28913B762AC5950E00E626F7 /* Array+.swift in Sources */,
28913B7C2AC5AD1300E626F7 /* Category.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -329,6 +465,19 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCVersionGroup section */
28913B782AC5AC9A00E626F7 /* ToDo.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
28913B792AC5AC9A00E626F7 /* ToDoModel.xcdatamodel */,
);
currentVersion = 28913B792AC5AC9A00E626F7 /* ToDoModel.xcdatamodel */;
path = ToDo.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = C7431EFA25F51E1D0094C4CF /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C7431F0125F51E1D0094C4CF"
BuildableName = "ProjectManager.app"
BlueprintName = "ProjectManager"
ReferencedContainer = "container:ProjectManager.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C7431F0125F51E1D0094C4CF"
BuildableName = "ProjectManager.app"
BlueprintName = "ProjectManager"
ReferencedContainer = "container:ProjectManager.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C7431F0125F51E1D0094C4CF"
BuildableName = "ProjectManager.app"
BlueprintName = "ProjectManager"
ReferencedContainer = "container:ProjectManager.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
guard let windowScene = (scene as? UIWindowScene) else { return }

window = UIWindow(windowScene: windowScene)
window?.rootViewController = ViewController()
window?.rootViewController = UINavigationController(rootViewController: ListViewController())
window?.makeKeyAndVisible()
}

Expand Down
12 changes: 12 additions & 0 deletions ProjectManager/ProjectManager/Model/ToDo/Category.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// Category.swift
// ProjectManager
//
// Created by Moon on 2023/09/28.
//

enum Category: String {
case todo = "TODO"
case doing = "DOING"
case done = "DONE"
}
75 changes: 75 additions & 0 deletions ProjectManager/ProjectManager/Model/ToDo/DataManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
//
// DataManager.swift
// ProjectManager
//
// Created by Moon on 2023/09/30.
//

import CoreData

final class DataManager {
private let persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: "ToDo")

container.loadPersistentStores { storeDescription, error in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
}

return container
}()

private let viewContext: NSManagedObjectContext

init() {
viewContext = persistentContainer.viewContext
}

func createToDo(title: String? = "", deadline: Date? = Date(), body: String? = "", category: Category) -> ToDo {
let todo = ToDo(context: viewContext)
todo.title = title
todo.deadline = deadline
todo.body = body
todo.category = category.rawValue

return todo
}

func fetchToDoList() -> [ToDo] {
do {
let fetchRequest = ToDo.fetchRequest()

return try viewContext.fetch(fetchRequest)
} catch let error as NSError {
print("Unresolved error: \(error), \(error.userInfo)")

return []
}
}

func saveContext() {
guard viewContext.hasChanges else {
return
}

do {
try viewContext.save()
postCalledSaveContext()
} catch let error as NSError {
print("Unresolved error: \(error), \(error.userInfo)")
}
}

func deleteItem(_ todo: ToDo) {
viewContext.delete(todo)
}

private func postCalledSaveContext() {
NotificationCenter.default
.post(
name: NSNotification.Name("CalledSaveContext"),
object: nil
)
}
}
Loading