From ce298176213e981b90fdcf95c5473aa5b8f80050 Mon Sep 17 00:00:00 2001 From: k2645 Date: Thu, 5 Dec 2024 20:49:17 +0900 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=EC=97=90?= =?UTF-8?q?=20=EA=B7=B8=EB=A6=BC=EA=B7=B8=EB=A6=AC=EA=B8=B0=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20isHidden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/EditPhoto/EditPhotoViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift index 1cb6141..677bcf1 100644 --- a/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift @@ -106,6 +106,7 @@ final class EditPhotoViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + drawButton.isHidden = true configureNavigationAppearance() } From f8f3a6367448f16785ec7aed8f099f430c880a2c Mon Sep 17 00:00:00 2001 From: k2645 Date: Thu, 5 Dec 2024 20:51:37 +0900 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20drag=20&=20drop=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MHPresentation/Source/Home/View/HomeViewController.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/Home/View/HomeViewController.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/Home/View/HomeViewController.swift index 24028d4..865c4f5 100644 --- a/MemorialHouse/MHPresentation/MHPresentation/Source/Home/View/HomeViewController.swift +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/Home/View/HomeViewController.swift @@ -79,8 +79,6 @@ public final class HomeViewController: UIViewController { view.backgroundColor = .baseBackground collectionView.delegate = self collectionView.dataSource = self - collectionView.dragDelegate = self - collectionView.dropDelegate = self collectionView.register( BookCollectionViewCell.self, forCellWithReuseIdentifier: BookCollectionViewCell.identifier From ad3a1efa915b7c2c30ba033876662dce1b56f757 Mon Sep 17 00:00:00 2001 From: k2645 Date: Thu, 5 Dec 2024 21:08:04 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=EC=88=98=EC=A0=95=20=EB=B7=B0?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=8A=A4=ED=81=AC=EB=A1=A4=EC=8B=9C=20?= =?UTF-8?q?=EB=B0=94=EB=A1=9C=20=ED=82=A4=EB=B3=B4=EB=93=9C=20=EB=82=B4?= =?UTF-8?q?=EB=A0=A4=EA=B0=80=EB=8A=94=20=EA=B8=B0=EB=8A=A5=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 --- .../Source/EditBook/View/EditBookViewController.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/EditBook/View/EditBookViewController.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/EditBook/View/EditBookViewController.swift index 8c9df5c..4416630 100644 --- a/MemorialHouse/MHPresentation/MHPresentation/Source/EditBook/View/EditBookViewController.swift +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/EditBook/View/EditBookViewController.swift @@ -195,8 +195,7 @@ final class EditBookViewController: UIViewController { leading: editPageTableView.leadingAnchor, constantLeading: 10, height: 40 ) - buttonStackViewBottomConstraint - = buttonStackView.bottomAnchor.constraint( + buttonStackViewBottomConstraint = buttonStackView.bottomAnchor.constraint( equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: Self.buttonBottomConstant ) @@ -221,7 +220,7 @@ final class EditBookViewController: UIViewController { object: nil ) // 스크롤이 될 때 키보드 내려가게 설정 - editPageTableView.keyboardDismissMode = .onDrag + editPageTableView.keyboardDismissMode = .interactive } private func configureBinding() { let output = viewModel.transform(input: input.eraseToAnyPublisher()) From bb5cccc443c0a917a5ab23c7f465225e979b49fa Mon Sep 17 00:00:00 2001 From: k2645 Date: Thu, 5 Dec 2024 21:10:22 +0900 Subject: [PATCH 4/5] =?UTF-8?q?chore:=20=EC=95=B1=20=EB=B2=84=EC=A0=84=200?= =?UTF-8?q?.6=EC=9C=BC=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MHApplication/MHApplication.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj b/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj index 10ac92b..f578ac0 100644 --- a/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj @@ -243,7 +243,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.4; + MARKETING_VERSION = 0.6; PRODUCT_BUNDLE_IDENTIFIER = kr.codesquad.boostcamp9.MemorialHouse; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -281,7 +281,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.4; + MARKETING_VERSION = 0.6; PRODUCT_BUNDLE_IDENTIFIER = kr.codesquad.boostcamp9.MemorialHouse; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; From 0188cd935b0ed78c2d58bef8d0fd815853db2378 Mon Sep 17 00:00:00 2001 From: k2645 Date: Thu, 5 Dec 2024 21:48:26 +0900 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoreDataBookCoverStorageTests.swift | 10 ++++----- .../HomeViewModelTest.swift | 22 +++++++++++-------- .../TestDoubles/StubBookCoverUseCase.swift | 10 ++++++--- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/MemorialHouse/MHData/MHDataTests/CoreDataBookCoverStorageTests.swift b/MemorialHouse/MHData/MHDataTests/CoreDataBookCoverStorageTests.swift index d55215f..bcdceee 100644 --- a/MemorialHouse/MHData/MHDataTests/CoreDataBookCoverStorageTests.swift +++ b/MemorialHouse/MHData/MHDataTests/CoreDataBookCoverStorageTests.swift @@ -12,7 +12,7 @@ struct CoreDataBookCoverStorageTests { id: UUID(), order: 1, title: "test1", - imageURL: nil, + imageData: nil, color: "pink", category: nil, favorite: true), @@ -20,7 +20,7 @@ struct CoreDataBookCoverStorageTests { id: UUID(), order: 2, title: "test2", - imageURL: nil, + imageData: nil, color: "blue", category: nil, favorite: false), @@ -28,7 +28,7 @@ struct CoreDataBookCoverStorageTests { id: UUID(), order: 3, title: "test3", - imageURL: nil, + imageData: nil, color: "beige", category: nil, favorite: true) @@ -46,7 +46,7 @@ struct CoreDataBookCoverStorageTests { id: UUID(), order: 4, title: "test4", - imageURL: nil, + imageData: nil, color: "green", category: nil, favorite: true) @@ -89,7 +89,7 @@ struct CoreDataBookCoverStorageTests { id: oldBookCover.id, order: 4, title: "test4", - imageURL: nil, + imageData: nil, color: "green", category: nil, favorite: true) diff --git a/MemorialHouse/MHPresentation/MHPresentationTests/HomeViewModelTest.swift b/MemorialHouse/MHPresentation/MHPresentationTests/HomeViewModelTest.swift index 258415e..a0d7c1c 100644 --- a/MemorialHouse/MHPresentation/MHPresentationTests/HomeViewModelTest.swift +++ b/MemorialHouse/MHPresentation/MHPresentationTests/HomeViewModelTest.swift @@ -8,9 +8,9 @@ struct HomeViewModelTest { private var sut: HomeViewModel! private var cancellables = Set() private static let bookCovers = [ - BookCover(id: UUID(), order: 0, title: "title1", imageURL: nil, color: .blue, category: nil, favorite: false), - BookCover(id: UUID(), order: 1, title: "title2", imageURL: nil, color: .blue, category: nil, favorite: false), - BookCover(id: UUID(), order: 2, title: "title3", imageURL: nil, color: .blue, category: nil, favorite: false) + BookCover(id: UUID(), order: 0, title: "title1", imageData: nil, color: .blue, category: nil, favorite: false), + BookCover(id: UUID(), order: 1, title: "title2", imageData: nil, color: .blue, category: nil, favorite: false), + BookCover(id: UUID(), order: 2, title: "title3", imageData: nil, color: .blue, category: nil, favorite: false) ] @MainActor @@ -18,11 +18,14 @@ struct HomeViewModelTest { // Arrange let stubFetchMemorialHouseNameUseCase = StubFetchMemorialHouseNameUseCase(dummyMemorialHouseName: "효준") let stubFetchAllBookCoverUseCase = StubFetchAllBookCoverUseCase() + let stubUpdateBookCoverUseCase = StubUpdateBookCoverUseCase() + let stubDeleteBookCoverUseCase = StubDeleteBookCoverUseCase() let stubBookCovers = try await stubFetchAllBookCoverUseCase.execute() sut = HomeViewModel( fetchMemorialHouseUseCase: stubFetchMemorialHouseNameUseCase, fetchAllBookCoverUseCase: stubFetchAllBookCoverUseCase, - updateBookCoverUseCase: StubUpdateBookCoverUseCase() + updateBookCoverUseCase: stubUpdateBookCoverUseCase, + deleteBookCoverUseCase: stubDeleteBookCoverUseCase ) let input = PassthroughSubject() @@ -36,13 +39,13 @@ struct HomeViewModelTest { // Act receivedOutput.removeAll() - input.send(.viewDidLoad) + input.send(.loadAllBookCovers) try await Task.sleep(nanoseconds: 500_000_000) // Assert #expect(receivedOutput.count == 2) #expect(receivedOutput.contains(.fetchedMemorialHouseName)) - #expect(receivedOutput.contains(.fetchedAllBookCover)) + #expect(receivedOutput.contains(.reloadData)) #expect(sut.houseName == "효준") #expect(sut.bookCovers == stubBookCovers) } @@ -53,7 +56,8 @@ struct HomeViewModelTest { sut = HomeViewModel( fetchMemorialHouseUseCase: StubFetchMemorialHouseNameUseCase(dummyMemorialHouseName: "효준"), fetchAllBookCoverUseCase: StubFetchAllBookCoverUseCase(), - updateBookCoverUseCase: StubUpdateBookCoverUseCase() + updateBookCoverUseCase: StubUpdateBookCoverUseCase(), + deleteBookCoverUseCase: StubDeleteBookCoverUseCase() ) let input = PassthroughSubject() var receivedOutput: [HomeViewModel.Output] = [] @@ -64,7 +68,7 @@ struct HomeViewModelTest { .store(in: &cancellables) // Act - input.send(.viewDidLoad) + input.send(.loadAllBookCovers) try await Task.sleep(nanoseconds: 500_000_000) receivedOutput.removeAll() @@ -73,7 +77,7 @@ struct HomeViewModelTest { // Assert #expect(receivedOutput.count == 1) - #expect(receivedOutput.contains(.filteredBooks)) + #expect(receivedOutput.contains(.reloadData)) #expect(sut.currentBookCovers.count == 1) #expect(sut.currentBookCovers.first?.title == "title1") } diff --git a/MemorialHouse/MHPresentation/MHPresentationTests/TestDoubles/StubBookCoverUseCase.swift b/MemorialHouse/MHPresentation/MHPresentationTests/TestDoubles/StubBookCoverUseCase.swift index 4ab1c32..0626d32 100644 --- a/MemorialHouse/MHPresentation/MHPresentationTests/TestDoubles/StubBookCoverUseCase.swift +++ b/MemorialHouse/MHPresentation/MHPresentationTests/TestDoubles/StubBookCoverUseCase.swift @@ -8,7 +8,7 @@ struct StubFetchAllBookCoverUseCase: FetchAllBookCoverUseCase { id: UUID(uuidString: "11111111-1111-1111-1111-111111111111")!, order: 0, title: "title1", - imageURL: nil, + imageData: nil, color: .blue, category: "친구", favorite: false @@ -17,7 +17,7 @@ struct StubFetchAllBookCoverUseCase: FetchAllBookCoverUseCase { id: UUID(uuidString: "22222222-2222-2222-2222-222222222222")!, order: 1, title: "title2", - imageURL: nil, + imageData: nil, color: .blue, category: "가족", favorite: false @@ -26,7 +26,7 @@ struct StubFetchAllBookCoverUseCase: FetchAllBookCoverUseCase { id: UUID(uuidString: "33333333-3333-3333-3333-333333333333")!, order: 2, title: "title3", - imageURL: nil, + imageData: nil, color: .green, category: "전체", favorite: false @@ -38,3 +38,7 @@ struct StubFetchAllBookCoverUseCase: FetchAllBookCoverUseCase { struct StubUpdateBookCoverUseCase: UpdateBookCoverUseCase { func execute(id: UUID, with bookCover: BookCover) async throws { } } + +struct StubDeleteBookCoverUseCase: DeleteBookCoverUseCase { + func execute(id: UUID) async throws { } +}