UIKit-View

What is UIKit

UIKit and Foundation are two frameworks in the Cocoa framework collection. They are native object-oriented APIs for creating IOS programs.

The difference between UIKIt and AppKit

NSwindiwo in AppKit is a subclass of NSResponder. However, UIWindow in UIKit is a subclass of UIView, mainly to support window layering at the operating system level. For example, the system can display the status bar in a separate window and let the window float on top of the app window.
AppKit applications can have any number of windows, while most iOS has only one window, so because there is only one window, data on different screens is displayed. It is no longer possible to switch to other windows. It can only be done by switching the specified view.

What is Core Animation

There are two types of view controllers

ways of presenting

1. The modal view controller (Modal View Controller)
is displayed on top of the current view controller in the form of an overlay, covering the entire screen or part of the screen. Usually used to display temporary content that is independent of the main interface of the application, such as the login interface, settings interface, or sharing interface. A modal view controller can be presented by calling the presentViewController:animated:completion: method.
2. Views in Navigation Stack are managed in the form of a stack and presented in the navigation controller interface. Navigation controllers provide navigation bars and navigation bar stacks, allowing users to push and pop navigation operations between view controllers. Navigation controllers are mainly used to implement hierarchical view controller navigation, such as navigating to different content pages, returning to the previous page, or implementing deep links.

relation:

Modal view controllers are usually temporary and have no clear parent-child relationship with the current view controller. With modal presentation, they can be displayed on top of any view controller and can be dismissed or dismissed when complete.
The views in the navigation stack form a parent-child relationship, with each view controller having a reference to the view controller above it. When you push a new view controller onto the stack via a push operation, the new view controller becomes a child of the current view controller and appears in the navigation controller's interface. With the pop operation, you can remove a view controller from the stack and return to the previous view controller.

Navigation and interface management:

Modal view controllers are typically used to present separate tasks or processes, so they often need to handle their interface and navigation logic themselves. You need to implement operations such as return, cancellation, or completion in the modal view controller, and consider how to close the modal view controller and return to the original interface.
The views in the navigation stack are managed by the navigation controller to manage navigation logic and interface switching. The navigation controller provides functions such as a navigation bar, a back button, and a sliding return gesture to simplify interface navigation and manage the navigation stack. You can navigate to different view controls using push and pop operations.

Supongo que te gusta

Origin blog.csdn.net/qq_43535469/article/details/131276501
Recomendado
Clasificación