Skip to content

Commit 2fd1b6d

Browse files
authored
Merge pull request #134 from teamCA-PIN/feature/#114
Merge Feature/#114 into develop
2 parents b27e1db + dfe28cd commit 2fd1b6d

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

β€ŽCA-PIN_IOS/CA-PIN_IOS/Screens/Login/ViewControllers/LoginViewController.swiftβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class LoginViewController: UIViewController {
4040
super.viewDidLoad()
4141
self.view.backgroundColor = .white
4242
self.navigationController?.navigationBar.isHidden = true
43+
KeychainWrapper.standard.set(1, forKey: "loginVCFlag")
4344
layout()
4445
setTextField()
4546
keyboardObserver()

β€ŽCA-PIN_IOS/CA-PIN_IOS/Screens/Login/ViewControllers/SplashViewController.swiftβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class SplashViewController: UIViewController {
4141

4242
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
4343
if KeychainWrapper.standard.hasValue(forKey: "loginEmail") && KeychainWrapper.standard.hasValue(forKey: "loginPassword") {
44+
KeychainWrapper.standard.set(0, forKey: "loginVCFlag")
4445
if let email = KeychainWrapper.standard.string(forKey: "loginEmail"),
4546
let password = KeychainWrapper.standard.string(forKey: "loginPassword") {
4647
self.login(ID: email, PW: password)

β€ŽCA-PIN_IOS/CA-PIN_IOS/Screens/Mypage/ViewControllers/MypageViewController.swiftβ€Ž

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Moya
1010
import RxMoya
1111
import RxSwift
1212
import SnapKit
13+
import SwiftKeychainWrapper
1314
import Then
1415

1516
protocol PagingTabbarDelegate {
@@ -72,6 +73,8 @@ class MypageViewController: UIViewController {
7273
var categoryArray: [MyCategoryList] = [] /// μ„œλ²„ν†΅μ‹ ν•΄μ„œ μΉ΄ν…Œκ³ λ¦¬ 배열을 λ°›μ•„μ˜¨λ‹€
7374
var categoryIdArray: [String] = [] /// μΉ΄ν…Œκ³ λ¦¬ 아이디λ₯Ό μ €μž₯ν•΄λ†“λŠ” λ°°μ—΄ -> μΉ΄ν…Œκ³ λ¦¬ 상세 νŽ˜μ΄μ§€λ‘œ λ„˜μ–΄κ°ˆ λ•Œ μ‚¬μš©ν•  νŒŒλΌλ―Έν„°
7475

76+
var loginVCFlag: Int = 2
77+
7578
// MARK: - LifeCycle
7679
override func viewDidLoad() {
7780
super.viewDidLoad()
@@ -380,12 +383,19 @@ extension MypageViewController {
380383
}
381384
}
382385
@objc func backButtonClicked() {
383-
// let mapVC = (self.navigationController?.children[2] as? MapViewController)!
384-
// self.navigationController?.popToViewController(mapVC, animated: true)
385-
// self.navigationController?.popViewController(animated: true)
386-
let mapVC = self.navigationController?.children[2] as? MapViewController
387-
if let vc = mapVC {
388-
self.navigationController?.popToViewController(vc, animated: true)
386+
var mapVC = self.navigationController?.children[1] as? MapViewController
387+
388+
loginVCFlag = KeychainWrapper.standard.integer(forKey: "loginVCFlag") ?? 2
389+
390+
if loginVCFlag == 0 {
391+
if let vc = mapVC {
392+
self.navigationController?.popToViewController(vc, animated: true)
393+
}
394+
} else {
395+
mapVC = self.navigationController?.children[2] as? MapViewController
396+
if let vc = mapVC {
397+
self.navigationController?.popToViewController(vc, animated: true)
398+
}
389399
}
390400
}
391401
@objc func cafeTITestButtonClicked() {

β€ŽCA-PIN_IOS/CA-PIN_IOS/Screens/Terms/LogoutPopUpViewController.swiftβ€Ž

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,12 @@ extension LogoutPopUpViewController {
127127
KeychainWrapper.standard.remove(forKey: "tokenAccess")
128128
KeychainWrapper.standard.remove(forKey: "tokenRefresh")
129129

130+
print(self.presentingViewController?.children)
130131
let loginVC = self.presentingViewController?.children[1] as? LoginViewController
131132
let endIndex = self.presentingViewController?.children.endIndex ?? 0
132133
let newSettingVC = self.presentingViewController?.children[endIndex-1] as? NewSettingViewController
133-
if let dvc = loginVC {
134-
self.dismiss(animated: false, completion: {
135-
dvc.view.endEditing(true)
136-
newSettingVC?.navigationController?.popToViewController(dvc, animated: true)
137-
}
138-
)
139-
}
134+
self.dismiss(animated: false, completion: {
135+
newSettingVC?.navigationController?.popToRootViewController(animated: true)
136+
})
140137
}
141138
}

0 commit comments

Comments
Β (0)