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] #255 - 명함생성 후 두번째 명함으로 이동 및 리스트편집 후 첫번째 명함으로 이동 #256

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion NADA-iOS-forRelease/Resouces/Constants/Notification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ extension Notification.Name {
static let presentCardShare = Notification.Name("presentCardShare")
static let passDataToGroup = Notification.Name("passDataToGroup")
static let passDataToDetail = Notification.Name("passDataToDetail")
static let reloadMainCardSwiper = Notification.Name("reloadMainCardSwiper")
static let listReloadMainCardSwiper = Notification.Name("listReloadMainCardSwiper")
static let creationReloadMainCardSwiper = Notification.Name("creationReloadMainCardSwiper")
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ extension CardCreationPreviewViewController {

guard let presentingVC = self.presentingViewController else { return }

NotificationCenter.default.post(name: .reloadMainCardSwiper, object: nil)
NotificationCenter.default.post(name: .creationReloadMainCardSwiper, object: nil)

self.dismiss(animated: true) {
if UserDefaults.standard.object(forKey: Const.UserDefaultsKey.isFirstCard) == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CardListViewController: UIViewController {

// MARK: - IBAction Properties
@IBAction func dismissToPreviousView(_ sender: UIButton) {
NotificationCenter.default.post(name: .reloadMainCardSwiper, object: nil)
NotificationCenter.default.post(name: .listReloadMainCardSwiper, object: nil)
self.navigationController?.popViewController(animated: true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ extension FrontViewController {

private func setNotification() {
NotificationCenter.default.addObserver(self, selector: #selector(didRecievePresentCardShare(_:)), name: .presentCardShare, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(setReloadMainCardSwiper), name: .reloadMainCardSwiper, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(setCreationReloadMainCardSwiper), name: .creationReloadMainCardSwiper, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(setListReloadMainCardSwiper), name: .listReloadMainCardSwiper, object: nil)
}

private func setUserID() {
Expand All @@ -89,7 +90,15 @@ extension FrontViewController {
}

@objc
private func setReloadMainCardSwiper() {
private func setCreationReloadMainCardSwiper() {
cardDataList?.removeAll()
offset = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오프셋 0 화긴입니당!!

_ = cardSwiper.scrollToCard(at: 1, animated: false)
cardListFetchWithAPI(userID: userID, isList: false, offset: offset)
}

@objc
private func setListReloadMainCardSwiper() {
cardDataList?.removeAll()
offset = 0
_ = cardSwiper.scrollToCard(at: 0, animated: false)
Expand Down