Multi-view controller switching 1. Container Concept
• An iOS app is rarely composed of only one viewcontroller, unless the app is extremely simple. When the app has multiple viewcontrollers, you need to manage these viewcontrollers.
• Container concept: displays one or more viewcontrollers and manages their lifecycles.
•? Some containers are also a viewcontroller, which is called a container by the container management controller? Controller (childviewcontroller ),? The container is called the parent controller (parentviewcontroller)
• A very small number of containers, such as uipopovercontroller, are inherited from nsobject. Note: uipopovercontroller can only be used on iPad?
2. Container features
• You can add, remove, or switch between childviewcontroller
• Instances that hold all childviewcontroller (typically in nsarray)
• In Charge Of the view of childviewcontroller? Call of Life Cycle Method
-Viewwillappear
-Viewdidappear
-Viewwilldisaapper
-Viewdiddisappear-rotation event
3. Several Common switching methods of the visual controller in IOS
1. tabbar Tab
-The uitabbarcontroller is used as the container to manage the sub-View Controller in parallel.
• 2. Push
-Is the container managed as a stack using uinavigationcontroller? Sub-View Controller
• 3. Modal Mode
-Modal window ?? Display the New View Controller. Before the New View Controller is disabled ,? User? Method to interact with other controllers
Modal window? Port features
• Is it used separately? Window used ?? Port, independent of container View Controller
• Normal? Used for explicit? Relatively independent display? Li's window ?? Port, for example :? User Login, response? Usage
Sequence setting or help information
•? The user closes the modal window ?? Cannot be connected to the upper port? Level 1 view? Row Interaction
4. uitabbarcontroller, navigationcontroller
1. What is uitabbarcontroller? Use attributes
• Title: Title
• Image: Images
• Badgevalue: upper right? Corner icon
• Viewcontrollers: All? Sub-View Controller
• Note: When the tabbarcontroller is instantiated, all the subview controllers are loaded.
2. How uinavigationcontroller works
•? Principle: Manage in stack form? Sub-View Controller
• Uinavigationcontroller:
-Upper? The plane is uinavigationbar.
-Bottom? The plane is the view of the topviewcontroller. The navigationitem attribute of the topviewcontroller determines the uinavigationbar display? Content
In uinavigationcontroller? Use attributes and? Method
• Regular? Use attributes
Childviewcontrollers? Sub-View Controller
Title
Backbarbuttonitem return button
Left button of leftbarbuttonitem
Rightbarbuttonitem
• Regular? Use? Method
5. What about the segue object? Lifecycle
• Create? Target View Controller
• Create a segue object and call? Use its initwithidentifier: Source: Destination :? Method
• Mark? Is the identifier specified in interface builder? One mark? String. The other two parameters correspond to the start controller and the start controller of the arrow respectively? Target Controller
• Tune? Use the source View Controller's prepareforsegue: Sender :? Method call? Use the perform of the segue object? Method? Target View Controller pushes to the screen to release the segue object
PS: multi-view controller jump method summary
• Model
-Enable: presentviewcontroller: animated: Completion:-Disable: dismissviewcontrolleranimated: Completion:
• Push
-Enable: pushviewcontroller: animated:-Disable: popviewcontrolleranimated:
• Segue
-OK? Can it be used for modal? Used for push
-If yes ?? The Target Controller requires additional processing. You can use javasmseguewithidentifier: Sender :? Method