This is the 18th day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021
Overall iOS framework
Usually we call the iOS framework Cocoa framework. Without further ado, the official framework is as follows:
A quick explanation:
- Cocoa (Application) Layer
- Media Layer
- Core Services Layer
- Core OS Layer
- The Kernel and Device Drivers layer
Note :Cocoa (Application) Layer actually includes Cocoa Touch Layer and Application Layer. The application layer was originally above the touch layer, and since the application layer is implemented by the developers themselves, it is integrated with the touch layer.
In fact, each layer contains multiple subframes, as shown below:
A quick explanation (just take a peek):
-
Cocoa Touch Layer: The Touch Layer provides the key technical support for the application base and the appearance of the application. Such as NotificationCenter local notification and remote push services, iAd advertising framework, GameKit game tools framework, message UI framework, image UI framework, map framework, connect watch framework, UIKit framework, automatic adaptation and so on
-
Media Layer: Media Layer provides audio and visual aspects of the application of technology, such as graphic images related CoreGraphics CoreImage, GLKit, OpenGL ES, CoreText, ImageIO and so on. Sound technology related CoreAudio OpenAL, AVFoundation, video related CoreMedia, Media Player framework, audio and video transmission of AirPlay framework, and so on
-
Core Services Layer: The system Services Layer provides basic system Services required by applications. Such as Accounts framework, advertising framework, data storage framework, network connectivity framework, location framework, movement framework and so on. At the heart of these services are CoreFoundation and the Foundation framework, which define the data types used by all applications. CoreFoundation is a set of INTERFACES based on C, and Foundation is an OC wrapper around CoreFoundation
-
Core OS Layer: The system Core Layer contains most low-level, hardware-like functionality, and contains frameworks that are often used by other frameworks. The Accelerate framework includes interfaces for digital signals, linear algebra, and image processing. Optimize for hardware differences on all iOS devices to ensure that once written code runs efficiently on all iOS devices. The CoreBluetooth framework uses Bluetooth to interact with peripherals, including scanning connected Bluetooth devices, saving connection status, disconnecting, retrieving or transferring data to peripherals, and more. The Security framework provides Security related solutions for managing certificates, public and private key trust policies, keychain,hash authentication and digital signatures, and more.
For more details, you can go to: introduction and detailed description of the iOS framework
We just need to know that the important frameworks are the UIKit and Function frameworks. Let’s talk about these two frameworks.
The Function framework
The Foundation framework provides basic system services for all applications. Applications, UIKit and other frameworks, are built on top of the Foundation framework’s infrastructure. The Foundation framework provides many basic object classes and data types that form the basis for application development.
Without further discussion, let’s take a look at the Foundation framework. There are three images, including all the Foundation classes. The gray ones are not supported by iOS, and the gray ones are for OS X.
All you need to know here is that most of the Function framework classes inherit from NSObject and a few inherit from NSProxy
See iOS Development Series – Objective-C Foundation Framework for more details on how to use some of the basic classes in the Foundation framework
UIKit framework
The UIKit framework provides a set of classes to create and manage iOS applications’ user interface (UI) interfaces, application objects, event controls, drawing models, Windows, views, and interfaces for controlling touch screens, etc.
The class inheritance system diagram of UIKit framework is as follows:
As you can see in the figure, the Responder class is the root class of the largest branch in the figure, and UIResponder defines the interface and default behavior for handling response events and response chains. When the user scrolls the list with his finger or types on the virtual keyboard, UIKit generates an event and passes it to the UIResponder response chain until there is an object in the chain to handle the event. Corresponding core objects such as UIApplication, UIWindow, and UIView inherit directly or indirectly from UIResponder.
One thing to know here: all classes in the UIKit framework inherit from NSObject
A brief introduction to each class of the UIKit framework is linked to a brief description of each class of the UIKit framework