Skip to content

Commit

Permalink
Merge pull request #136 from teamCA-PIN/feature/#114
Browse files Browse the repository at this point in the history
[fix] λ‘œκ·Έμ•„μ›ƒ 둜직 μˆ˜μ •
  • Loading branch information
seohyun-106 authored Jan 10, 2022
2 parents 696f7bc + db20b61 commit bf430fb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class LoginViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
self.emailTextField.text = ""
self.passwordTextField.text = ""
disableLoginButton()
}
}

Expand Down Expand Up @@ -170,7 +171,7 @@ extension LoginViewController {
func disableLoginButton() {
if emailTextField.text?.isEmpty == true || passwordTextField.text?.isEmpty == true {
self.loginButton.isUserInteractionEnabled = false
self.loginButton.backgroundColor = .gray4
self.loginButton.backgroundColor = .gray3
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class LogoutPopUpViewController: UIViewController {
let cancelButton = UIButton()
let logoutButton = UIButton()

var loginVCFlag: Int = 2

override func viewDidLoad() {
super.viewDidLoad()
layout()
Expand Down Expand Up @@ -127,12 +129,29 @@ extension LogoutPopUpViewController {
KeychainWrapper.standard.remove(forKey: "tokenAccess")
KeychainWrapper.standard.remove(forKey: "tokenRefresh")

print(self.presentingViewController?.children)
let loginVC = self.presentingViewController?.children[1] as? LoginViewController
loginVCFlag = KeychainWrapper.standard.integer(forKey: "loginVCFlag") ?? 2

var loginVC = self.presentingViewController?.children[1] as? LoginViewController
let endIndex = self.presentingViewController?.children.endIndex ?? 0
let newSettingVC = self.presentingViewController?.children[endIndex-1] as? NewSettingViewController
self.dismiss(animated: false, completion: {
newSettingVC?.navigationController?.popToRootViewController(animated: true)
})
print(newSettingVC?.navigationController?.children)
if loginVCFlag == 0 {
print("λ·° μ•ˆλœΈ")
// loginVC = self.navigationController?.children[2] as? LoginViewController
// if let vc = loginVC {
// self.dismiss(animated: false, completion: {
// newSettingVC?.navigationController?.popToViewController(vc, animated: true)
// })
self.dismiss(animated: false, completion: {
newSettingVC?.navigationController?.popToRootViewController(animated: true)
})
} else {
print("뷰 뜸")
if let vc = loginVC {
self.dismiss(animated: false, completion: {
newSettingVC?.navigationController?.popToViewController(vc, animated: true)
})
}
}
}
}

0 comments on commit bf430fb

Please sign in to comment.