Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] #235 - 명함생성 userID 가져오기 및 메인 카드 리스트 조회 로직 변경 #239

Merged
merged 1 commit into from
Dec 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ class FrontViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

setUserID()
setDelegate()
setNotification()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

setCardDataModelList()
cardDataList?.removeAll()
offset = 0
cardListFetchWithAPI(userID: userID, isList: false, offset: offset)
}

Expand All @@ -41,7 +43,8 @@ class FrontViewController: UIViewController {
@IBAction func presentToCardCreationView(_ sender: Any) {
let nextVC = UIStoryboard(name: Const.Storyboard.Name.cardCreation, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.cardCreationViewController)
let navigationController = UINavigationController(rootViewController: nextVC)
navigationController.modalPresentationStyle = .overFullScreen
navigationController.modalPresentationStyle = .fullScreen

self.present(navigationController, animated: true, completion: nil)
}

Expand Down Expand Up @@ -71,7 +74,14 @@ extension FrontViewController {
NotificationCenter.default.addObserver(self, selector: #selector(didRecievePresentCardShare(_:)), name: .presentCardShare, object: nil)
}

@objc func didRecievePresentCardShare(_ notification: Notification) {
private func setUserID() {
userID = UserDefaults.standard.string(forKey: Const.UserDefaultsKey.userID)
}

// MARK: - @objc Methods

@objc
private func didRecievePresentCardShare(_ notification: Notification) {
let nextVC = CardShareBottomSheetViewController()
.setTitle("명함공유")
.setHeight(404)
Expand All @@ -83,11 +93,6 @@ extension FrontViewController {
nextVC.modalPresentationStyle = .overFullScreen
self.present(nextVC, animated: false, completion: nil)
}

private func setCardDataModelList() {
guard let userID = userID else { return }
cardListFetchWithAPI(userID: userID, isList: false, offset: offset)
}
}

// MARK: - VerticalCardSwiperDelegate
Expand Down