From 373937b557f841fa20a88793e13f464e11d6233c Mon Sep 17 00:00:00 2001 From: ayoung1201 Date: Wed, 15 Nov 2023 19:59:46 +0900 Subject: [PATCH 1/8] ,, --- iOS_Study_B.xcodeproj/project.pbxproj | 37 ++++++++++++++++++- .../xcshareddata/swiftpm/Package.resolved | 14 +++++++ iOS_Study_B/SceneDelegate.swift | 7 +++- 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/iOS_Study_B.xcodeproj/project.pbxproj b/iOS_Study_B.xcodeproj/project.pbxproj index 9763af9..5d278c8 100644 --- a/iOS_Study_B.xcodeproj/project.pbxproj +++ b/iOS_Study_B.xcodeproj/project.pbxproj @@ -13,6 +13,8 @@ 954B6B882AC57DAA00FDCFAB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B862AC57DAA00FDCFAB /* Main.storyboard */; }; 954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */; }; 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */; }; + CC7D36DA2B04DA780069F109 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CC7D36D92B04DA780069F109 /* SnapKit */; }; + CC7D36DC2B04DA780069F109 /* SnapKit-Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = CC7D36DB2B04DA780069F109 /* SnapKit-Dynamic */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -31,6 +33,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + CC7D36DA2B04DA780069F109 /* SnapKit in Frameworks */, + CC7D36DC2B04DA780069F109 /* SnapKit-Dynamic in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -83,6 +87,10 @@ dependencies = ( ); name = iOS_Study_B; + packageProductDependencies = ( + CC7D36D92B04DA780069F109 /* SnapKit */, + CC7D36DB2B04DA780069F109 /* SnapKit-Dynamic */, + ); productName = iOS_Study_B; productReference = 954B6B7D2AC57DAA00FDCFAB /* iOS_Study_B.app */; productType = "com.apple.product-type.application"; @@ -111,6 +119,9 @@ Base, ); mainGroup = 954B6B742AC57DAA00FDCFAB; + packageReferences = ( + CC7D36D82B04DA780069F109 /* XCRemoteSwiftPackageReference "SnapKit" */, + ); productRefGroup = 954B6B7E2AC57DAA00FDCFAB /* Products */; projectDirPath = ""; projectRoot = ""; @@ -291,7 +302,6 @@ INFOPLIST_FILE = iOS_Study_B/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; LD_RUNPATH_SEARCH_PATHS = ( @@ -318,7 +328,6 @@ INFOPLIST_FILE = iOS_Study_B/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; LD_RUNPATH_SEARCH_PATHS = ( @@ -356,6 +365,30 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + CC7D36D82B04DA780069F109 /* XCRemoteSwiftPackageReference "SnapKit" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SnapKit/SnapKit.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.6.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + CC7D36D92B04DA780069F109 /* SnapKit */ = { + isa = XCSwiftPackageProductDependency; + package = CC7D36D82B04DA780069F109 /* XCRemoteSwiftPackageReference "SnapKit" */; + productName = SnapKit; + }; + CC7D36DB2B04DA780069F109 /* SnapKit-Dynamic */ = { + isa = XCSwiftPackageProductDependency; + package = CC7D36D82B04DA780069F109 /* XCRemoteSwiftPackageReference "SnapKit" */; + productName = "SnapKit-Dynamic"; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 954B6B752AC57DAA00FDCFAB /* Project object */; } diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..009c162 --- /dev/null +++ b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "snapkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SnapKit/SnapKit.git", + "state" : { + "revision" : "f222cbdf325885926566172f6f5f06af95473158", + "version" : "5.6.0" + } + } + ], + "version" : 2 +} diff --git a/iOS_Study_B/SceneDelegate.swift b/iOS_Study_B/SceneDelegate.swift index 9987c27..47a6be6 100644 --- a/iOS_Study_B/SceneDelegate.swift +++ b/iOS_Study_B/SceneDelegate.swift @@ -16,7 +16,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let _ = (scene as? UIWindowScene) else { return } + guard let windowScene = (scene as? UIWindowScene) else { return } + window = UIWindow(windowScene: windowScene) // SceneDelegate의 프로퍼티에 설정해줌 + let mainViewController = ViewController() // 맨 처음 보여줄 ViewController + + window?.rootViewController = mainViewController + window?.makeKeyAndVisible() } func sceneDidDisconnect(_ scene: UIScene) { From 369ed96a291e14505c73032efedd135ecfbf7745 Mon Sep 17 00:00:00 2001 From: ayoung1201 Date: Thu, 16 Nov 2023 13:08:32 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=EB=A9=94=EB=AA=A8=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EB=B0=8F=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS_Study_B.xcodeproj/project.pbxproj | 8 +++ iOS_Study_B/MemoTableViewCell.swift | 47 +++++++++++++++ iOS_Study_B/MemoViewController.swift | 86 +++++++++++++++++++++++++++ iOS_Study_B/SceneDelegate.swift | 12 ++-- iOS_Study_B/ViewController.swift | 75 +++++++++++++++++++++-- 5 files changed, 219 insertions(+), 9 deletions(-) create mode 100644 iOS_Study_B/MemoTableViewCell.swift create mode 100644 iOS_Study_B/MemoViewController.swift diff --git a/iOS_Study_B.xcodeproj/project.pbxproj b/iOS_Study_B.xcodeproj/project.pbxproj index 5d278c8..58ef319 100644 --- a/iOS_Study_B.xcodeproj/project.pbxproj +++ b/iOS_Study_B.xcodeproj/project.pbxproj @@ -15,6 +15,8 @@ 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */; }; CC7D36DA2B04DA780069F109 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CC7D36D92B04DA780069F109 /* SnapKit */; }; CC7D36DC2B04DA780069F109 /* SnapKit-Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = CC7D36DB2B04DA780069F109 /* SnapKit-Dynamic */; }; + CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */; }; + CC7D36E42B05A0D60069F109 /* MemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36E32B05A0D60069F109 /* MemoViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -26,6 +28,8 @@ 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 954B6B8C2AC57DAB00FDCFAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 954B6B8E2AC57DAB00FDCFAB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoTableViewCell.swift; sourceTree = ""; }; + CC7D36E32B05A0D60069F109 /* MemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,9 +64,11 @@ 954B6B7F2AC57DAA00FDCFAB /* iOS_Study_B */ = { isa = PBXGroup; children = ( + CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */, 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */, 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */, 954B6B842AC57DAA00FDCFAB /* ViewController.swift */, + CC7D36E32B05A0D60069F109 /* MemoViewController.swift */, 954B6B862AC57DAA00FDCFAB /* Main.storyboard */, 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */, 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */, @@ -151,7 +157,9 @@ files = ( 954B6B852AC57DAA00FDCFAB /* ViewController.swift in Sources */, 954B6B812AC57DAA00FDCFAB /* AppDelegate.swift in Sources */, + CC7D36E42B05A0D60069F109 /* MemoViewController.swift in Sources */, 954B6B832AC57DAA00FDCFAB /* SceneDelegate.swift in Sources */, + CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/iOS_Study_B/MemoTableViewCell.swift b/iOS_Study_B/MemoTableViewCell.swift new file mode 100644 index 0000000..89e5f3a --- /dev/null +++ b/iOS_Study_B/MemoTableViewCell.swift @@ -0,0 +1,47 @@ +// +// MemoTableViewCell.swift +// iOS_Study_B +// +// Created by 임아영 on 11/15/23. +// + +import UIKit +import SnapKit + +class MemoTableViewCell : UITableViewCell { + static let identifier = "MemoTableViewCell" + + let label : UILabel = { + let label = UILabel() + + return label + }() + + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + configureSubviews() + makeConstraints() + } + + override func awakeFromNib() { + super.awakeFromNib() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func configureSubviews() { + contentView.addSubview(label) + + } + + func makeConstraints() { + label.snp.makeConstraints{ make in + make.centerY.equalTo(contentView) + make.leading.equalTo(contentView).inset(15) + } + + } +} diff --git a/iOS_Study_B/MemoViewController.swift b/iOS_Study_B/MemoViewController.swift new file mode 100644 index 0000000..74584a9 --- /dev/null +++ b/iOS_Study_B/MemoViewController.swift @@ -0,0 +1,86 @@ +// +// MemoViewController.swift +// iOS_Study_B +// +// Created by 임아영 on 11/16/23. +// + +import UIKit +import SnapKit + +class MemoViewController: UIViewController { + + let textfield: UITextField = { + let textfield = UITextField() + textfield.placeholder = " 메모 입력" + textfield.font = UIFont.systemFont(ofSize: 20) + textfield.keyboardType = .default + textfield.layer.cornerRadius = 5.0 + textfield.layer.borderColor = UIColor.black.cgColor + textfield.layer.borderWidth = 1.0 + + return textfield + }() + + // 초기 메모 내용을 설정하기 위한 변수 + var initialMemoContent: String? + var memoIndex: Int? + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .white + navigationItem.title = "메모 작성" + + configureSubviews() + makeConstraints() + setNavigationBar() + + // 초기 메모 내용이 있다면 텍스트 필드에 설정 + if let initialContent = initialMemoContent { + textfield.text = initialContent + } + } + + func configureSubviews() { + view.addSubview(textfield) + } + + func makeConstraints() { + textfield.snp.makeConstraints { make in + make.height.equalTo(40.0) + make.top.equalTo(view.safeAreaLayoutGuide).inset(10) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(18) + } + } + + func setNavigationBar() { + let setButton = UIBarButtonItem(title: "작성하기", style: .plain, target: self, action: #selector(setButtonTapped)) + navigationItem.rightBarButtonItem = setButton + } + + var didUpdateMemo: ((String) -> Void)? + + @objc func setButtonTapped() { + if let content = textfield.text, !content.isEmpty { + if let viewController = navigationController?.viewControllers.first(where: { $0 is ViewController }) as? ViewController { + if let index = memoIndex { + //기존 메모 수정 + viewController.memos[index] = content + } else { + //새 메모 추가 + viewController.memos.append(content) + } + viewController.tableview.reloadData() + navigationController?.popViewController(animated: true) + } + } + } +} + +extension MemoViewController: UITextFieldDelegate { + func textFieldShouldReturn(_ textField: UITextField) -> Bool { + setButtonTapped() + + return true + } +} diff --git a/iOS_Study_B/SceneDelegate.swift b/iOS_Study_B/SceneDelegate.swift index 47a6be6..6b30d23 100644 --- a/iOS_Study_B/SceneDelegate.swift +++ b/iOS_Study_B/SceneDelegate.swift @@ -17,11 +17,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let windowScene = (scene as? UIWindowScene) else { return } - window = UIWindow(windowScene: windowScene) // SceneDelegate의 프로퍼티에 설정해줌 - let mainViewController = ViewController() // 맨 처음 보여줄 ViewController - - window?.rootViewController = mainViewController - window?.makeKeyAndVisible() + window = UIWindow(windowScene: windowScene) + + let mainViewController = ViewController() + let navigationController = UINavigationController(rootViewController: mainViewController) + + window?.rootViewController = navigationController + window?.makeKeyAndVisible() } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/iOS_Study_B/ViewController.swift b/iOS_Study_B/ViewController.swift index f3577b5..4382e55 100644 --- a/iOS_Study_B/ViewController.swift +++ b/iOS_Study_B/ViewController.swift @@ -4,16 +4,83 @@ // // Created by 박지윤 on 2023/09/28. // - +import SnapKit import UIKit class ViewController: UIViewController { - + + var memos: [String] = [] + + let tableview:UITableView = { + let table = UITableView() + table.register(MemoTableViewCell.self, forCellReuseIdentifier: MemoTableViewCell.identifier) + table.backgroundColor = .white + + return table + }() + override func viewDidLoad() { super.viewDidLoad() - // Do any additional setup after loading the view. + view.backgroundColor = .white + + configureSubviews() + makeConstraints() + + tableview.dataSource = self + tableview.delegate = self + + navigationItem.title = "메모장" + setNavigationBar() } + + func configureSubviews() { + view.addSubview(tableview) + } + + func makeConstraints() { + tableview.snp.makeConstraints { make in + make.edges.equalTo(view.safeAreaLayoutGuide) + } + } + + func setNavigationBar() { + let addButton = UIBarButtonItem(image: UIImage(systemName: "plus"), style: .plain, target: self, action: #selector(addButtonTapped)) + navigationItem.rightBarButtonItem = addButton + } + + @objc func addButtonTapped() { + let MemoViewController = MemoViewController() + self.navigationController?.pushViewController(MemoViewController, animated: true) + } + } - +extension ViewController : UITableViewDataSource, UITableViewDelegate{ + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return memos.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: MemoTableViewCell.identifier, for: indexPath) as? MemoTableViewCell else { return UITableViewCell() } + + cell.label.text = memos[indexPath.row] + + return cell + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let selectedMemo = memos[indexPath.row] + let memoViewController = MemoViewController() + memoViewController.initialMemoContent = selectedMemo + memoViewController.memoIndex = indexPath.row + memoViewController.didUpdateMemo = { [weak self] updatedMemo in + //메모 수정 시 업데이트 + guard let self = self, let index = self.memos.firstIndex(of: selectedMemo) else { return } + self.memos[index] = updatedMemo + self.tableview.reloadData() + } + navigationController?.pushViewController(memoViewController, animated: true) + } } + From 806d87f7116158ed00d74bc0f0e5e4ccb321190a Mon Sep 17 00:00:00 2001 From: ayoung1201 Date: Thu, 16 Nov 2023 13:15:30 +0900 Subject: [PATCH 3/8] tasks --- iOS_Study_B/ViewController.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iOS_Study_B/ViewController.swift b/iOS_Study_B/ViewController.swift index 4382e55..17e1ca3 100644 --- a/iOS_Study_B/ViewController.swift +++ b/iOS_Study_B/ViewController.swift @@ -9,7 +9,7 @@ import UIKit class ViewController: UIViewController { - var memos: [String] = [] + var tasks: [String] = [] let tableview:UITableView = { let table = UITableView() @@ -63,20 +63,20 @@ extension ViewController : UITableViewDataSource, UITableViewDelegate{ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: MemoTableViewCell.identifier, for: indexPath) as? MemoTableViewCell else { return UITableViewCell() } - cell.label.text = memos[indexPath.row] + cell.label.text = tasks[indexPath.row] return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let selectedMemo = memos[indexPath.row] + let selectedMemo = tasks[indexPath.row] let memoViewController = MemoViewController() memoViewController.initialMemoContent = selectedMemo memoViewController.memoIndex = indexPath.row memoViewController.didUpdateMemo = { [weak self] updatedMemo in //메모 수정 시 업데이트 - guard let self = self, let index = self.memos.firstIndex(of: selectedMemo) else { return } - self.memos[index] = updatedMemo + guard let self = self, let index = self.tasks.firstIndex(of: selectedMemo) else { return } + self.tasks[index] = updatedMemo self.tableview.reloadData() } navigationController?.pushViewController(memoViewController, animated: true) From 5f58b6e82995e92cfb29c88ca2c1f24155e5e635 Mon Sep 17 00:00:00 2001 From: ayoung1201 Date: Thu, 16 Nov 2023 13:17:43 +0900 Subject: [PATCH 4/8] task --- iOS_Study_B/MemoViewController.swift | 4 ++-- iOS_Study_B/ViewController.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iOS_Study_B/MemoViewController.swift b/iOS_Study_B/MemoViewController.swift index 74584a9..f2e0974 100644 --- a/iOS_Study_B/MemoViewController.swift +++ b/iOS_Study_B/MemoViewController.swift @@ -65,10 +65,10 @@ class MemoViewController: UIViewController { if let viewController = navigationController?.viewControllers.first(where: { $0 is ViewController }) as? ViewController { if let index = memoIndex { //기존 메모 수정 - viewController.memos[index] = content + viewController.tasks[index] = content } else { //새 메모 추가 - viewController.memos.append(content) + viewController.tasks.append(content) } viewController.tableview.reloadData() navigationController?.popViewController(animated: true) diff --git a/iOS_Study_B/ViewController.swift b/iOS_Study_B/ViewController.swift index 17e1ca3..499029a 100644 --- a/iOS_Study_B/ViewController.swift +++ b/iOS_Study_B/ViewController.swift @@ -57,7 +57,7 @@ class ViewController: UIViewController { extension ViewController : UITableViewDataSource, UITableViewDelegate{ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return memos.count + return tasks.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { From bdd128ef2fd982e7a907bb2dbf611c9521260f1e Mon Sep 17 00:00:00 2001 From: ayoung1201 Date: Thu, 23 Nov 2023 17:15:08 +0900 Subject: [PATCH 5/8] =?UTF-8?q?=EB=A9=94=EB=AA=A8=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS_Study_B.xcodeproj/project.pbxproj | 8 ++ iOS_Study_B/MemoDetailViewController.swift | 119 +++++++++++++++++++++ iOS_Study_B/MemoEditViewController.swift | 102 ++++++++++++++++++ iOS_Study_B/MemoTableViewCell.swift | 37 +++++-- iOS_Study_B/MemoViewController.swift | 91 +++++++++------- iOS_Study_B/ViewController.swift | 83 +++++++++----- 6 files changed, 364 insertions(+), 76 deletions(-) create mode 100644 iOS_Study_B/MemoDetailViewController.swift create mode 100644 iOS_Study_B/MemoEditViewController.swift diff --git a/iOS_Study_B.xcodeproj/project.pbxproj b/iOS_Study_B.xcodeproj/project.pbxproj index 58ef319..17b4f17 100644 --- a/iOS_Study_B.xcodeproj/project.pbxproj +++ b/iOS_Study_B.xcodeproj/project.pbxproj @@ -13,6 +13,8 @@ 954B6B882AC57DAA00FDCFAB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B862AC57DAA00FDCFAB /* Main.storyboard */; }; 954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */; }; 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */; }; + CC3EE7BB2B073A56009C5287 /* MemoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */; }; + CC3EE7BD2B073DF9009C5287 /* MemoEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */; }; CC7D36DA2B04DA780069F109 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CC7D36D92B04DA780069F109 /* SnapKit */; }; CC7D36DC2B04DA780069F109 /* SnapKit-Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = CC7D36DB2B04DA780069F109 /* SnapKit-Dynamic */; }; CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */; }; @@ -28,6 +30,8 @@ 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 954B6B8C2AC57DAB00FDCFAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 954B6B8E2AC57DAB00FDCFAB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoDetailViewController.swift; sourceTree = ""; }; + CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoEditViewController.swift; sourceTree = ""; }; CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoTableViewCell.swift; sourceTree = ""; }; CC7D36E32B05A0D60069F109 /* MemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -73,6 +77,8 @@ 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */, 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */, 954B6B8E2AC57DAB00FDCFAB /* Info.plist */, + CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */, + CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */, ); path = iOS_Study_B; sourceTree = ""; @@ -156,10 +162,12 @@ buildActionMask = 2147483647; files = ( 954B6B852AC57DAA00FDCFAB /* ViewController.swift in Sources */, + CC3EE7BB2B073A56009C5287 /* MemoDetailViewController.swift in Sources */, 954B6B812AC57DAA00FDCFAB /* AppDelegate.swift in Sources */, CC7D36E42B05A0D60069F109 /* MemoViewController.swift in Sources */, 954B6B832AC57DAA00FDCFAB /* SceneDelegate.swift in Sources */, CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */, + CC3EE7BD2B073DF9009C5287 /* MemoEditViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/iOS_Study_B/MemoDetailViewController.swift b/iOS_Study_B/MemoDetailViewController.swift new file mode 100644 index 0000000..838d47d --- /dev/null +++ b/iOS_Study_B/MemoDetailViewController.swift @@ -0,0 +1,119 @@ +// +// MemoDetailViewController.swift +// iOS_Study_B +// +// Created by 임아영 on 11/17/23. +// + +protocol MemoDetailDelegate: AnyObject { + func didUpdateDetailMemo(_ memo: Memo, atIndex index: Int) +} + +protocol MemoEditDelegate: AnyObject { + func didUpdateMemo(_ memo: Memo, atIndex: Int) +} + +extension MemoDetailViewController: MemoEditDelegate { + func didUpdateMemo(_ memo: Memo, atIndex: Int) { + displayMemo(memo) + } +} + + +import UIKit +import SnapKit + +class MemoDetailViewController: UIViewController { + + var memo: Memo? + var index: Int? + weak var delegate: MemoEditDelegate? + weak var detailDelegate: MemoDetailDelegate? + + + let Label1: UILabel = { + let label = UILabel() + label.font = UIFont.boldSystemFont(ofSize: 18) + return label + }() + + let Label2: UILabel = { + let label = UILabel() + label.font = UIFont.systemFont(ofSize: 16) + label.numberOfLines = 0 + return label + }() + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .white + + navigationItem.title = "메모 상세" + + configureSubviews() + makeConstraints() + setNavigationBar() + + if let memo = memo { + displayMemo(memo) + } + } + + func configureSubviews() { + view.addSubview(Label1) + view.addSubview(Label2) + + } + + func makeConstraints() { + Label1.snp.makeConstraints { make in + make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(20) + make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) + make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) + } + Label2.snp.makeConstraints { make in + make.top.equalTo(Label1.snp.bottom).offset(20) + make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) + make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) + } + } + + func setNavigationBar() { + let editButton = UIBarButtonItem(title: "수정하기", style: .plain, target: self, action: #selector(editButtonTapped)) + navigationItem.rightBarButtonItem = editButton + } + + @objc func editButtonTapped() { + let MemoEditViewController = MemoEditViewController() + + MemoEditViewController.memo = memo + MemoEditViewController.index = index + MemoEditViewController.delegate = self + self.navigationController?.pushViewController(MemoEditViewController, animated: true) + } + + @objc func backButtonTapped() { + guard let updatedMemo = createUpdatedMemo() else { + return + } + + detailDelegate?.didUpdateDetailMemo(updatedMemo, atIndex: index!) + self.navigationController?.popViewController(animated: true) + } + + func createUpdatedMemo() -> Memo? { + guard let updatedTitle = Label1.text, + let updatedContent = Label2.text else { + return nil + } + + return Memo(id: memo?.id, title: updatedTitle, content: updatedContent) + } + + func displayMemo(_ memo: Memo) { + Label1.text = memo.title + Label2.text = memo.content + } + } + + diff --git a/iOS_Study_B/MemoEditViewController.swift b/iOS_Study_B/MemoEditViewController.swift new file mode 100644 index 0000000..ad85503 --- /dev/null +++ b/iOS_Study_B/MemoEditViewController.swift @@ -0,0 +1,102 @@ +// +// MemoEditViewController.swift +// iOS_Study_B +// +// Created by 임아영 on 11/17/23. +// + + +import UIKit +import SnapKit + + +class MemoEditViewController: UIViewController { + + var memo: Memo? + var index: Int? + weak var delegate: MemoEditDelegate? + + let textfield: UITextField = { + let textfield = UITextField() + textfield.font = UIFont.systemFont(ofSize: 20) + textfield.keyboardType = .default + textfield.layer.cornerRadius = 5.0 + textfield.layer.borderColor = UIColor.black.cgColor + textfield.layer.borderWidth = 1.0 + + return textfield + }() + + let textfield2: UITextField = { + let textfield2 = UITextField() + textfield2.font = UIFont.systemFont(ofSize: 20) + textfield2.keyboardType = .default + textfield2.layer.cornerRadius = 5.0 + textfield2.layer.borderColor = UIColor.black.cgColor + textfield2.layer.borderWidth = 1.0 + + return textfield2 + }() + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .white + navigationItem.title = "메모 수정" + + configureSubviews() + makeConstraints() + setNavigationBar() + + if let memo = memo { + displayMemo(memo) + } + } + + func configureSubviews() { + view.addSubview(textfield) + view.addSubview(textfield2) + } + + func makeConstraints() { + textfield.snp.makeConstraints { make in + make.height.equalTo(40.0) + make.top.equalTo(view.safeAreaLayoutGuide).inset(10) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(18) + } + textfield2.snp.makeConstraints { make in + make.height.equalTo(40.0) + make.top.equalTo(view.safeAreaLayoutGuide).inset(60) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(18) + } + } + + func setNavigationBar() { + let setButton = UIBarButtonItem(title: "완료", style: .plain, target: self, action: #selector(setButtonTapped)) + navigationItem.rightBarButtonItem = setButton + } + + @objc func setButtonTapped() { + guard let updatedMemo = createUpdatedMemo(), + let delegate = delegate, + let index = index else { + return + } + delegate.didUpdateMemo(updatedMemo, atIndex: index) + self.navigationController?.popViewController(animated: true) + } + + func displayMemo(_ memo: Memo) { + textfield.text = memo.title + textfield2.text = memo.content + } + + func createUpdatedMemo() -> Memo? { + guard let updatedTitle = textfield.text, + let updatedContent = textfield2.text else { + return nil + } + + return Memo(id: memo?.id, title: updatedTitle, content: updatedContent) + } +} + diff --git a/iOS_Study_B/MemoTableViewCell.swift b/iOS_Study_B/MemoTableViewCell.swift index 89e5f3a..ec2af27 100644 --- a/iOS_Study_B/MemoTableViewCell.swift +++ b/iOS_Study_B/MemoTableViewCell.swift @@ -11,12 +11,21 @@ import SnapKit class MemoTableViewCell : UITableViewCell { static let identifier = "MemoTableViewCell" - let label : UILabel = { + let titleLabel: UILabel = { let label = UILabel() + label.font = UIFont.boldSystemFont(ofSize: 23) + + return label + }() + + let contentLabel: UILabel = { + let label = UILabel() + label.font = UIFont.systemFont(ofSize: 16) + label.numberOfLines = 1 return label - }() - + + }() override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) @@ -33,15 +42,23 @@ class MemoTableViewCell : UITableViewCell { } func configureSubviews() { - contentView.addSubview(label) - + contentView.addSubview(titleLabel) + contentView.addSubview(contentLabel) } func makeConstraints() { - label.snp.makeConstraints{ make in - make.centerY.equalTo(contentView) - make.leading.equalTo(contentView).inset(15) + titleLabel.snp.makeConstraints { make in + make.top.equalTo(contentView).inset(10) + make.leading.equalTo(contentView).inset(15) + } + contentLabel.snp.makeConstraints { make in + make.top.equalTo(titleLabel.snp.bottom).offset(10) + make.leading.equalTo(contentView).inset(15) + } + } + + func configure(with memo : Memo) { + titleLabel.text = memo.title + contentLabel.text = memo.content } - } -} diff --git a/iOS_Study_B/MemoViewController.swift b/iOS_Study_B/MemoViewController.swift index f2e0974..a4e8366 100644 --- a/iOS_Study_B/MemoViewController.swift +++ b/iOS_Study_B/MemoViewController.swift @@ -8,18 +8,37 @@ import UIKit import SnapKit +struct Memo : Identifiable { + var id: ObjectIdentifier? + var title: String? + var content: String? +} + + class MemoViewController: UIViewController { let textfield: UITextField = { - let textfield = UITextField() - textfield.placeholder = " 메모 입력" - textfield.font = UIFont.systemFont(ofSize: 20) - textfield.keyboardType = .default - textfield.layer.cornerRadius = 5.0 - textfield.layer.borderColor = UIColor.black.cgColor - textfield.layer.borderWidth = 1.0 + let textField = UITextField() + textField.placeholder = "제목 입력" + textField.font = UIFont.systemFont(ofSize: 20) + textField.keyboardType = .default + textField.layer.cornerRadius = 5.0 + textField.layer.borderColor = UIColor.black.cgColor + textField.layer.borderWidth = 1.0 + + return textField + }() + + let textfield2: UITextField = { + let textField = UITextField() + textField.placeholder = "내용 입력" + textField.font = UIFont.systemFont(ofSize: 20) + textField.keyboardType = .default + textField.layer.cornerRadius = 5.0 + textField.layer.borderColor = UIColor.black.cgColor + textField.layer.borderWidth = 1.0 - return textfield + return textField }() // 초기 메모 내용을 설정하기 위한 변수 @@ -34,53 +53,45 @@ class MemoViewController: UIViewController { configureSubviews() makeConstraints() setNavigationBar() - - // 초기 메모 내용이 있다면 텍스트 필드에 설정 - if let initialContent = initialMemoContent { - textfield.text = initialContent - } + } func configureSubviews() { view.addSubview(textfield) + view.addSubview(textfield2) } func makeConstraints() { textfield.snp.makeConstraints { make in + make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(20) + make.height.equalTo(40.0) + make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) + make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) + } + + textfield2.snp.makeConstraints { make in + make.top.equalTo(textfield.snp.bottom).offset(20) make.height.equalTo(40.0) - make.top.equalTo(view.safeAreaLayoutGuide).inset(10) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(18) + make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) + make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) } } func setNavigationBar() { - let setButton = UIBarButtonItem(title: "작성하기", style: .plain, target: self, action: #selector(setButtonTapped)) - navigationItem.rightBarButtonItem = setButton + let addButton = UIBarButtonItem(title: "작성하기", style: .plain, target: self, action: #selector(addButtonTapped)) + navigationItem.rightBarButtonItem = addButton } - var didUpdateMemo: ((String) -> Void)? - - @objc func setButtonTapped() { - if let content = textfield.text, !content.isEmpty { - if let viewController = navigationController?.viewControllers.first(where: { $0 is ViewController }) as? ViewController { - if let index = memoIndex { - //기존 메모 수정 - viewController.tasks[index] = content - } else { - //새 메모 추가 - viewController.tasks.append(content) + @objc func addButtonTapped() { + guard let title = textfield.text, let content = textfield2.text else { + return } - viewController.tableview.reloadData() - navigationController?.popViewController(animated: true) - } + let newMemo = Memo(id: ObjectIdentifier(self), title: title, content: content) + + if let viewController = navigationController?.viewControllers.first as? ViewController { + viewController.addMemo(newMemo) + } + + self.navigationController?.popViewController(animated: true) } } -} - -extension MemoViewController: UITextFieldDelegate { - func textFieldShouldReturn(_ textField: UITextField) -> Bool { - setButtonTapped() - - return true - } -} diff --git a/iOS_Study_B/ViewController.swift b/iOS_Study_B/ViewController.swift index 499029a..cd80754 100644 --- a/iOS_Study_B/ViewController.swift +++ b/iOS_Study_B/ViewController.swift @@ -9,7 +9,7 @@ import UIKit class ViewController: UIViewController { - var tasks: [String] = [] + var memos = [Memo]() let tableview:UITableView = { let table = UITableView() @@ -21,16 +21,20 @@ class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - view.backgroundColor = .white - configureSubviews() makeConstraints() + setNavigationBar() tableview.dataSource = self tableview.delegate = self + view.backgroundColor = .white + } + + func setNavigationBar() { + let addButton = UIBarButtonItem(image: UIImage(systemName: "plus"), style: .plain, target: self, action: #selector(addButtonTapped)) navigationItem.title = "메모장" - setNavigationBar() + navigationItem.rightBarButtonItem = addButton } func configureSubviews() { @@ -43,44 +47,71 @@ class ViewController: UIViewController { } } - func setNavigationBar() { - let addButton = UIBarButtonItem(image: UIImage(systemName: "plus"), style: .plain, target: self, action: #selector(addButtonTapped)) - navigationItem.rightBarButtonItem = addButton + @objc func addButtonTapped() { + let addMemoViewController = MemoViewController() + self.navigationController?.pushViewController(addMemoViewController, animated: true) } - @objc func addButtonTapped() { - let MemoViewController = MemoViewController() - self.navigationController?.pushViewController(MemoViewController, animated: true) - } - } + func addMemo(_ memo: Memo) { + memos.append(memo) + tableview.reloadData() + } + + func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { + let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { (_, _, completionHandler) in + + self.memos.remove(at: indexPath.row) + tableView.deleteRows(at: [indexPath], with: .fade) + completionHandler(true) + } + + return UISwipeActionsConfiguration(actions: [deleteAction]) + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let detailMemoViewController = MemoDetailViewController() + + detailMemoViewController.memo = memos[indexPath.row] + detailMemoViewController.index = indexPath.row + detailMemoViewController.delegate = self + + self.navigationController?.pushViewController(detailMemoViewController, animated: true) + } + +} extension ViewController : UITableViewDataSource, UITableViewDelegate{ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return tasks.count + return memos.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: MemoTableViewCell.identifier, for: indexPath) as? MemoTableViewCell else { return UITableViewCell() } - cell.label.text = tasks[indexPath.row] + let memo = memos[indexPath.row] + cell.configure(with: memo) return cell } - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let selectedMemo = tasks[indexPath.row] - let memoViewController = MemoViewController() - memoViewController.initialMemoContent = selectedMemo - memoViewController.memoIndex = indexPath.row - memoViewController.didUpdateMemo = { [weak self] updatedMemo in - //메모 수정 시 업데이트 - guard let self = self, let index = self.tasks.firstIndex(of: selectedMemo) else { return } - self.tasks[index] = updatedMemo - self.tableview.reloadData() - } - navigationController?.pushViewController(memoViewController, animated: true) + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 70 + } +} + + +extension ViewController: MemoEditDelegate { + func didUpdateMemo(_ memo: Memo, atIndex index: Int) { + memos[index] = memo + tableview.reloadData() } } +extension ViewController: MemoDetailDelegate { + func didUpdateDetailMemo(_ memo: Memo, atIndex index: Int) { + memos[index] = memo + tableview.reloadData() + } +} From a0dbbcfe394900a074314b022b8cd4c2e521d41a Mon Sep 17 00:00:00 2001 From: ayoung1201 Date: Tue, 28 Nov 2023 23:07:36 +0900 Subject: [PATCH 6/8] =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Icon\r" | 0 iOS_Study_B.xcodeproj/project.pbxproj | 34 ++++--------------- .../xcshareddata/WorkspaceSettings.xcsettings | 5 +++ iOS_Study_B/Base.lproj/Main.storyboard | 24 ------------- iOS_Study_B/Info.plist | 2 -- iOS_Study_B/MemoDetailViewController.swift | 28 ++++++++------- iOS_Study_B/MemoEditViewController.swift | 7 ++-- iOS_Study_B/ViewController.swift | 9 ----- 8 files changed, 29 insertions(+), 80 deletions(-) create mode 100644 "Icon\r" create mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings delete mode 100644 iOS_Study_B/Base.lproj/Main.storyboard diff --git "a/Icon\r" "b/Icon\r" new file mode 100644 index 0000000..e69de29 diff --git a/iOS_Study_B.xcodeproj/project.pbxproj b/iOS_Study_B.xcodeproj/project.pbxproj index 17b4f17..f57310a 100644 --- a/iOS_Study_B.xcodeproj/project.pbxproj +++ b/iOS_Study_B.xcodeproj/project.pbxproj @@ -10,13 +10,11 @@ 954B6B812AC57DAA00FDCFAB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */; }; 954B6B832AC57DAA00FDCFAB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */; }; 954B6B852AC57DAA00FDCFAB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B842AC57DAA00FDCFAB /* ViewController.swift */; }; - 954B6B882AC57DAA00FDCFAB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B862AC57DAA00FDCFAB /* Main.storyboard */; }; 954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */; }; 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */; }; CC3EE7BB2B073A56009C5287 /* MemoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */; }; CC3EE7BD2B073DF9009C5287 /* MemoEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */; }; - CC7D36DA2B04DA780069F109 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CC7D36D92B04DA780069F109 /* SnapKit */; }; - CC7D36DC2B04DA780069F109 /* SnapKit-Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = CC7D36DB2B04DA780069F109 /* SnapKit-Dynamic */; }; + CC72E1FD2B16185400353D28 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CC72E1FC2B16185400353D28 /* SnapKit */; }; CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */; }; CC7D36E42B05A0D60069F109 /* MemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36E32B05A0D60069F109 /* MemoViewController.swift */; }; /* End PBXBuildFile section */ @@ -26,7 +24,6 @@ 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 954B6B842AC57DAA00FDCFAB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 954B6B872AC57DAA00FDCFAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 954B6B8C2AC57DAB00FDCFAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 954B6B8E2AC57DAB00FDCFAB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -41,8 +38,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CC7D36DA2B04DA780069F109 /* SnapKit in Frameworks */, - CC7D36DC2B04DA780069F109 /* SnapKit-Dynamic in Frameworks */, + CC72E1FD2B16185400353D28 /* SnapKit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -73,7 +69,6 @@ 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */, 954B6B842AC57DAA00FDCFAB /* ViewController.swift */, CC7D36E32B05A0D60069F109 /* MemoViewController.swift */, - 954B6B862AC57DAA00FDCFAB /* Main.storyboard */, 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */, 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */, 954B6B8E2AC57DAB00FDCFAB /* Info.plist */, @@ -100,8 +95,7 @@ ); name = iOS_Study_B; packageProductDependencies = ( - CC7D36D92B04DA780069F109 /* SnapKit */, - CC7D36DB2B04DA780069F109 /* SnapKit-Dynamic */, + CC72E1FC2B16185400353D28 /* SnapKit */, ); productName = iOS_Study_B; productReference = 954B6B7D2AC57DAA00FDCFAB /* iOS_Study_B.app */; @@ -132,7 +126,7 @@ ); mainGroup = 954B6B742AC57DAA00FDCFAB; packageReferences = ( - CC7D36D82B04DA780069F109 /* XCRemoteSwiftPackageReference "SnapKit" */, + CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */, ); productRefGroup = 954B6B7E2AC57DAA00FDCFAB /* Products */; projectDirPath = ""; @@ -150,7 +144,6 @@ files = ( 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */, 954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */, - 954B6B882AC57DAA00FDCFAB /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -174,14 +167,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 954B6B862AC57DAA00FDCFAB /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 954B6B872AC57DAA00FDCFAB /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -383,7 +368,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - CC7D36D82B04DA780069F109 /* XCRemoteSwiftPackageReference "SnapKit" */ = { + CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SnapKit/SnapKit.git"; requirement = { @@ -394,16 +379,11 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - CC7D36D92B04DA780069F109 /* SnapKit */ = { + CC72E1FC2B16185400353D28 /* SnapKit */ = { isa = XCSwiftPackageProductDependency; - package = CC7D36D82B04DA780069F109 /* XCRemoteSwiftPackageReference "SnapKit" */; + package = CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */; productName = SnapKit; }; - CC7D36DB2B04DA780069F109 /* SnapKit-Dynamic */ = { - isa = XCSwiftPackageProductDependency; - package = CC7D36D82B04DA780069F109 /* XCRemoteSwiftPackageReference "SnapKit" */; - productName = "SnapKit-Dynamic"; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 954B6B752AC57DAA00FDCFAB /* Project object */; diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,5 @@ + + + + + diff --git a/iOS_Study_B/Base.lproj/Main.storyboard b/iOS_Study_B/Base.lproj/Main.storyboard deleted file mode 100644 index 25a7638..0000000 --- a/iOS_Study_B/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iOS_Study_B/Info.plist b/iOS_Study_B/Info.plist index dd3c9af..0eb786d 100644 --- a/iOS_Study_B/Info.plist +++ b/iOS_Study_B/Info.plist @@ -15,8 +15,6 @@ Default Configuration UISceneDelegateClassName $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main diff --git a/iOS_Study_B/MemoDetailViewController.swift b/iOS_Study_B/MemoDetailViewController.swift index 838d47d..5d7e854 100644 --- a/iOS_Study_B/MemoDetailViewController.swift +++ b/iOS_Study_B/MemoDetailViewController.swift @@ -5,18 +5,13 @@ // Created by 임아영 on 11/17/23. // -protocol MemoDetailDelegate: AnyObject { - func didUpdateDetailMemo(_ memo: Memo, atIndex index: Int) -} - protocol MemoEditDelegate: AnyObject { func didUpdateMemo(_ memo: Memo, atIndex: Int) } extension MemoDetailViewController: MemoEditDelegate { - func didUpdateMemo(_ memo: Memo, atIndex: Int) { - displayMemo(memo) - } + func didUpdateMemo(_ memo: Memo, atIndex: Int) { + } } @@ -28,8 +23,6 @@ class MemoDetailViewController: UIViewController { var memo: Memo? var index: Int? weak var delegate: MemoEditDelegate? - weak var detailDelegate: MemoDetailDelegate? - let Label1: UILabel = { let label = UILabel() @@ -59,6 +52,14 @@ class MemoDetailViewController: UIViewController { } } + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + if isMovingFromParent { + backButtonTapped() + } + } + func configureSubviews() { view.addSubview(Label1) view.addSubview(Label2) @@ -68,8 +69,7 @@ class MemoDetailViewController: UIViewController { func makeConstraints() { Label1.snp.makeConstraints { make in make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(20) - make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) - make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide.snp.leading).inset(20) } Label2.snp.makeConstraints { make in make.top.equalTo(Label1.snp.bottom).offset(20) @@ -97,10 +97,10 @@ class MemoDetailViewController: UIViewController { return } - detailDelegate?.didUpdateDetailMemo(updatedMemo, atIndex: index!) + delegate?.didUpdateMemo(updatedMemo, atIndex: index!) self.navigationController?.popViewController(animated: true) } - + func createUpdatedMemo() -> Memo? { guard let updatedTitle = Label1.text, let updatedContent = Label2.text else { @@ -117,3 +117,5 @@ class MemoDetailViewController: UIViewController { } + + diff --git a/iOS_Study_B/MemoEditViewController.swift b/iOS_Study_B/MemoEditViewController.swift index ad85503..dd9dc1b 100644 --- a/iOS_Study_B/MemoEditViewController.swift +++ b/iOS_Study_B/MemoEditViewController.swift @@ -9,7 +9,6 @@ import UIKit import SnapKit - class MemoEditViewController: UIViewController { var memo: Memo? @@ -76,12 +75,10 @@ class MemoEditViewController: UIViewController { } @objc func setButtonTapped() { - guard let updatedMemo = createUpdatedMemo(), - let delegate = delegate, - let index = index else { + guard let updatedMemo = createUpdatedMemo() else { return } - delegate.didUpdateMemo(updatedMemo, atIndex: index) + delegate?.didUpdateMemo(updatedMemo, atIndex: index!) self.navigationController?.popViewController(animated: true) } diff --git a/iOS_Study_B/ViewController.swift b/iOS_Study_B/ViewController.swift index cd80754..4a38ed2 100644 --- a/iOS_Study_B/ViewController.swift +++ b/iOS_Study_B/ViewController.swift @@ -100,18 +100,9 @@ extension ViewController : UITableViewDataSource, UITableViewDelegate{ } } - extension ViewController: MemoEditDelegate { func didUpdateMemo(_ memo: Memo, atIndex index: Int) { memos[index] = memo tableview.reloadData() } } - -extension ViewController: MemoDetailDelegate { - func didUpdateDetailMemo(_ memo: Memo, atIndex index: Int) { - memos[index] = memo - tableview.reloadData() - } -} - From aa7603fa29e036d1f8c84c3579e143ca18a45fc8 Mon Sep 17 00:00:00 2001 From: ayoung1201 Date: Tue, 28 Nov 2023 23:27:53 +0900 Subject: [PATCH 7/8] =?UTF-8?q?=EC=88=98=EC=A0=952?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ssumc-ios-issue-template.md | 17 - .github/pull_request_template.md | 8 - .gitignore | 91 ---- "Icon\r" | 0 README.md | 33 -- iOS_Study_B.xcodeproj/project.pbxproj | 390 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcshareddata/WorkspaceSettings.xcsettings | 5 - .../xcshareddata/swiftpm/Package.resolved | 14 - .../xcschemes/xcschememanagement.plist | 14 - iOS_Study_B/AppDelegate.swift | 36 -- .../AccentColor.colorset/Contents.json | 11 - .../AppIcon.appiconset/Contents.json | 13 - iOS_Study_B/Assets.xcassets/Contents.json | 6 - .../Base.lproj/LaunchScreen.storyboard | 25 -- iOS_Study_B/Info.plist | 23 -- iOS_Study_B/MemoDetailViewController.swift | 30 +- iOS_Study_B/MemoEditViewController.swift | 11 +- iOS_Study_B/MemoTableViewCell.swift | 64 --- iOS_Study_B/MemoViewController.swift | 97 ----- iOS_Study_B/SceneDelegate.swift | 59 --- iOS_Study_B/ViewController.swift | 108 ----- 23 files changed, 20 insertions(+), 1050 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/ssumc-ios-issue-template.md delete mode 100644 .github/pull_request_template.md delete mode 100644 .gitignore delete mode 100644 "Icon\r" delete mode 100644 README.md delete mode 100644 iOS_Study_B.xcodeproj/project.pbxproj delete mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings delete mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved delete mode 100644 iOS_Study_B.xcodeproj/xcuserdata/jiyoon.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 iOS_Study_B/AppDelegate.swift delete mode 100644 iOS_Study_B/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 iOS_Study_B/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 iOS_Study_B/Assets.xcassets/Contents.json delete mode 100644 iOS_Study_B/Base.lproj/LaunchScreen.storyboard delete mode 100644 iOS_Study_B/Info.plist delete mode 100644 iOS_Study_B/MemoTableViewCell.swift delete mode 100644 iOS_Study_B/MemoViewController.swift delete mode 100644 iOS_Study_B/SceneDelegate.swift delete mode 100644 iOS_Study_B/ViewController.swift diff --git a/.github/ISSUE_TEMPLATE/ssumc-ios-issue-template.md b/.github/ISSUE_TEMPLATE/ssumc-ios-issue-template.md deleted file mode 100644 index 2228158..0000000 --- a/.github/ISSUE_TEMPLATE/ssumc-ios-issue-template.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: SSUMC iOS Issue Template -about: 이슈 생성 기본 템플릿 -title: '' -labels: '' -assignees: '' - ---- - - - -## 💡 Description - - -## 📝 Progress -- [ ] todo ! - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 894b349..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,8 +0,0 @@ - - -## 💡 Description - - -## 📝 Progress -- [ ] todo ! - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 4f20167..0000000 --- a/.gitignore +++ /dev/null @@ -1,91 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## User settings -xcuserdata/ - -## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) -*.xcscmblueprint -*.xccheckout - -## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) -build/ -DerivedData/ -*.moved-aside -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 - -## Obj-C/Swift specific -*.hmap - -## App packaging -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -# *.xcodeproj -# -# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata -# hence it is not needed unless you have added a package configuration file to your project -# .swiftpm - -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ -# -# Add this line if you want to avoid checking in source code from the Xcode workspace -# *.xcworkspace - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build/ - -# Accio dependency management -Dependencies/ -.accio/ - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. -# Instead, use fastlane to re-generate the screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots/**/*.png -fastlane/test_output - -# Code Injection -# -# After new code Injection tools there's a generated folder /iOSInjectionProject -# https://github.com/johnno1962/injectionforxcode - -iOSInjectionProject/ -.DS_Store diff --git "a/Icon\r" "b/Icon\r" deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md deleted file mode 100644 index a8d5189..0000000 --- a/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# 🍎 iOS_Study_B -SSUMC 5기 iOS 스터디 B조 - -![umc+logo](https://github.com/SSUMC-5th-iOS/iOS_Study_B/assets/84546438/f45dbfa9-8783-42d9-b3b2-3323e6a442aa) - -## 💻 Member -| 김보미 | 임아영 | 정민지 | 황채웅 | -| :---------:|:----------:|:----------:|:----------:| -| 블루 | 마요 | 전얀 | 웅아 | -| [calledBlu](https://github.com/calledBlu) | [ayoung1201](https://github.com/ayoung1201) | [wjdalswl](https://github.com/wjdalswl) | [woonge0930](https://github.com/woonge0930) | - -## 📖 Workbook (프리마스터) -| 주차 | 내용 | 미션 | -| --- | --- | --- | -| 1주차 | `Platform` | 배달의 민족 홈 화면 구현하기(1) | -| 2주차 | `AutoLayout` | 배달의 민족 홈 화면 구현하기(2) | -| 3주차 | `TableView & CollectionView` | 당근마켓 홈 화면 구현하기(1) | -| 4주차 | `ScrollView` | 당근마켓 홈 화면 구현하기(2) | -| 5주차 | `View Transition with Data` | 배달의 민족 장바구니로 데이터 넘기 | -| 6주차 | `Open Source` | 라이브러리 2개 이상 사용해서 뷰 만들기 | -| 7주차 | `Token & Social Login` | 카카오 로그인 구현하기 | -| 8주차 | `DB & DBMS` | 간단한 로그인, 회원가입 화면 만들기 - UserDefaults | -| 9주차 | `Network` | Open API 활용하기 | -| 9주차 | `Instagram Clone Coding` | 인스타그램 클론 코딩하기 | - -## 🌳 branch 규칙 -`닉네임/주차` - - - ex) bibi/week1 - -## 👾 Udemy -- https://www.udemy.com/course/comgongbro_ios_clonecoding/ diff --git a/iOS_Study_B.xcodeproj/project.pbxproj b/iOS_Study_B.xcodeproj/project.pbxproj deleted file mode 100644 index f57310a..0000000 --- a/iOS_Study_B.xcodeproj/project.pbxproj +++ /dev/null @@ -1,390 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 56; - objects = { - -/* Begin PBXBuildFile section */ - 954B6B812AC57DAA00FDCFAB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */; }; - 954B6B832AC57DAA00FDCFAB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */; }; - 954B6B852AC57DAA00FDCFAB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B842AC57DAA00FDCFAB /* ViewController.swift */; }; - 954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */; }; - 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */; }; - CC3EE7BB2B073A56009C5287 /* MemoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */; }; - CC3EE7BD2B073DF9009C5287 /* MemoEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */; }; - CC72E1FD2B16185400353D28 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CC72E1FC2B16185400353D28 /* SnapKit */; }; - CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */; }; - CC7D36E42B05A0D60069F109 /* MemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36E32B05A0D60069F109 /* MemoViewController.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 954B6B7D2AC57DAA00FDCFAB /* iOS_Study_B.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOS_Study_B.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 954B6B842AC57DAA00FDCFAB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 954B6B8C2AC57DAB00FDCFAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 954B6B8E2AC57DAB00FDCFAB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoDetailViewController.swift; sourceTree = ""; }; - CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoEditViewController.swift; sourceTree = ""; }; - CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoTableViewCell.swift; sourceTree = ""; }; - CC7D36E32B05A0D60069F109 /* MemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewController.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 954B6B7A2AC57DAA00FDCFAB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - CC72E1FD2B16185400353D28 /* SnapKit in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 954B6B742AC57DAA00FDCFAB = { - isa = PBXGroup; - children = ( - 954B6B7F2AC57DAA00FDCFAB /* iOS_Study_B */, - 954B6B7E2AC57DAA00FDCFAB /* Products */, - ); - sourceTree = ""; - }; - 954B6B7E2AC57DAA00FDCFAB /* Products */ = { - isa = PBXGroup; - children = ( - 954B6B7D2AC57DAA00FDCFAB /* iOS_Study_B.app */, - ); - name = Products; - sourceTree = ""; - }; - 954B6B7F2AC57DAA00FDCFAB /* iOS_Study_B */ = { - isa = PBXGroup; - children = ( - CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */, - 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */, - 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */, - 954B6B842AC57DAA00FDCFAB /* ViewController.swift */, - CC7D36E32B05A0D60069F109 /* MemoViewController.swift */, - 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */, - 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */, - 954B6B8E2AC57DAB00FDCFAB /* Info.plist */, - CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */, - CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */, - ); - path = iOS_Study_B; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 954B6B7C2AC57DAA00FDCFAB /* iOS_Study_B */ = { - isa = PBXNativeTarget; - buildConfigurationList = 954B6B912AC57DAB00FDCFAB /* Build configuration list for PBXNativeTarget "iOS_Study_B" */; - buildPhases = ( - 954B6B792AC57DAA00FDCFAB /* Sources */, - 954B6B7A2AC57DAA00FDCFAB /* Frameworks */, - 954B6B7B2AC57DAA00FDCFAB /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = iOS_Study_B; - packageProductDependencies = ( - CC72E1FC2B16185400353D28 /* SnapKit */, - ); - productName = iOS_Study_B; - productReference = 954B6B7D2AC57DAA00FDCFAB /* iOS_Study_B.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 954B6B752AC57DAA00FDCFAB /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1430; - LastUpgradeCheck = 1430; - TargetAttributes = { - 954B6B7C2AC57DAA00FDCFAB = { - CreatedOnToolsVersion = 14.3.1; - }; - }; - }; - buildConfigurationList = 954B6B782AC57DAA00FDCFAB /* Build configuration list for PBXProject "iOS_Study_B" */; - compatibilityVersion = "Xcode 14.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 954B6B742AC57DAA00FDCFAB; - packageReferences = ( - CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */, - ); - productRefGroup = 954B6B7E2AC57DAA00FDCFAB /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 954B6B7C2AC57DAA00FDCFAB /* iOS_Study_B */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 954B6B7B2AC57DAA00FDCFAB /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */, - 954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 954B6B792AC57DAA00FDCFAB /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 954B6B852AC57DAA00FDCFAB /* ViewController.swift in Sources */, - CC3EE7BB2B073A56009C5287 /* MemoDetailViewController.swift in Sources */, - 954B6B812AC57DAA00FDCFAB /* AppDelegate.swift in Sources */, - CC7D36E42B05A0D60069F109 /* MemoViewController.swift in Sources */, - 954B6B832AC57DAA00FDCFAB /* SceneDelegate.swift in Sources */, - CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */, - CC3EE7BD2B073DF9009C5287 /* MemoEditViewController.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 954B6B8C2AC57DAB00FDCFAB /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 954B6B8F2AC57DAB00FDCFAB /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 954B6B902AC57DAB00FDCFAB /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 954B6B922AC57DAB00FDCFAB /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = iOS_Study_B/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "jiyoon.iOS-Study-B"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 954B6B932AC57DAB00FDCFAB /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = iOS_Study_B/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "jiyoon.iOS-Study-B"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 954B6B782AC57DAA00FDCFAB /* Build configuration list for PBXProject "iOS_Study_B" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 954B6B8F2AC57DAB00FDCFAB /* Debug */, - 954B6B902AC57DAB00FDCFAB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 954B6B912AC57DAB00FDCFAB /* Build configuration list for PBXNativeTarget "iOS_Study_B" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 954B6B922AC57DAB00FDCFAB /* Debug */, - 954B6B932AC57DAB00FDCFAB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/SnapKit/SnapKit.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 5.6.0; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - CC72E1FC2B16185400353D28 /* SnapKit */ = { - isa = XCSwiftPackageProductDependency; - package = CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */; - productName = SnapKit; - }; -/* End XCSwiftPackageProductDependency section */ - }; - rootObject = 954B6B752AC57DAA00FDCFAB /* Project object */; -} diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iOS_Study_B.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/iOS_Study_B.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 0c67376..0000000 --- a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 009c162..0000000 --- a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,14 +0,0 @@ -{ - "pins" : [ - { - "identity" : "snapkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/SnapKit/SnapKit.git", - "state" : { - "revision" : "f222cbdf325885926566172f6f5f06af95473158", - "version" : "5.6.0" - } - } - ], - "version" : 2 -} diff --git a/iOS_Study_B.xcodeproj/xcuserdata/jiyoon.xcuserdatad/xcschemes/xcschememanagement.plist b/iOS_Study_B.xcodeproj/xcuserdata/jiyoon.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 3e5066d..0000000 --- a/iOS_Study_B.xcodeproj/xcuserdata/jiyoon.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - iOS_Study_B.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/iOS_Study_B/AppDelegate.swift b/iOS_Study_B/AppDelegate.swift deleted file mode 100644 index 65a81cc..0000000 --- a/iOS_Study_B/AppDelegate.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// AppDelegate.swift -// iOS_Study_B -// -// Created by 박지윤 on 2023/09/28. -// - -import UIKit - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - // MARK: UISceneSession Lifecycle - - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. - } - - -} - diff --git a/iOS_Study_B/Assets.xcassets/AccentColor.colorset/Contents.json b/iOS_Study_B/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb87897..0000000 --- a/iOS_Study_B/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/iOS_Study_B/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOS_Study_B/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 13613e3..0000000 --- a/iOS_Study_B/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/iOS_Study_B/Assets.xcassets/Contents.json b/iOS_Study_B/Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/iOS_Study_B/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/iOS_Study_B/Base.lproj/LaunchScreen.storyboard b/iOS_Study_B/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e932..0000000 --- a/iOS_Study_B/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iOS_Study_B/Info.plist b/iOS_Study_B/Info.plist deleted file mode 100644 index 0eb786d..0000000 --- a/iOS_Study_B/Info.plist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - - - - - - diff --git a/iOS_Study_B/MemoDetailViewController.swift b/iOS_Study_B/MemoDetailViewController.swift index 5d7e854..34ae0ca 100644 --- a/iOS_Study_B/MemoDetailViewController.swift +++ b/iOS_Study_B/MemoDetailViewController.swift @@ -5,15 +5,6 @@ // Created by 임아영 on 11/17/23. // -protocol MemoEditDelegate: AnyObject { - func didUpdateMemo(_ memo: Memo, atIndex: Int) -} - -extension MemoDetailViewController: MemoEditDelegate { - func didUpdateMemo(_ memo: Memo, atIndex: Int) { - } -} - import UIKit import SnapKit @@ -69,8 +60,9 @@ class MemoDetailViewController: UIViewController { func makeConstraints() { Label1.snp.makeConstraints { make in make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(20) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide.snp.leading).inset(20) - } + make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) + make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) + } Label2.snp.makeConstraints { make in make.top.equalTo(Label1.snp.bottom).offset(20) make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) @@ -102,12 +94,12 @@ class MemoDetailViewController: UIViewController { } func createUpdatedMemo() -> Memo? { - guard let updatedTitle = Label1.text, - let updatedContent = Label2.text else { + guard let updatedLabel1 = Label1.text, + let updatedLabel2 = Label2.text else { return nil } - return Memo(id: memo?.id, title: updatedTitle, content: updatedContent) + return Memo(id: memo?.id, title: updatedLabel1, content: updatedLabel2) } func displayMemo(_ memo: Memo) { @@ -116,6 +108,12 @@ class MemoDetailViewController: UIViewController { } } +protocol MemoEditDelegate: AnyObject { + func didUpdateMemo(_ memo: Memo, atIndex: Int) +} - - +extension MemoDetailViewController: MemoEditDelegate { + func didUpdateMemo(_ memo: Memo, atIndex: Int) { + displayMemo(memo) + } +} diff --git a/iOS_Study_B/MemoEditViewController.swift b/iOS_Study_B/MemoEditViewController.swift index dd9dc1b..f0bcfa4 100644 --- a/iOS_Study_B/MemoEditViewController.swift +++ b/iOS_Study_B/MemoEditViewController.swift @@ -86,14 +86,15 @@ class MemoEditViewController: UIViewController { textfield.text = memo.title textfield2.text = memo.content } - + func createUpdatedMemo() -> Memo? { - guard let updatedTitle = textfield.text, - let updatedContent = textfield2.text else { + guard let updatedLabel1 = textfield.text, + let updatedLabel2 = textfield2.text else { return nil } - - return Memo(id: memo?.id, title: updatedTitle, content: updatedContent) + + return Memo(id: memo?.id, title: updatedLabel1, content: updatedLabel2) } + } diff --git a/iOS_Study_B/MemoTableViewCell.swift b/iOS_Study_B/MemoTableViewCell.swift deleted file mode 100644 index ec2af27..0000000 --- a/iOS_Study_B/MemoTableViewCell.swift +++ /dev/null @@ -1,64 +0,0 @@ -// -// MemoTableViewCell.swift -// iOS_Study_B -// -// Created by 임아영 on 11/15/23. -// - -import UIKit -import SnapKit - -class MemoTableViewCell : UITableViewCell { - static let identifier = "MemoTableViewCell" - - let titleLabel: UILabel = { - let label = UILabel() - label.font = UIFont.boldSystemFont(ofSize: 23) - - return label - }() - - let contentLabel: UILabel = { - let label = UILabel() - label.font = UIFont.systemFont(ofSize: 16) - label.numberOfLines = 1 - - return label - - }() - - override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - super.init(style: style, reuseIdentifier: reuseIdentifier) - configureSubviews() - makeConstraints() - } - - override func awakeFromNib() { - super.awakeFromNib() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - func configureSubviews() { - contentView.addSubview(titleLabel) - contentView.addSubview(contentLabel) - } - - func makeConstraints() { - titleLabel.snp.makeConstraints { make in - make.top.equalTo(contentView).inset(10) - make.leading.equalTo(contentView).inset(15) - } - contentLabel.snp.makeConstraints { make in - make.top.equalTo(titleLabel.snp.bottom).offset(10) - make.leading.equalTo(contentView).inset(15) - } - } - - func configure(with memo : Memo) { - titleLabel.text = memo.title - contentLabel.text = memo.content - } - } diff --git a/iOS_Study_B/MemoViewController.swift b/iOS_Study_B/MemoViewController.swift deleted file mode 100644 index a4e8366..0000000 --- a/iOS_Study_B/MemoViewController.swift +++ /dev/null @@ -1,97 +0,0 @@ -// -// MemoViewController.swift -// iOS_Study_B -// -// Created by 임아영 on 11/16/23. -// - -import UIKit -import SnapKit - -struct Memo : Identifiable { - var id: ObjectIdentifier? - var title: String? - var content: String? -} - - -class MemoViewController: UIViewController { - - let textfield: UITextField = { - let textField = UITextField() - textField.placeholder = "제목 입력" - textField.font = UIFont.systemFont(ofSize: 20) - textField.keyboardType = .default - textField.layer.cornerRadius = 5.0 - textField.layer.borderColor = UIColor.black.cgColor - textField.layer.borderWidth = 1.0 - - return textField - }() - - let textfield2: UITextField = { - let textField = UITextField() - textField.placeholder = "내용 입력" - textField.font = UIFont.systemFont(ofSize: 20) - textField.keyboardType = .default - textField.layer.cornerRadius = 5.0 - textField.layer.borderColor = UIColor.black.cgColor - textField.layer.borderWidth = 1.0 - - return textField - }() - - // 초기 메모 내용을 설정하기 위한 변수 - var initialMemoContent: String? - var memoIndex: Int? - - override func viewDidLoad() { - super.viewDidLoad() - view.backgroundColor = .white - navigationItem.title = "메모 작성" - - configureSubviews() - makeConstraints() - setNavigationBar() - - } - - func configureSubviews() { - view.addSubview(textfield) - view.addSubview(textfield2) - } - - func makeConstraints() { - textfield.snp.makeConstraints { make in - make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(20) - make.height.equalTo(40.0) - make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) - make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) - } - - textfield2.snp.makeConstraints { make in - make.top.equalTo(textfield.snp.bottom).offset(20) - make.height.equalTo(40.0) - make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) - make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) - } - } - - func setNavigationBar() { - let addButton = UIBarButtonItem(title: "작성하기", style: .plain, target: self, action: #selector(addButtonTapped)) - navigationItem.rightBarButtonItem = addButton - } - - @objc func addButtonTapped() { - guard let title = textfield.text, let content = textfield2.text else { - return - } - let newMemo = Memo(id: ObjectIdentifier(self), title: title, content: content) - - if let viewController = navigationController?.viewControllers.first as? ViewController { - viewController.addMemo(newMemo) - } - - self.navigationController?.popViewController(animated: true) - } - } diff --git a/iOS_Study_B/SceneDelegate.swift b/iOS_Study_B/SceneDelegate.swift deleted file mode 100644 index 6b30d23..0000000 --- a/iOS_Study_B/SceneDelegate.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// SceneDelegate.swift -// iOS_Study_B -// -// Created by 박지윤 on 2023/09/28. -// - -import UIKit - -class SceneDelegate: UIResponder, UIWindowSceneDelegate { - - var window: UIWindow? - - - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let windowScene = (scene as? UIWindowScene) else { return } - window = UIWindow(windowScene: windowScene) - - let mainViewController = ViewController() - let navigationController = UINavigationController(rootViewController: mainViewController) - - window?.rootViewController = navigationController - window?.makeKeyAndVisible() - } - - func sceneDidDisconnect(_ scene: UIScene) { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). - } - - func sceneDidBecomeActive(_ scene: UIScene) { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. - } - - func sceneWillResignActive(_ scene: UIScene) { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). - } - - func sceneWillEnterForeground(_ scene: UIScene) { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. - } - - func sceneDidEnterBackground(_ scene: UIScene) { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. - } - - -} - diff --git a/iOS_Study_B/ViewController.swift b/iOS_Study_B/ViewController.swift deleted file mode 100644 index 4a38ed2..0000000 --- a/iOS_Study_B/ViewController.swift +++ /dev/null @@ -1,108 +0,0 @@ -// -// ViewController.swift -// iOS_Study_B -// -// Created by 박지윤 on 2023/09/28. -// -import SnapKit -import UIKit - -class ViewController: UIViewController { - - var memos = [Memo]() - - let tableview:UITableView = { - let table = UITableView() - table.register(MemoTableViewCell.self, forCellReuseIdentifier: MemoTableViewCell.identifier) - table.backgroundColor = .white - - return table - }() - - override func viewDidLoad() { - super.viewDidLoad() - configureSubviews() - makeConstraints() - setNavigationBar() - - tableview.dataSource = self - tableview.delegate = self - - view.backgroundColor = .white - } - - func setNavigationBar() { - let addButton = UIBarButtonItem(image: UIImage(systemName: "plus"), style: .plain, target: self, action: #selector(addButtonTapped)) - navigationItem.title = "메모장" - navigationItem.rightBarButtonItem = addButton - } - - func configureSubviews() { - view.addSubview(tableview) - } - - func makeConstraints() { - tableview.snp.makeConstraints { make in - make.edges.equalTo(view.safeAreaLayoutGuide) - } - } - - @objc func addButtonTapped() { - let addMemoViewController = MemoViewController() - self.navigationController?.pushViewController(addMemoViewController, animated: true) - } - - func addMemo(_ memo: Memo) { - memos.append(memo) - tableview.reloadData() - } - - func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { - let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { (_, _, completionHandler) in - - self.memos.remove(at: indexPath.row) - tableView.deleteRows(at: [indexPath], with: .fade) - completionHandler(true) - } - - return UISwipeActionsConfiguration(actions: [deleteAction]) - } - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let detailMemoViewController = MemoDetailViewController() - - detailMemoViewController.memo = memos[indexPath.row] - detailMemoViewController.index = indexPath.row - detailMemoViewController.delegate = self - - self.navigationController?.pushViewController(detailMemoViewController, animated: true) - } - -} - -extension ViewController : UITableViewDataSource, UITableViewDelegate{ - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return memos.count - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell(withIdentifier: MemoTableViewCell.identifier, for: indexPath) as? MemoTableViewCell else { return UITableViewCell() } - - let memo = memos[indexPath.row] - cell.configure(with: memo) - - return cell - } - - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return 70 - } -} - -extension ViewController: MemoEditDelegate { - func didUpdateMemo(_ memo: Memo, atIndex index: Int) { - memos[index] = memo - tableview.reloadData() - } -} From 7f08dc805baae5c1facabbda880e77af6779a225 Mon Sep 17 00:00:00 2001 From: ayoung1201 Date: Thu, 30 Nov 2023 10:10:29 +0900 Subject: [PATCH 8/8] ,, --- .../ssumc-ios-issue-template.md | 17 + .github/pull_request_template.md | 8 + .gitignore | 91 ++++ "Icon\r" | 0 README.md | 33 ++ iOS_Study_B.xcodeproj/project.pbxproj | 390 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 5 + .../xcshareddata/swiftpm/Package.resolved | 14 + iOS_Study_B/AppDelegate.swift | 36 ++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 13 + iOS_Study_B/Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ iOS_Study_B/Info.plist | 23 ++ iOS_Study_B/MemoTableViewCell.swift | 64 +++ iOS_Study_B/MemoViewController.swift | 97 +++++ iOS_Study_B/SceneDelegate.swift | 59 +++ iOS_Study_B/ViewController.swift | 108 +++++ 20 files changed, 1015 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/ssumc-ios-issue-template.md create mode 100644 .github/pull_request_template.md create mode 100644 .gitignore create mode 100644 "Icon\r" create mode 100644 README.md create mode 100644 iOS_Study_B.xcodeproj/project.pbxproj create mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 iOS_Study_B/AppDelegate.swift create mode 100644 iOS_Study_B/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 iOS_Study_B/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 iOS_Study_B/Assets.xcassets/Contents.json create mode 100644 iOS_Study_B/Base.lproj/LaunchScreen.storyboard create mode 100644 iOS_Study_B/Info.plist create mode 100644 iOS_Study_B/MemoTableViewCell.swift create mode 100644 iOS_Study_B/MemoViewController.swift create mode 100644 iOS_Study_B/SceneDelegate.swift create mode 100644 iOS_Study_B/ViewController.swift diff --git a/.github/ISSUE_TEMPLATE/ssumc-ios-issue-template.md b/.github/ISSUE_TEMPLATE/ssumc-ios-issue-template.md new file mode 100644 index 0000000..2228158 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ssumc-ios-issue-template.md @@ -0,0 +1,17 @@ +--- +name: SSUMC iOS Issue Template +about: 이슈 생성 기본 템플릿 +title: '' +labels: '' +assignees: '' + +--- + + + +## 💡 Description + + +## 📝 Progress +- [ ] todo ! + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..894b349 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,8 @@ + + +## 💡 Description + + +## 📝 Progress +- [ ] todo ! + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4f20167 --- /dev/null +++ b/.gitignore @@ -0,0 +1,91 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ +# +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ +.DS_Store diff --git "a/Icon\r" "b/Icon\r" new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..a8d5189 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# 🍎 iOS_Study_B +SSUMC 5기 iOS 스터디 B조 + +![umc+logo](https://github.com/SSUMC-5th-iOS/iOS_Study_B/assets/84546438/f45dbfa9-8783-42d9-b3b2-3323e6a442aa) + +## 💻 Member +| 김보미 | 임아영 | 정민지 | 황채웅 | +| :---------:|:----------:|:----------:|:----------:| +| 블루 | 마요 | 전얀 | 웅아 | +| [calledBlu](https://github.com/calledBlu) | [ayoung1201](https://github.com/ayoung1201) | [wjdalswl](https://github.com/wjdalswl) | [woonge0930](https://github.com/woonge0930) | + +## 📖 Workbook (프리마스터) +| 주차 | 내용 | 미션 | +| --- | --- | --- | +| 1주차 | `Platform` | 배달의 민족 홈 화면 구현하기(1) | +| 2주차 | `AutoLayout` | 배달의 민족 홈 화면 구현하기(2) | +| 3주차 | `TableView & CollectionView` | 당근마켓 홈 화면 구현하기(1) | +| 4주차 | `ScrollView` | 당근마켓 홈 화면 구현하기(2) | +| 5주차 | `View Transition with Data` | 배달의 민족 장바구니로 데이터 넘기 | +| 6주차 | `Open Source` | 라이브러리 2개 이상 사용해서 뷰 만들기 | +| 7주차 | `Token & Social Login` | 카카오 로그인 구현하기 | +| 8주차 | `DB & DBMS` | 간단한 로그인, 회원가입 화면 만들기 - UserDefaults | +| 9주차 | `Network` | Open API 활용하기 | +| 9주차 | `Instagram Clone Coding` | 인스타그램 클론 코딩하기 | + +## 🌳 branch 규칙 +`닉네임/주차` + + + ex) bibi/week1 + +## 👾 Udemy +- https://www.udemy.com/course/comgongbro_ios_clonecoding/ diff --git a/iOS_Study_B.xcodeproj/project.pbxproj b/iOS_Study_B.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f57310a --- /dev/null +++ b/iOS_Study_B.xcodeproj/project.pbxproj @@ -0,0 +1,390 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 954B6B812AC57DAA00FDCFAB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */; }; + 954B6B832AC57DAA00FDCFAB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */; }; + 954B6B852AC57DAA00FDCFAB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954B6B842AC57DAA00FDCFAB /* ViewController.swift */; }; + 954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */; }; + 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */; }; + CC3EE7BB2B073A56009C5287 /* MemoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */; }; + CC3EE7BD2B073DF9009C5287 /* MemoEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */; }; + CC72E1FD2B16185400353D28 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CC72E1FC2B16185400353D28 /* SnapKit */; }; + CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */; }; + CC7D36E42B05A0D60069F109 /* MemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7D36E32B05A0D60069F109 /* MemoViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 954B6B7D2AC57DAA00FDCFAB /* iOS_Study_B.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOS_Study_B.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 954B6B842AC57DAA00FDCFAB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 954B6B8C2AC57DAB00FDCFAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 954B6B8E2AC57DAB00FDCFAB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoDetailViewController.swift; sourceTree = ""; }; + CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoEditViewController.swift; sourceTree = ""; }; + CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoTableViewCell.swift; sourceTree = ""; }; + CC7D36E32B05A0D60069F109 /* MemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 954B6B7A2AC57DAA00FDCFAB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CC72E1FD2B16185400353D28 /* SnapKit in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 954B6B742AC57DAA00FDCFAB = { + isa = PBXGroup; + children = ( + 954B6B7F2AC57DAA00FDCFAB /* iOS_Study_B */, + 954B6B7E2AC57DAA00FDCFAB /* Products */, + ); + sourceTree = ""; + }; + 954B6B7E2AC57DAA00FDCFAB /* Products */ = { + isa = PBXGroup; + children = ( + 954B6B7D2AC57DAA00FDCFAB /* iOS_Study_B.app */, + ); + name = Products; + sourceTree = ""; + }; + 954B6B7F2AC57DAA00FDCFAB /* iOS_Study_B */ = { + isa = PBXGroup; + children = ( + CC7D36DD2B04E1380069F109 /* MemoTableViewCell.swift */, + 954B6B802AC57DAA00FDCFAB /* AppDelegate.swift */, + 954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */, + 954B6B842AC57DAA00FDCFAB /* ViewController.swift */, + CC7D36E32B05A0D60069F109 /* MemoViewController.swift */, + 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */, + 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */, + 954B6B8E2AC57DAB00FDCFAB /* Info.plist */, + CC3EE7BA2B073A56009C5287 /* MemoDetailViewController.swift */, + CC3EE7BC2B073DF9009C5287 /* MemoEditViewController.swift */, + ); + path = iOS_Study_B; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 954B6B7C2AC57DAA00FDCFAB /* iOS_Study_B */ = { + isa = PBXNativeTarget; + buildConfigurationList = 954B6B912AC57DAB00FDCFAB /* Build configuration list for PBXNativeTarget "iOS_Study_B" */; + buildPhases = ( + 954B6B792AC57DAA00FDCFAB /* Sources */, + 954B6B7A2AC57DAA00FDCFAB /* Frameworks */, + 954B6B7B2AC57DAA00FDCFAB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = iOS_Study_B; + packageProductDependencies = ( + CC72E1FC2B16185400353D28 /* SnapKit */, + ); + productName = iOS_Study_B; + productReference = 954B6B7D2AC57DAA00FDCFAB /* iOS_Study_B.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 954B6B752AC57DAA00FDCFAB /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1430; + TargetAttributes = { + 954B6B7C2AC57DAA00FDCFAB = { + CreatedOnToolsVersion = 14.3.1; + }; + }; + }; + buildConfigurationList = 954B6B782AC57DAA00FDCFAB /* Build configuration list for PBXProject "iOS_Study_B" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 954B6B742AC57DAA00FDCFAB; + packageReferences = ( + CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */, + ); + productRefGroup = 954B6B7E2AC57DAA00FDCFAB /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 954B6B7C2AC57DAA00FDCFAB /* iOS_Study_B */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 954B6B7B2AC57DAA00FDCFAB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */, + 954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 954B6B792AC57DAA00FDCFAB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 954B6B852AC57DAA00FDCFAB /* ViewController.swift in Sources */, + CC3EE7BB2B073A56009C5287 /* MemoDetailViewController.swift in Sources */, + 954B6B812AC57DAA00FDCFAB /* AppDelegate.swift in Sources */, + CC7D36E42B05A0D60069F109 /* MemoViewController.swift in Sources */, + 954B6B832AC57DAA00FDCFAB /* SceneDelegate.swift in Sources */, + CC7D36DE2B04E1380069F109 /* MemoTableViewCell.swift in Sources */, + CC3EE7BD2B073DF9009C5287 /* MemoEditViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 954B6B8C2AC57DAB00FDCFAB /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 954B6B8F2AC57DAB00FDCFAB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 954B6B902AC57DAB00FDCFAB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 954B6B922AC57DAB00FDCFAB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iOS_Study_B/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "jiyoon.iOS-Study-B"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 954B6B932AC57DAB00FDCFAB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iOS_Study_B/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "jiyoon.iOS-Study-B"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 954B6B782AC57DAA00FDCFAB /* Build configuration list for PBXProject "iOS_Study_B" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 954B6B8F2AC57DAB00FDCFAB /* Debug */, + 954B6B902AC57DAB00FDCFAB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 954B6B912AC57DAB00FDCFAB /* Build configuration list for PBXNativeTarget "iOS_Study_B" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 954B6B922AC57DAB00FDCFAB /* Debug */, + 954B6B932AC57DAB00FDCFAB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SnapKit/SnapKit.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.6.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + CC72E1FC2B16185400353D28 /* SnapKit */ = { + isa = XCSwiftPackageProductDependency; + package = CC72E1FB2B16185400353D28 /* XCRemoteSwiftPackageReference "SnapKit" */; + productName = SnapKit; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 954B6B752AC57DAA00FDCFAB /* Project object */; +} diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iOS_Study_B.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/iOS_Study_B.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,5 @@ + + + + + diff --git a/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..009c162 --- /dev/null +++ b/iOS_Study_B.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "snapkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SnapKit/SnapKit.git", + "state" : { + "revision" : "f222cbdf325885926566172f6f5f06af95473158", + "version" : "5.6.0" + } + } + ], + "version" : 2 +} diff --git a/iOS_Study_B/AppDelegate.swift b/iOS_Study_B/AppDelegate.swift new file mode 100644 index 0000000..65a81cc --- /dev/null +++ b/iOS_Study_B/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// iOS_Study_B +// +// Created by 박지윤 on 2023/09/28. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/iOS_Study_B/Assets.xcassets/AccentColor.colorset/Contents.json b/iOS_Study_B/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/iOS_Study_B/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOS_Study_B/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOS_Study_B/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/iOS_Study_B/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOS_Study_B/Assets.xcassets/Contents.json b/iOS_Study_B/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/iOS_Study_B/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOS_Study_B/Base.lproj/LaunchScreen.storyboard b/iOS_Study_B/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/iOS_Study_B/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS_Study_B/Info.plist b/iOS_Study_B/Info.plist new file mode 100644 index 0000000..0eb786d --- /dev/null +++ b/iOS_Study_B/Info.plist @@ -0,0 +1,23 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + + diff --git a/iOS_Study_B/MemoTableViewCell.swift b/iOS_Study_B/MemoTableViewCell.swift new file mode 100644 index 0000000..ec2af27 --- /dev/null +++ b/iOS_Study_B/MemoTableViewCell.swift @@ -0,0 +1,64 @@ +// +// MemoTableViewCell.swift +// iOS_Study_B +// +// Created by 임아영 on 11/15/23. +// + +import UIKit +import SnapKit + +class MemoTableViewCell : UITableViewCell { + static let identifier = "MemoTableViewCell" + + let titleLabel: UILabel = { + let label = UILabel() + label.font = UIFont.boldSystemFont(ofSize: 23) + + return label + }() + + let contentLabel: UILabel = { + let label = UILabel() + label.font = UIFont.systemFont(ofSize: 16) + label.numberOfLines = 1 + + return label + + }() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + configureSubviews() + makeConstraints() + } + + override func awakeFromNib() { + super.awakeFromNib() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func configureSubviews() { + contentView.addSubview(titleLabel) + contentView.addSubview(contentLabel) + } + + func makeConstraints() { + titleLabel.snp.makeConstraints { make in + make.top.equalTo(contentView).inset(10) + make.leading.equalTo(contentView).inset(15) + } + contentLabel.snp.makeConstraints { make in + make.top.equalTo(titleLabel.snp.bottom).offset(10) + make.leading.equalTo(contentView).inset(15) + } + } + + func configure(with memo : Memo) { + titleLabel.text = memo.title + contentLabel.text = memo.content + } + } diff --git a/iOS_Study_B/MemoViewController.swift b/iOS_Study_B/MemoViewController.swift new file mode 100644 index 0000000..a4e8366 --- /dev/null +++ b/iOS_Study_B/MemoViewController.swift @@ -0,0 +1,97 @@ +// +// MemoViewController.swift +// iOS_Study_B +// +// Created by 임아영 on 11/16/23. +// + +import UIKit +import SnapKit + +struct Memo : Identifiable { + var id: ObjectIdentifier? + var title: String? + var content: String? +} + + +class MemoViewController: UIViewController { + + let textfield: UITextField = { + let textField = UITextField() + textField.placeholder = "제목 입력" + textField.font = UIFont.systemFont(ofSize: 20) + textField.keyboardType = .default + textField.layer.cornerRadius = 5.0 + textField.layer.borderColor = UIColor.black.cgColor + textField.layer.borderWidth = 1.0 + + return textField + }() + + let textfield2: UITextField = { + let textField = UITextField() + textField.placeholder = "내용 입력" + textField.font = UIFont.systemFont(ofSize: 20) + textField.keyboardType = .default + textField.layer.cornerRadius = 5.0 + textField.layer.borderColor = UIColor.black.cgColor + textField.layer.borderWidth = 1.0 + + return textField + }() + + // 초기 메모 내용을 설정하기 위한 변수 + var initialMemoContent: String? + var memoIndex: Int? + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .white + navigationItem.title = "메모 작성" + + configureSubviews() + makeConstraints() + setNavigationBar() + + } + + func configureSubviews() { + view.addSubview(textfield) + view.addSubview(textfield2) + } + + func makeConstraints() { + textfield.snp.makeConstraints { make in + make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(20) + make.height.equalTo(40.0) + make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) + make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) + } + + textfield2.snp.makeConstraints { make in + make.top.equalTo(textfield.snp.bottom).offset(20) + make.height.equalTo(40.0) + make.leading.equalTo(view.safeAreaLayoutGuide.snp.leading).offset(20) + make.trailing.equalTo(view.safeAreaLayoutGuide.snp.trailing).offset(-20) + } + } + + func setNavigationBar() { + let addButton = UIBarButtonItem(title: "작성하기", style: .plain, target: self, action: #selector(addButtonTapped)) + navigationItem.rightBarButtonItem = addButton + } + + @objc func addButtonTapped() { + guard let title = textfield.text, let content = textfield2.text else { + return + } + let newMemo = Memo(id: ObjectIdentifier(self), title: title, content: content) + + if let viewController = navigationController?.viewControllers.first as? ViewController { + viewController.addMemo(newMemo) + } + + self.navigationController?.popViewController(animated: true) + } + } diff --git a/iOS_Study_B/SceneDelegate.swift b/iOS_Study_B/SceneDelegate.swift new file mode 100644 index 0000000..6b30d23 --- /dev/null +++ b/iOS_Study_B/SceneDelegate.swift @@ -0,0 +1,59 @@ +// +// SceneDelegate.swift +// iOS_Study_B +// +// Created by 박지윤 on 2023/09/28. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let windowScene = (scene as? UIWindowScene) else { return } + window = UIWindow(windowScene: windowScene) + + let mainViewController = ViewController() + let navigationController = UINavigationController(rootViewController: mainViewController) + + window?.rootViewController = navigationController + window?.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/iOS_Study_B/ViewController.swift b/iOS_Study_B/ViewController.swift new file mode 100644 index 0000000..4a38ed2 --- /dev/null +++ b/iOS_Study_B/ViewController.swift @@ -0,0 +1,108 @@ +// +// ViewController.swift +// iOS_Study_B +// +// Created by 박지윤 on 2023/09/28. +// +import SnapKit +import UIKit + +class ViewController: UIViewController { + + var memos = [Memo]() + + let tableview:UITableView = { + let table = UITableView() + table.register(MemoTableViewCell.self, forCellReuseIdentifier: MemoTableViewCell.identifier) + table.backgroundColor = .white + + return table + }() + + override func viewDidLoad() { + super.viewDidLoad() + configureSubviews() + makeConstraints() + setNavigationBar() + + tableview.dataSource = self + tableview.delegate = self + + view.backgroundColor = .white + } + + func setNavigationBar() { + let addButton = UIBarButtonItem(image: UIImage(systemName: "plus"), style: .plain, target: self, action: #selector(addButtonTapped)) + navigationItem.title = "메모장" + navigationItem.rightBarButtonItem = addButton + } + + func configureSubviews() { + view.addSubview(tableview) + } + + func makeConstraints() { + tableview.snp.makeConstraints { make in + make.edges.equalTo(view.safeAreaLayoutGuide) + } + } + + @objc func addButtonTapped() { + let addMemoViewController = MemoViewController() + self.navigationController?.pushViewController(addMemoViewController, animated: true) + } + + func addMemo(_ memo: Memo) { + memos.append(memo) + tableview.reloadData() + } + + func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { + let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { (_, _, completionHandler) in + + self.memos.remove(at: indexPath.row) + tableView.deleteRows(at: [indexPath], with: .fade) + completionHandler(true) + } + + return UISwipeActionsConfiguration(actions: [deleteAction]) + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let detailMemoViewController = MemoDetailViewController() + + detailMemoViewController.memo = memos[indexPath.row] + detailMemoViewController.index = indexPath.row + detailMemoViewController.delegate = self + + self.navigationController?.pushViewController(detailMemoViewController, animated: true) + } + +} + +extension ViewController : UITableViewDataSource, UITableViewDelegate{ + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return memos.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: MemoTableViewCell.identifier, for: indexPath) as? MemoTableViewCell else { return UITableViewCell() } + + let memo = memos[indexPath.row] + cell.configure(with: memo) + + return cell + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 70 + } +} + +extension ViewController: MemoEditDelegate { + func didUpdateMemo(_ memo: Memo, atIndex index: Int) { + memos[index] = memo + tableview.reloadData() + } +}