Skip to content

Commit

Permalink
[FEAT] #235 로그아웃 유저디폴트 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
comeheredart committed Jun 24, 2022
1 parent 91785bb commit d22ce76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions ChaRo-iOS/ChaRo-iOS/Source/Services/UserDefaultKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import SwiftUI

extension Constants {
struct UserDefaultsKey {
Expand All @@ -24,4 +25,17 @@ extension Constants {
static let isKakaoLogin = "isKakaoLogin"
static let isGoogleLogin = "isGoogleLogin"
}

static func removeAllUserDefaults() {
UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.userEmail)
UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.userPassword)
UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.userNickname)
UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.userImage)

UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.isLogin)

UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.isAppleLogin)
UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.isKakaoLogin)
UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.isGoogleLogin)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ extension SettingVC {

/// LoginSB의 루트 네비게이션 컨트롤러로 화면전환하는 메서드
private func presentToSignNC() {
Constants.removeAllUserDefaults()
guard let signNC = UIStoryboard(name: "Login", bundle: nil).instantiateViewController(withIdentifier: SignNC.className)
as? SignNC else {return}
as? SignNC else { return }
signNC.modalPresentationStyle = .overFullScreen
self.present(signNC, animated: true, completion: nil)
}
Expand Down

0 comments on commit d22ce76

Please sign in to comment.