Skip to content

Commit

Permalink
feat: 로그아웃된 상태에서는 내 명함 위젯으로 앱 들어와도 바텀시트막기 (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyun99999 committed May 12, 2023
1 parent f6489f0 commit d97060c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
30 changes: 16 additions & 14 deletions NADA-iOS-forRelease/Sources/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,23 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
}
} else if url.absoluteString.starts(with: myCardURL) {
// 내 명함 위젯.
guard let queryItems = urlComponents.queryItems,
let cardUUID = queryItems.filter({ $0.name == "cardUUID" }).first?.value else { return }

let nextVC = CardShareBottomSheetViewController()
.setTitle("명함공유")
.setHeight(606.0)

cardDetailFetchWithAPI(cardUUID: cardUUID) { cardDataModel in
nextVC.isActivate = false
nextVC.modalPresentationStyle = .overFullScreen
nextVC.cardDataModel = cardDataModel
if UserDefaults.appGroup.string(forKey: Const.UserDefaultsKey.accessToken) != nil {
guard let queryItems = urlComponents.queryItems,
let cardUUID = queryItems.filter({ $0.name == "cardUUID" }).first?.value else { return }

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
let topVC = UIApplication.mostTopViewController()
topVC?.present(nextVC, animated: true)
let nextVC = CardShareBottomSheetViewController()
.setTitle("명함공유")
.setHeight(606.0)

cardDetailFetchWithAPI(cardUUID: cardUUID) { cardDataModel in
nextVC.isActivate = false
nextVC.modalPresentationStyle = .overFullScreen
nextVC.cardDataModel = cardDataModel

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
let topVC = UIApplication.mostTopViewController()
topVC?.present(nextVC, animated: true)
}
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,18 @@ extension HomeViewController {
}

private func presentCardShareBottomSheetVC(with cardUUID: String) {
self.cardDetailFetchWithAPI(cardUUID: cardUUID) { [weak self] cardDataModel in
let nextVC = CardShareBottomSheetViewController()
.setTitle("명함공유")
.setHeight(606.0)

nextVC.isActivate = false
nextVC.modalPresentationStyle = .overFullScreen
nextVC.cardDataModel = cardDataModel

self?.present(nextVC, animated: true)
if UserDefaults.appGroup.string(forKey: Const.UserDefaultsKey.accessToken) != nil {
self.cardDetailFetchWithAPI(cardUUID: cardUUID) { [weak self] cardDataModel in
let nextVC = CardShareBottomSheetViewController()
.setTitle("명함공유")
.setHeight(606.0)

nextVC.isActivate = false
nextVC.modalPresentationStyle = .overFullScreen
nextVC.cardDataModel = cardDataModel

self?.present(nextVC, animated: true)
}
}
}

Expand Down

0 comments on commit d97060c

Please sign in to comment.