diff --git a/Idea-Archive.xcodeproj/project.pbxproj b/Idea-Archive.xcodeproj/project.pbxproj index 69afa98..1fd2e04 100644 --- a/Idea-Archive.xcodeproj/project.pbxproj +++ b/Idea-Archive.xcodeproj/project.pbxproj @@ -46,7 +46,7 @@ 786DCB1D29F81C9300228885 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 786DCB1B29F81C9300228885 /* LaunchScreen.storyboard */; }; 786FB7FA2A1122C000BD3386 /* Font.swift in Sources */ = {isa = PBXBuildFile; fileRef = 786FB7F92A1122C000BD3386 /* Font.swift */; }; 786FB8052A11259A00BD3386 /* UITextField+setPlaceholderColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 786FB8042A11259A00BD3386 /* UITextField+setPlaceholderColor.swift */; }; - 787211F62A777FD9008B2998 /* LoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 787211F52A777FD9008B2998 /* LoginViewModel.swift */; }; + 787211F62A777FD9008B2998 /* LoginVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 787211F52A777FD9008B2998 /* LoginVM.swift */; }; 787211F92A778179008B2998 /* KeyChainManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 787211F82A778179008B2998 /* KeyChainManager.swift */; }; 78848A8C2A343E06001588AA /* RxKeyboard in Frameworks */ = {isa = PBXBuildFile; productRef = 78848A8B2A343E06001588AA /* RxKeyboard */; }; 78A644902A7F7B890021CC14 /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 78A6448F2A7F7B890021CC14 /* Moya */; }; @@ -100,7 +100,7 @@ 786DCB1E29F81C9300228885 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 786FB7F92A1122C000BD3386 /* Font.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Font.swift; sourceTree = ""; }; 786FB8042A11259A00BD3386 /* UITextField+setPlaceholderColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+setPlaceholderColor.swift"; sourceTree = ""; }; - 787211F52A777FD9008B2998 /* LoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = ""; }; + 787211F52A777FD9008B2998 /* LoginVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginVM.swift; sourceTree = ""; }; 787211F82A778179008B2998 /* KeyChainManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyChainManager.swift; sourceTree = ""; }; 78A644932A7F7E920021CC14 /* SignupUserInfoVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignupUserInfoVM.swift; sourceTree = ""; }; 78B6644A2A0E89DF00B8C68C /* NormalTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NormalTextField.swift; sourceTree = ""; }; @@ -436,7 +436,7 @@ 787211F42A777FC1008B2998 /* ViewModel */ = { isa = PBXGroup; children = ( - 787211F52A777FD9008B2998 /* LoginViewModel.swift */, + 787211F52A777FD9008B2998 /* LoginVM.swift */, ); path = ViewModel; sourceTree = ""; @@ -674,7 +674,7 @@ 785BBF022A25AC6000186DDA /* LargeTitleLabel.swift in Sources */, 78B6644D2A0E8A7C00B8C68C /* SecureTextField.swift in Sources */, 786DCB1529F81C9200228885 /* BaseVC.swift in Sources */, - 787211F62A777FD9008B2998 /* LoginViewModel.swift in Sources */, + 787211F62A777FD9008B2998 /* LoginVM.swift in Sources */, 78A644942A7F7E920021CC14 /* SignupUserInfoVM.swift in Sources */, 781BD2812A7739C300118B99 /* AuthServices.swift in Sources */, 78015C4F2A31CB7200737055 /* OTPTextField.swift in Sources */, diff --git a/Idea-Archive/Sources/Presentation/Login/View/LoginVC.swift b/Idea-Archive/Sources/Presentation/Login/View/LoginVC.swift index 0d9f66e..dfb5852 100644 --- a/Idea-Archive/Sources/Presentation/Login/View/LoginVC.swift +++ b/Idea-Archive/Sources/Presentation/Login/View/LoginVC.swift @@ -4,6 +4,8 @@ import SnapKit final class LoginVC: BaseVC { + private let loginVM = LoginVM() + private let loginLabel = TitleLabel().then { $0.text = "LOGIN" } @@ -154,7 +156,7 @@ final class LoginVC: BaseVC { } self.socialLoginButtonStackView.snp.makeConstraints { $0.height.equalTo(36) - $0.bottom.equalToSuperview().inset(96) + $0.bottom.equalTo(self.view.safeAreaLayoutGuide).inset(96) $0.centerX.equalToSuperview() } self.appleLoginButton.snp.makeConstraints{ @@ -177,7 +179,7 @@ final class LoginVC: BaseVC { @objc func loginButtonTapped(_ sender: UIButton){ print("로그인 버튼 클릭") - LoginVM().loginCompleted(email: idTextField.text ?? "", password: passwordTextField.text ?? "") + loginVM.loginCompleted(email: idTextField.text ?? "", password: passwordTextField.text ?? "") } @objc func findPasswordButtonTapped(_ sender: UIButton){ diff --git a/Idea-Archive/Sources/Presentation/Login/ViewModel/LoginViewModel.swift b/Idea-Archive/Sources/Presentation/Login/ViewModel/LoginVM.swift similarity index 96% rename from Idea-Archive/Sources/Presentation/Login/ViewModel/LoginViewModel.swift rename to Idea-Archive/Sources/Presentation/Login/ViewModel/LoginVM.swift index 5183e8b..5f3e33b 100644 --- a/Idea-Archive/Sources/Presentation/Login/ViewModel/LoginViewModel.swift +++ b/Idea-Archive/Sources/Presentation/Login/ViewModel/LoginVM.swift @@ -1,14 +1,14 @@ import UIKit import Moya -class LoginViewModel { +class LoginVM { let authProvider = MoyaProvider() var authData: LoginResponse! static var accessToken = "" } -extension LoginViewModel { +extension LoginVM { func loginCompleted(email: String, password: String) { diff --git a/Idea-Archive/Sources/Presentation/Signup/CertificationNumber/ViewModel/CertificationVM.swift b/Idea-Archive/Sources/Presentation/Signup/CertificationNumber/ViewModel/CertificationVM.swift index 625d597..5b119c8 100644 --- a/Idea-Archive/Sources/Presentation/Signup/CertificationNumber/ViewModel/CertificationVM.swift +++ b/Idea-Archive/Sources/Presentation/Signup/CertificationNumber/ViewModel/CertificationVM.swift @@ -1,11 +1,11 @@ import UIKit import Moya -class GetCertificationNumberViewModel { +class GetCertificationNumberVM { let authProvider = MoyaProvider() } -extension GetCertificationNumberViewModel { +extension GetCertificationNumberVM { func getCertificationNumber(email: String) { diff --git a/Idea-Archive/Sources/Presentation/Signup/SignupUserInfo/View/SignupUserInfoVC.swift b/Idea-Archive/Sources/Presentation/Signup/SignupUserInfo/View/SignupUserInfoVC.swift index e861560..c5b91cc 100644 --- a/Idea-Archive/Sources/Presentation/Signup/SignupUserInfo/View/SignupUserInfoVC.swift +++ b/Idea-Archive/Sources/Presentation/Signup/SignupUserInfo/View/SignupUserInfoVC.swift @@ -4,6 +4,8 @@ import SnapKit final class SignupVC: BaseVC { + private let signupUserInfoVM = SignupUserInfoVM() + private let signupLabel = TitleLabel().then{ $0.text = "SIGN UP" } diff --git a/Idea-Archive/Sources/Presentation/Signup/SignupUserInfo/ViewModel/SignupUserInfoVM.swift b/Idea-Archive/Sources/Presentation/Signup/SignupUserInfo/ViewModel/SignupUserInfoVM.swift index c5509bc..5dd3971 100644 --- a/Idea-Archive/Sources/Presentation/Signup/SignupUserInfo/ViewModel/SignupUserInfoVM.swift +++ b/Idea-Archive/Sources/Presentation/Signup/SignupUserInfo/ViewModel/SignupUserInfoVM.swift @@ -1,11 +1,11 @@ import UIKit import Moya -class SignupUserInfoViewModel { +class SignupUserInfoVM { let authProvider = MoyaProvider() } -extension SignupUserInfoViewModel { +extension SignupUserInfoVM { func signupCompleted(email: String, password: String, name: String) {