-
UINavigationController -1ios 2020. 3. 13. 01:33
하나부터 차근차근, ios 앱 개발하는 날 까지 제가 공부한 내용을 정리하려고 합니다.
오늘은 UINavigationController를 공부했습니다.
이 글은
https://developer.apple.com/documentation/uikit/uinavigationcontroller
UINavigationController - UIKit | Apple Developer Documentation
Class UINavigationController A container view controller that defines a stack-based scheme for navigating hierarchical content. DeclarationOverviewA navigation controller is a container view controller that manages one or more child view controllers in a n
developer.apple.com
개발자 페이지에서 UINavigationController 자료를 해석한 것입니다.
목차는
1. UINavigationController란?
navigation controller는 하나의 view controller 입니다. navigation interface 내에서 1개 또는 2개의 자식 뷰들을 관리하는 view container 입니다. 이 인터페이스 유형은 한번에 오직 하나의 자식 뷰만 보여지게 됩니다.
선택된 view controller는 새로운 view controller를 화면에 animation과 함께 보여지게 됩니다. 그러므로 인해 , 이전의 view controller는 가려지게 됩니다.
유저 인터페이스의 최상단 네비게이션바에서 뒤로 가기 버튼을 탭 한다면, 이전의 숨겨진 view controller가 다시 들어나게 됩니다.
navigation controller 객체는 navigation stack이라 칭하는 정렬된 배열 사용하여 자식 view controllers을 관리합니다.
배열의 첫번째 view controller는 root view controller를 의미하고 스택에서 가장 밑에 있다는 것을 의미합니다.
배열의 마지막 view controller는 스택의 최상단을 의미하고, 현재 화면에 보여지고 있는 것을 의미합니다.
개발자는 segues을 사용하거나 또는 UINavigationController의 메소드를 사용하여 스택으로부터 view controller를 추가하고 제거할 수 있습니다.
사용자는 back button을 사용하여 최상단 view controller을 제거할 수 있고 left-edge swipe gesture을 사용하여 제거할 수 있습니다.
navigation controller는 사용자 인터페이스 상단의 navigation bar를 관리하고 또한 사용자 인터페이스의 하단에 있는 optional toolbar를 관리합니다.
navigation bar는 항상 사용자 인터페이스에 나타나고 navigation controller 자기 자신에 의해 관리되고 child view controllers의
content를 사용하여 navigation bar를 업데이트 시켜준다고 합니다.
'ios' 카테고리의 다른 글
단위 테스트 (Given, When, Then) 활용 (0) 2020.06.23 UICollectionView: Using Flow Layout (0) 2020.06.21 Label 줄바꿈 속성 (0) 2020.05.11 [ios] Then (1) 2020.04.17 WKWebView (0) 2020.03.20