Skip to content

Commit

Permalink
[Feat] #319 - 식당 상세로 push 될 때 네비바 세팅하는 코드 extension에 추가
Browse files Browse the repository at this point in the history
UIViewController+에 추가
  • Loading branch information
EunsuSeo01 committed Dec 29, 2024
1 parent 85eed08 commit 5d8c35e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Hankkijogbo/Hankkijogbo/Global/Extensions/UIViewController+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,20 @@ extension UIViewController {
self.view.window!.layer.add(transition, forKey: nil)
self.dismiss(animated: true, completion: nil)
}

/// 한끼 네비로 세팅한 후 식당 상세로 push
func pushToDetailWithHankkiNavigation(hankkiId: Int) {
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let rootViewController = windowScene.windows.first?.rootViewController as? HankkiNavigationController {
let type: HankkiNavigationType = HankkiNavigationType(hasBackButton: true,
hasRightButton: false,
mainTitle: .string(""),
rightButton: .string(""))
rootViewController.setupNavigationBar(forType: type)
rootViewController.isNavigationBarHidden = false

let hankkiDetailViewController = HankkiDetailViewController(viewModel: HankkiDetailViewModel(hankkiId: hankkiId))
rootViewController.pushViewController(hankkiDetailViewController, animated: true)
}
}
}

0 comments on commit 5d8c35e

Please sign in to comment.