IOS&Mac
[swift] Navigation 정리
MOVE🔥
2023. 3. 3. 11:56
728x90
반응형
Navigation Stack
👉 네비게이션 뷰 컨트롤러 관리 하는데 사용
배열 형식으로 되어있음
pushViewController, popViewController 존재
Navigation Bar
- Title - Navigation Item을 추가해줘야 함
- (bar) button Item
- 바 숨기기
override func viewWillAppear(_ animated: Bool) {
self.navigationController!.setNavigationBarHidden(true, animated: true)
}
Navigation 동작
1. View Controller instance 가져옴
guard let rvc = self.storyboard?.instantiateViewController(identifier: "ResultVC") else {return}
2. push/pop viewController로 화면 전환
self.navigationController?.pushViewController(rvc, animated: true)
Navigation 투명 ( background 색 변경 )
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true
self.navigationController?.view.backgroundColor = .clear
728x90
반응형