From c14eea882eaef3b2d8572f7d9576aa3d70274bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=80=ED=98=B8?= <127753071+Eunho0922@users.noreply.github.com> Date: Sun, 5 May 2024 20:50:06 +0900 Subject: [PATCH] ADD :: [#314] IntroViewModel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit googleButton alert 이벤트 추가 --- .../Sources/IntroScene/ViewModel/IntroViewModel.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Projects/Features/AuthFeature/Sources/IntroScene/ViewModel/IntroViewModel.swift b/Projects/Features/AuthFeature/Sources/IntroScene/ViewModel/IntroViewModel.swift index 29db359c..6e623408 100644 --- a/Projects/Features/AuthFeature/Sources/IntroScene/ViewModel/IntroViewModel.swift +++ b/Projects/Features/AuthFeature/Sources/IntroScene/ViewModel/IntroViewModel.swift @@ -35,9 +35,11 @@ public class IntroViewModel: AuthViewModelType { public struct Output { var introDatas: Observable + var showGoogleAlert: Observable } private let introModelSubject = PublishSubject() + private let showGoogleAlertSubject = PublishSubject() public init(authUseCase: AuthUseCase) { self.useCase = authUseCase @@ -46,15 +48,17 @@ public class IntroViewModel: AuthViewModelType { public func transform(_ input: Input, action: (Output) -> Void) -> Output { - let output = Output(introDatas: introModelSubject.asObservable()) + let output = Output(introDatas: introModelSubject.asObservable(), showGoogleAlert: showGoogleAlertSubject.asObservable()) action(output) bindOutput(output: output) input.goolgeButtonTapped - .drive(onNext: { _ in - print("googleButtonTapp") + .asObservable() + .withUnretained(self) + .subscribe(onNext: { owner, _ in + owner.showGoogleAlertSubject.onNext(()) }) .disposed(by: disposeBag)