diff --git a/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj b/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj index 10ac92b6..f578ac06 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"; diff --git a/MemorialHouse/MHData/MHDataTests/CoreDataBookCoverStorageTests.swift b/MemorialHouse/MHData/MHDataTests/CoreDataBookCoverStorageTests.swift index d55215f1..bcdceee4 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/MHPresentation/Source/EditBook/View/EditBookViewController.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/EditBook/View/EditBookViewController.swift index 8c9df5c6..44166302 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()) diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift index 1cb6141e..677bcf1d 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() } diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/Home/View/HomeViewController.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/Home/View/HomeViewController.swift index 24028d44..865c4f5b 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 diff --git a/MemorialHouse/MHPresentation/MHPresentationTests/HomeViewModelTest.swift b/MemorialHouse/MHPresentation/MHPresentationTests/HomeViewModelTest.swift index 258415ed..a0d7c1c8 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 4ab1c328..0626d326 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 { } +}