From bff4f6659a8dd607837114971069cf840a1ee4ed Mon Sep 17 00:00:00 2001 From: eemdeeks Date: Mon, 2 Dec 2024 18:14:41 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EB=8B=A4=EB=A5=B8=EB=B3=B4=EB=93=9C?= =?UTF-8?q?=EC=9D=98=20=EC=B1=84=ED=8C=85=EC=9D=B4=20=EB=B3=B4=EC=9D=B4?= =?UTF-8?q?=EB=8A=94=20=ED=98=84=EC=83=81=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirplaIN/AirplaIN/SceneDelegate.swift | 23 ++++---- .../ViewModel/WhiteboardViewModel.swift | 14 ++--- .../View/WhiteboardListViewController.swift | 54 ++++++++++++++++--- 3 files changed, 65 insertions(+), 26 deletions(-) diff --git a/AirplaIN/AirplaIN/SceneDelegate.swift b/AirplaIN/AirplaIN/SceneDelegate.swift index 04d09d97..53f154a2 100644 --- a/AirplaIN/AirplaIN/SceneDelegate.swift +++ b/AirplaIN/AirplaIN/SceneDelegate.swift @@ -43,7 +43,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { whiteboardRepository: whiteboardRepository, profileRepository: profileRepository) let profileUseCase = ProfileUseCase(repository: profileRepository) - let manageWhieboardObjectUseCase = ManageWhiteboardObjectUseCase( + let manageWhiteboardObjectUseCase = ManageWhiteboardObjectUseCase( profileRepository: profileRepository, whiteboardObjectRepository: whiteboardObjectRepository, whiteboardRepository: whiteboardRepository, @@ -54,30 +54,27 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { textFieldDefaultSize: CGSize(width: 200, height: 50)) let drawObjectUseCase = DrawObjectUseCase() let gameObjectUseCase = GameObjectUseCase(repository: GameRepository(persistenceService: PersistenceService())) - let addPhotoUseCase = PhotoUseCase(photoRepository: photoRepository) + let photoUseCase = PhotoUseCase(photoRepository: photoRepository) let chatUseCase = ChatUseCase(chatRepository: chatRepository) let whiteboardObjectViewFactory = WhiteboardObjectViewFactory() let whiteboardListViewModel = WhiteboardListViewModel(whiteboardUseCase: whiteboardUseCase) - let whiteboardViewModel = WhiteboardViewModel( - whiteboardUseCase: whiteboardUseCase, - addPhotoUseCase: addPhotoUseCase, - drawObjectUseCase: drawObjectUseCase, - textObjectUseCase: textObjectUseCase, - chatUseCase: chatUseCase, - gameObjectUseCase: gameObjectUseCase, - managemanageWhiteboardToolUseCase: manageWhiteboardToolUseCase, - manageWhiteboardObjectUseCase: manageWhieboardObjectUseCase) let profileViewModel = ProfileViewModel(profileUseCase: profileUseCase) let whiteboardListViewController = WhiteboardListViewController( viewModel: whiteboardListViewModel, - whiteboardViewModel: whiteboardViewModel, whiteboardObjectViewFactory: whiteboardObjectViewFactory, profileViewModel: profileViewModel, profileRepository: profileRepository, - chatUseCase: chatUseCase) + whiteboardUseCase: whiteboardUseCase, + photoUseCase: photoUseCase, + drawObjectUseCase: drawObjectUseCase, + textObjectUseCase: textObjectUseCase, + chatUseCase: chatUseCase, + gameObjectUseCase: gameObjectUseCase, + manageWhiteboardToolUseCase: manageWhiteboardToolUseCase, + manageWhiteboardObjectUseCase: manageWhiteboardObjectUseCase) let window = UIWindow(windowScene: windowScene) let navigationController = UINavigationController(rootViewController: whiteboardListViewController) diff --git a/Presentation/Presentation/Sources/Whiteboard/ViewModel/WhiteboardViewModel.swift b/Presentation/Presentation/Sources/Whiteboard/ViewModel/WhiteboardViewModel.swift index 360bbf1e..ccd76c4d 100644 --- a/Presentation/Presentation/Sources/Whiteboard/ViewModel/WhiteboardViewModel.swift +++ b/Presentation/Presentation/Sources/Whiteboard/ViewModel/WhiteboardViewModel.swift @@ -42,10 +42,10 @@ public final class WhiteboardViewModel: ViewModel { private(set) var output: Output private let whiteboardUseCase: WhiteboardUseCaseInterface - private let photoUseCase: PhotoUseCase + private let photoUseCase: PhotoUseCaseInterface private let drawObjectUseCase: DrawObjectUseCaseInterface private let textObjectUseCase: TextObjectUseCaseInterface - private let chatUseCase: ChatUseCase + private let chatUseCase: ChatUseCaseInterface private let gameObjectUseCase: GameObjectUseCaseInterface private let manageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface private let manageWhiteboardObjectUseCase: ManageWhiteboardObjectUseCaseInterface @@ -55,21 +55,21 @@ public final class WhiteboardViewModel: ViewModel { public init( whiteboardUseCase: WhiteboardUseCaseInterface, - addPhotoUseCase: PhotoUseCase, + photoUseCase: PhotoUseCaseInterface, drawObjectUseCase: DrawObjectUseCaseInterface, textObjectUseCase: TextObjectUseCaseInterface, - chatUseCase: ChatUseCase, + chatUseCase: ChatUseCaseInterface, gameObjectUseCase: GameObjectUseCaseInterface, - managemanageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface, + manageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface, manageWhiteboardObjectUseCase: ManageWhiteboardObjectUseCaseInterface ) { self.whiteboardUseCase = whiteboardUseCase - self.photoUseCase = addPhotoUseCase + self.photoUseCase = photoUseCase self.drawObjectUseCase = drawObjectUseCase self.textObjectUseCase = textObjectUseCase self.chatUseCase = chatUseCase self.gameObjectUseCase = gameObjectUseCase - self.manageWhiteboardToolUseCase = managemanageWhiteboardToolUseCase + self.manageWhiteboardToolUseCase = manageWhiteboardToolUseCase self.manageWhiteboardObjectUseCase = manageWhiteboardObjectUseCase selectedObjectSubject = CurrentValueSubject(nil) imageSubject = PassthroughSubject<(id: UUID, imageData: Data), Never>() diff --git a/Presentation/Presentation/Sources/WhiteboardList/View/WhiteboardListViewController.swift b/Presentation/Presentation/Sources/WhiteboardList/View/WhiteboardListViewController.swift index 53f2e7f6..28edaf05 100644 --- a/Presentation/Presentation/Sources/WhiteboardList/View/WhiteboardListViewController.swift +++ b/Presentation/Presentation/Sources/WhiteboardList/View/WhiteboardListViewController.swift @@ -61,26 +61,44 @@ public final class WhiteboardListViewController: UIViewController { private let viewModel: WhiteboardListViewModel private var cancellables = Set() - private let whiteboardViewModel: WhiteboardViewModel private let whiteboardObjectViewFactory: WhiteboardObjectViewFactoryable private let profileViewModel: ProfileViewModel private let profileRepository: ProfileRepositoryInterface + private let whiteboardUseCase: WhiteboardUseCaseInterface + private let photoUseCase: PhotoUseCaseInterface + private let drawObjectUseCase: DrawObjectUseCaseInterface + private let textObjectUseCase: TextObjectUseCaseInterface private let chatUseCase: ChatUseCaseInterface + private let gameObjectUseCase: GameObjectUseCaseInterface + private let manageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface + private let manageWhiteboardObjectUseCase: ManageWhiteboardObjectUseCaseInterface public init( viewModel: WhiteboardListViewModel, - whiteboardViewModel: WhiteboardViewModel, whiteboardObjectViewFactory: WhiteboardObjectViewFactoryable, profileViewModel: ProfileViewModel, profileRepository: ProfileRepositoryInterface, - chatUseCase: ChatUseCaseInterface + whiteboardUseCase: WhiteboardUseCaseInterface, + photoUseCase: PhotoUseCaseInterface, + drawObjectUseCase: DrawObjectUseCaseInterface, + textObjectUseCase: TextObjectUseCaseInterface, + chatUseCase: ChatUseCaseInterface, + gameObjectUseCase: GameObjectUseCaseInterface, + manageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface, + manageWhiteboardObjectUseCase: ManageWhiteboardObjectUseCaseInterface ) { self.viewModel = viewModel - self.whiteboardViewModel = whiteboardViewModel self.whiteboardObjectViewFactory = whiteboardObjectViewFactory self.profileViewModel = profileViewModel self.profileRepository = profileRepository + self.whiteboardUseCase = whiteboardUseCase + self.photoUseCase = photoUseCase + self.drawObjectUseCase = drawObjectUseCase + self.textObjectUseCase = textObjectUseCase self.chatUseCase = chatUseCase + self.gameObjectUseCase = gameObjectUseCase + self.manageWhiteboardToolUseCase = manageWhiteboardToolUseCase + self.manageWhiteboardObjectUseCase = manageWhiteboardObjectUseCase super.init(nibName: nil, bundle: nil) } @@ -113,12 +131,27 @@ public final class WhiteboardListViewController: UIViewController { self?.viewModel.action(input: .createWhiteboard) guard - let whiteboardViewModel = self?.whiteboardViewModel, let whiteboardObjectViewFactory = self?.whiteboardObjectViewFactory, let profileRepository = self?.profileRepository, - let chatUseCase = self?.chatUseCase + let whiteboardUseCase = self?.whiteboardUseCase, + let photoUseCase = self?.photoUseCase, + let drawObjectUseCase = self?.drawObjectUseCase, + let textObjectUseCase = self?.textObjectUseCase, + let chatUseCase = self?.chatUseCase, + let gameObjectUseCase = self?.gameObjectUseCase, + let manageWhiteboardToolUseCase = self?.manageWhiteboardToolUseCase, + let manageWhiteboardObjectUseCase = self?.manageWhiteboardObjectUseCase else { return } + let whiteboardViewModel = WhiteboardViewModel( + whiteboardUseCase: whiteboardUseCase, + photoUseCase: photoUseCase, + drawObjectUseCase: drawObjectUseCase, + textObjectUseCase: textObjectUseCase, + chatUseCase: chatUseCase, + gameObjectUseCase: gameObjectUseCase, + manageWhiteboardToolUseCase: manageWhiteboardToolUseCase, + manageWhiteboardObjectUseCase: manageWhiteboardObjectUseCase) let whiteboardViewController = WhiteboardViewController( viewModel: whiteboardViewModel, objectViewFactory: whiteboardObjectViewFactory, @@ -280,6 +313,15 @@ extension WhiteboardListViewController: UICollectionViewDelegate { public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { guard let selectedWhiteboard = dataSource?.itemIdentifier(for: indexPath) else { return } viewModel.action(input: .joinWhiteboard(whiteboard: selectedWhiteboard)) + let whiteboardViewModel = WhiteboardViewModel( + whiteboardUseCase: whiteboardUseCase, + photoUseCase: photoUseCase, + drawObjectUseCase: drawObjectUseCase, + textObjectUseCase: textObjectUseCase, + chatUseCase: chatUseCase, + gameObjectUseCase: gameObjectUseCase, + manageWhiteboardToolUseCase: manageWhiteboardToolUseCase, + manageWhiteboardObjectUseCase: manageWhiteboardObjectUseCase) let whiteboardViewController = WhiteboardViewController( viewModel: whiteboardViewModel, objectViewFactory: whiteboardObjectViewFactory, From 8ff982f2a65ced5fc1e8409d1682ad0b065dc4e8 Mon Sep 17 00:00:00 2001 From: eemdeeks Date: Mon, 2 Dec 2024 18:39:01 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EB=B3=B4=EB=82=B4=EA=B8=B0=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=ED=81=AC=EA=B8=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Chat/View/ChatTextFieldView.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Presentation/Presentation/Sources/Chat/View/ChatTextFieldView.swift b/Presentation/Presentation/Sources/Chat/View/ChatTextFieldView.swift index 1e02b9da..e74e8d88 100644 --- a/Presentation/Presentation/Sources/Chat/View/ChatTextFieldView.swift +++ b/Presentation/Presentation/Sources/Chat/View/ChatTextFieldView.swift @@ -13,8 +13,9 @@ protocol ChatTextFieldViewDelegate: AnyObject, UITextFieldDelegate { final class ChatTextFieldView: UIView { private enum ChatTextFieldLayoutConstant { - static let sendButtonSize: CGFloat = 23 - static let sendButtonTraillingInset: CGFloat = 16 + static let sendButtonSize: CGFloat = 40 + static let sendButtonTraillingInset: CGFloat = 8 + static let sendButtonImageSize: CGFloat = 20 static let textFieldLeadingInset: CGFloat = 20 static let textFieldBorderWidth: CGFloat = 1 static let textFieldCornerRadius: CGFloat = 20 @@ -32,7 +33,11 @@ final class ChatTextFieldView: UIView { private let sendButton: UIButton = { let button = UIButton() var buttonConfiguration = UIButton.Configuration.plain() + let imageConfiguration = UIImage + .SymbolConfiguration( + pointSize: ChatTextFieldLayoutConstant.sendButtonImageSize) buttonConfiguration.image = UIImage(systemName: "arrow.up.circle.fill") + buttonConfiguration.preferredSymbolConfigurationForImage = imageConfiguration button.configuration = buttonConfiguration button.tintColor = .airplainBlue