@@ -10,6 +10,7 @@ import Moya
10
10
import RxMoya
11
11
import RxSwift
12
12
import SnapKit
13
+ import SwiftKeychainWrapper
13
14
import Then
14
15
15
16
protocol PagingTabbarDelegate {
@@ -72,6 +73,8 @@ class MypageViewController: UIViewController {
72
73
var categoryArray : [ MyCategoryList ] = [ ] /// 서버통신해서 카테고리 배열을 받아온다
73
74
var categoryIdArray : [ String ] = [ ] /// 카테고리 아이디를 저장해놓는 배열 -> 카테고리 상세 페이지로 넘어갈 때 사용할 파라미터
74
75
76
+ var loginVCFlag : Int = 2
77
+
75
78
// MARK: - LifeCycle
76
79
override func viewDidLoad( ) {
77
80
super. viewDidLoad ( )
@@ -380,22 +383,20 @@ extension MypageViewController {
380
383
}
381
384
}
382
385
@objc func backButtonClicked( ) {
383
- /// TODO: 자동로그인 여부 확인해서 분기처리
384
- // let mapVC = (self.navigationController?.children[2] as? MapViewController)!
385
- // self.navigationController?.popToViewController(mapVC, animated: true)
386
- // self.navigationController?.popViewController(animated: true)
387
- let mapVC = self . navigationController? . children [ 1 ] as? MapViewController
388
- print ( " @@ " )
389
- print ( mapVC)
390
- print ( self . navigationController? . children)
391
- // self.navigationController?.popToRootViewController(animated: true)
392
- if let vc = mapVC {
393
- print ( " ~~~ " )
394
- 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
+ }
395
399
}
396
- // else {
397
- // self.navigationController?.popToRootViewController(animated: true)
398
- // }
399
400
}
400
401
@objc func cafeTITestButtonClicked( ) {
401
402
let cafetiVC = CafeTIViewController ( )
0 commit comments