Four core sections of IOS

Source: Internet
Author: User
Tags hmac openssl library

Four core parts of IOS

1. Cocoa touch
Key Technologies of the cocoa touch layer.
(1) multi-task
Ios sdk 4.0 and later SDK build programs (which run on devices of IOS 4.0 and later versions) will not end when you press the Home button; they will be moved to the background for running. The multi-task support supported by uikit allows the program to smoothly switch to the background or back.
To save power, most programs will be suspended immediately after they enter the background. The paused program is still in the memory, but no code is executed. In this way, the program can be quickly restored when it needs to be re-activated, without wasting any power. However, the program can also run in the background for the following reasons:
The program can apply for a limited amount of time to complete some important tasks.
The program can declare a certain service that requires a periodic background running time.
The program can use local notifications to send messages to users at a specified time, regardless of whether the program is running or not.
No matter whether your program is paused or continues running in the background, you do not need to do anything extra to support multiple tasks. The system will notify the program when it is switched to the background or switched back. At this time point, the program can directly execute some important tasks, such as saving user data.
 
(2) print
From IOS 4.2, uikit introduced print support, allowing programs to send content to nearby printers through wireless networks. For printing, most of the manual work is undertaken by uikit. It manages print interfaces, renders printed content in collaboration with your program, and schedules and executes print jobs in the printer.
The print job submitted by the program is passed to the printing system, which manages the real printing process. Print jobs of all programs on the device are queued and printed first in and out. You can view the print job status from the print center program. All the printed details are automatically processed by the system.
Note: Only devices supporting multiple tasks support wireless printing. Your program can use the uiprintinteractioncontroller object to check whether devices support wireless printing.
 
(3) data protection
Ios4.0 introduces the data protection function. Applications that need to process sensitive user data can use the built-in encryption function of some devices (not supported by some devices ). When the program specifies that a file is protected, the system will save the file in encrypted format. When the device is locked, neither your program nor potential intruders can access the data. However, when the device is unlocked by the user, a key is generated to allow your program to access the file.
To achieve good data protection, you need to carefully consider how to create and manage the data you need to protect. Applications must ensure data security when creating data and adapt to changes in file accessibility caused by Device Locks.
 
(4) Apple push notification service
Since IOS 3.0, Apple released the apple push notification service, which provides a mechanism to send new information to users even if your program has exited. With this service, you can push text notifications to your devices at any time, and include program icons as the identifier to send a prompt. These messages prompt you that you should open your program to receive and view relevant information.
From the design point of view, to enable the IOS program to send push notifications, two parts of work are required. First, the program must request the sending of the notification and be able to process the notification data upon delivery. Then, you need to provide a server process to generate these notifications. This first-class process occurs on your own server and triggers a notification together with Apple's push notification service.
 
(5) local notification
Since IOS 4.0, Apple has launched local notifications. As a supplement to the push notification mechanism, apps can use this method to create notifications locally without relying on an external server. Programs running in the background can be used to notify users of the important time. For example, a navigation program running in the background can use local notifications to prompt users to turn. The program can also schedule to send local notifications at a certain time in the future. Such notifications can be sent even if the program has been terminated.
The advantage of local notification is that it is independent of your program. Once a notification is scheduled, the system manages its sending. When a message is sent, the application is not even running.
 
(6) gesture Reader
Starting from IOS 3.2, a gesture reader is introduced. You can append it to the view and use them to detect Common gestures, such as crossing or kneading. After you attach the gesture identification device to the view, you can set the operation to be performed when the gesture occurs. The gesture reader tracks the original Touch events and uses the preset algorithm to determine the current gesture. Without a gesture identification tool, you have to perform these calculations on your own. Many of them are quite complicated.
Uikit contains the uigesturerecognizer class, which defines the standard behavior of all gesture identifiers. You can define your own custom gesture identification subclass or use the gesture identification subclass provided by uikit to process the following standard gestures:
Click (any times)
Pinch and zoom
Pan or drag
Crossing (any direction)
Rotate (the fingers are in the opposite direction)
Long press
 
(7) file sharing support
File Sharing support was introduced from IOS 3.2. It can be used to develop user data files to iTunes 9.1 and later versions. Once the program declares that it supports file sharing, the files in ITS/Documents Files directory will be open to users. You can use iTunes to put files in or retrieve them. This feature does not allow your program to share files with other programs on the same device. You need to use the clipboard or the uidocumentinteractioncontroller.
To enable file sharing support, please:
In the info. plist file of the program, add the uifilesharingenabled key and set the value to yes.
Put the file you want to share in the program's documents directory.
When a device is inserted into a user's computer, iTunes displays a file sharing block under the program page of the selected device.
You can add or delete files on the desktop.
Programs that support file sharing must be able to identify files placed in the documents directory and process them correctly. For example, a program should use its own interface to display new files, rather than listing these files in a directory and asking users how to handle these files.
 
(8) point-to-point combat service
The game KIT framework introduced from IOS 3.0 provides a Bluetooth-based point-to-point combat function. You can use point-to-point connections to establish communication with nearby devices. This is a feature that many multiplayer games require. Although this is mainly used for games, it can also be used in other types of programs.
For more information about how to use the point-to-point combat function in a program, refer to the Standard System View Controller.
Many cocoa touch layer frameworks provide a view controller to display standard system interfaces. You should try to use these view controllers to maintain consistent user experience. You should use the View Controller provided by the corresponding framework whenever you need to perform the following operations:
Display and edit contact information-use the View Controller provided by the address book UI framework.
Create and edit calendar events-use the View Controller provided by the event kit UI framework.
Write an email or short message-use the View Controller provided by the message UI framework.
Open or preview the file content-use the uidocumentinteractioncontroller class in the uikit framework.
Take a photo or select a photo from your photo library-use the uiimagepickercontroller class in the uikit framework.
Take a video-use the uiimagepickercontroller class in the uikit framework.
 
(9) external display support
In IOS 3.2, external display support was introduced, allowing some iOS devices to connect to external monitors through the supported cables. During connection, the program can display the content on the corresponding screen. The screen information, including the supported resolutions, can be accessed using interfaces provided by the uikit framework. You can also use this framework to connect a program window to a screen or another screen.
 
(10) cocoa touch framework
The following sections describe the cocoa touch layer framework and the services they provide.
* Address Book UI framework
The address book UI framework (addressbookui. Framework) is an objective-C programming interface that displays the standard system interface for creating, editing, and selecting existing contacts. This framework allows you to easily display contact information in the program, and ensure that your program uses the same interface as other programs to maintain the consistency of the platform.
 
* Event kit UI framework
From IOS 4.0, the event kit UI framework (eventkitui. Framework) was introduced to provide a View Controller for displaying and editing events. This framework is based on the event-related data structure provided by the event KIT framework. For details, see event KIT framework.
 
* Game KIT framework
IOS 3.0 introduces the game KIT framework (gamekit. Framework) to support point-to-point network communication in programs. In particular, this framework supports point-to-point connections and in-game voice calls. Although these functions are mainly used for multiplayer online games, they can also be used in non-game programs. The network functions provided by this framework are implemented by several simple classes built on bonjour. These classes abstract a lot of network details, allowing developers without network programming experience to easily add network functions to programs.
 
* IAD framework
IOS 4.0 introduces the IAD framework (IAD. Framework) Support Program to display banner advertisements. Advertisements are composed of standard views. you can insert them into your user interface and display them properly. View itself communicates with Apple's advertising service to handle all the work of loading and displaying ad content and responding to clicks.
 
* Map KIT framework
IOS 3.0 introduces the map KIT framework (mapkit. Framework) to provide a map interface that can be embedded into a program. Based on this interface, it provides a scalable map view that can mark custom information. You can embed it in the view of the program, program the map attributes, and save the currently displayed map area and user location. You can also define custom tags, or use standard tags to highlight areas on a map and display additional information.
Starting from IOS 4.0, this framework has added the ability to drag tags and customize override objects. The drag tag allows you to move a tag that has been placed on a map, program it, or use user behavior. Overwriting objects provide the ability to create map tags that are more complex than the marked points. You can use the overwriting object to place information on the map, such as the bus route, selection chart, parking area, and weather information (such as radar data ).
 
* Message UI framework
IOS 3.0 introduces the message UI framework (messageui. framewok), which provides the ability to write and query box-based messages. Write support contains a View Controller Interface that can be displayed in the program. You can enter the information you want to send in the interface. You can set the recipient, subject, content, and attachment. You can select the priority of the information. After selection, the information will be queued in the user's sender for sending.
For IOS 4.0 and later systems, this framework began to support the view controller used to write short messages. You can use this view controller to create and edit short messages without leaving the program. Like the email writing interface, this interface allows users to select whether to edit before sending.
 
2. Media
The media layer provides multimedia functions such as images, music, and videos. Images are divided into 2D images and 3D images. The former is supported by quartz2d, while the latter uses opengles. the modules corresponding to music are core audio and openal. Media Player enables video playback and finally provides core animation for powerful animation support. The details are as follows:
(1) Image Technology (Graphics technologies)
High-quality images are an important part of all iPhone applications. At any time, developers can develop iPhone applications using existing views, functions, and predefined images in the uikit framework. However, when the views and functions in the uikit framework cannot meet the requirements, developers can apply the technologies and methods described below to create views.
① Quartz. The core image framework (CoreGraphics. Framework) contains the quartz 2D drawing API. quartz is as advanced as the vector graphics engine used in Mac OS. Quartz supports path-based plotting, anti-obfuscation (Anti-aliased) overloading, gradients, images, and colors), coordinate-space transformations, PDF document creation, display, and resolution. Although the API is based on the C language, it uses Object-based abstract representation of Basic drawing objects, making the image content easy to save and reuse.
② Core animation ). Quartz core framework (quartzcore. framework) includes the coreanimation interface, which is an advanced animation and synthesis technology. It uses an optimized rendering path to implement complex animations and virtual effects. It uses a high-level objective-C interface to configure the animation and effect, and then reload it to obtain better performance on the hardware. Core animation is integrated into many parts of the iPhone OS, including the uikit class such as uiview, which provides animations of many standard system behaviors. Developers can also use the objective-C interface in this framework to create custom animations.
③ OpenGL ES. The OpenGL ES framework (opengles. Framework) complies with OpenGL ES V1.1 specifications and provides a tool for painting 2D and 3D content. The OpenGL ES framework is based on the C language and closely related to hardware devices. It provides high frame rates for full-screen game applications ). Developers always need to use the eagl interface of the OpenGL framework. The eagl interface is part of the OpenGL ES framework. It provides the OpenGL ES drawing code of the application and the interface of the local window object.
(2) Audio Technologies)
The audio technology of iPhone OS provides users with a rich audio experience. It includes audio playback, high-quality recording, and vibration triggering functions. IPhone OS audio technology supports the following audio formats: AAC, Apple lossless (ALAC), A-Law, Ima/ADPCM (ima4), linear PCM, μ-Law, and core audio.
① Core audio family ). The core audio family of frameworks provides local audio support, as shown in table 16-1. Core audio is a C-language-based interface that supports stereo ). Develop a core audio framework that can use the iPhone OS to generate, record, mix, and play audio in iPhone applications. Developers can also access the vibration function of mobile devices through core audio.
Core audio framework:
Framework Service)
Coreaudio. Framework defines the audio data type of the core audio.
Audiounit. Framework provides audio and streaming media file playback and recording, and manages audio
Audio files and playback prompts
Audiotoolbox. Framework provides the built-in audio Unit Service and audio processing module.
② Openal. The iPhone OS also supports open Audio Library (openal ). Openal is a cross-platform standard that can transmit positional audio ). Developers can use openal to achieve high-performance and high-quality audio in games or other applications that require location audio output. Because openal is a cross-platform standard, openal code modules can be smoothly transplanted to other platforms.
(3) video technologies)
The iPhone OS supports full-screen video playback through the mediaplayer. framework. The media playback framework supports the following video file formats:. mov,. MP4,. m4v, And. 3GP. The following compression standards are applied:
① H.264 baseline profile level 264 video, with a resolution of 3.0x640 pixels at 30 F/s. Note: B frames is not supported;
② MPEG4 standard Video Section;
③ A large number of audio formats are included in the audio technology list, such as AAC, Apple lossless (ALAC), A-Law, Ima/ADPCM (ima4) linear PCM, μ-Law, and core audio.
 
3. Core Services
Core Services provides richer functions based on core OS, including Foundation. framework and core Foundation. framework is called foundation because it provides a series of basic functions to process strings, arrange, combine, calendar, and time. Foundation is an API of objective-C, and core fundation is an API of C. In addition, core servieces provides other functions, such:
Security, core location, SQLite, and address book. among them, security is used to process authentication, password management, and security management; core location is used to process GPS positioning; sqllite is a lightweight database, while addressbook is used to process phone thin data. The following is a detailed introduction:
(1) Phone Book
The Mobile Phone Book framework (addressbook. Framework) provides a programming interface for the phone book stored on mobile devices. Developers can use this framework to access and modify records stored in the user contact database. For example, a chat program can use this framework to obtain a list of possible contacts, start the chat process, and display the contact information in the view.
(2) core basic framework
Corefoundation. Framework is a C-language-based interface set that provides basic data management and service functions for iPhone applications. The Framework supports the following functions:
Collection data types (arrays, sets, etc );
Bundles;
String management;
Date and time management;
Raw data block management;
Preference management;
URL and stream operations;
Run loops );
Port and socket communication.
The core and basic frameworks are closely related and provide objective-C interfaces for the same basic functions. If developers use both the foundation objects and core foundation types, they can make full use of the "toll-free bridging" in the two frameworks ". Toll-free bridging means that developers can use any of the core and basic types of the two frameworks, such as collection and string types. The description of classes and Data Types in each framework indicates whether the object supports toll-free bridged. If yes, which object does it bridge with (toll-free
Bridged ).
(3) cfnetwork
Cfnetwork framework is a set of high-performance C language interfaces that provide network protocol object-oriented abstraction. Developers can use the cfnetwork framework to operate protocol stacks and access low-layer structures such as BSD sockets. At the same time, developers can also simplify communication with FTP and HTTP servers, or resolve DNS tasks. The tasks implemented using the cfnetwork framework are as follows:
BSD sockets;
Use SSL or TLS to create an encrypted connection;
DNS hosts resolution;
Parse the HTTP protocol to identify HTTP and HTTPS servers;
Working on the FTP server;
Publish, parse, and browse bonjour services.
(4) core location framework)
The core location. framework is used to obtain the current longitude and latitude of mobile devices. The core location framework uses nearby GPS, cellular base stations, or Wi-Fi signal information to measure the user's current location. The iPhone map app uses this function to display the current location of a user on a map. Developers can integrate this technology into their own applications to provide users with bit information services. For example, you can provide a service to find nearby restaurants, stores, or devices based on your current location.
(5) Security Framework)
In addition to the built-in security features, the iPhone OS also provides an external security framework to ensure the security of application data. This framework provides interfaces for managing certificates, public/private key pairs, and trust policies. It supports generating encrypted and secure pseudo-random numbers, as well as certificates and keys stored in the key chain. It is a secure knowledge base (secure repository) for sensitive user data ). The commoncrypto interface also supports symmetric encryption, HMAC, and data summarization. There is no OpenSSL library in the iPhone OS, but the functions provided by the data digest are essentially the same as those provided by the OpenSSL library.
(6) SQLite
An iPhone application can embed a small SQL database SQLite without running another database server remotely. Developers can create local database files and manage tables and records in these files. Database SQLite is designed for general purposes, but can still be optimized to quickly access database records. The header file for accessing the database SQLite is in <iphonesdk>/usr/include/sqlite3.h, where <iphonesdk> is the target path for SDK installation.
(7) Support for XML
The basic framework provides the nsxmlparser class to parse XML document elements. The libxml2 library provides the ability to operate XML content. This open source library can quickly parse and edit XML data and convert XML content to HTML. The header file used to access the libxml2 library is located in the directory <iphonesdk>/usr/include/libxml2/, where <iphonesdk> is the target directory for SDK installation.
 
4. Core OS

The core service layer provides basic system services for all applications. Even if you do not directly use these services, you should also understand the technologies built in the system.

(1) Phone Book

The Mobile Phone Book framework (addressbook. Framework) provides a programming interface for the phone book stored on mobile devices. Developers can use this framework to access and modify records stored in the user contact database. For example, a chat program can use this framework to obtain a list of possible contacts, start the chat process, and display the contact information in the view.

(2) core basic framework

Corefoundation. Framework is a C-language-based interface set that provides basic data management and service functions for iPhone applications. The Framework supports the following functions:

Collection data types (arrays, sets, etc );

Bundles;

String management;

Date and time management;

Raw data block management;

Preference management;

URL and stream operations;

Run loops );

Port and socket communication.

The core and basic frameworks are closely related and provide objective-C interfaces for the same basic functions. If developers use both the foundation objects and core foundation types, they can make full use of the "toll-free bridging" in the two frameworks ". Toll-free bridging means that developers can use any of the core and basic types of the two frameworks, such as collection and string types. The description of classes and Data Types in each framework indicates whether the object supports toll-free bridged. If yes, which object does it bridge with (toll-free
Bridged ).

(3) cfnetwork

Cfnetwork framework is a set of high-performance C language interfaces that provide network protocol object-oriented abstraction. Developers can use the cfnetwork framework to operate protocol stacks and access low-layer structures such as BSD sockets. At the same time, developers can also simplify communication with FTP and HTTP servers, or resolve DNS tasks. The tasks implemented using the cfnetwork framework are as follows:

BSD sockets;

Use SSL or TLS to create an encrypted connection;

DNS hosts resolution;

Parse the HTTP protocol to identify HTTP and HTTPS servers;

Working on the FTP server;

Publish, parse, and browse bonjour services.

(4) core location framework)

The core location. framework is used to obtain the current longitude and latitude of mobile devices. The core location framework uses nearby GPS, cellular base stations, or Wi-Fi signal information to measure the user's current location. The iPhone map app uses this function to display the current location of a user on a map. Developers can integrate this technology into their own applications to provide users with location information services. For example, you can provide a service to find nearby restaurants, stores, or devices based on your current location.

(5) Security Framework)

In addition to the built-in security features, the iPhone OS also provides an external security framework to ensure the security of application data. This framework provides interfaces for managing certificates, public/private key pairs, and trust policies. It supports generating encrypted and secure pseudo-random numbers, as well as certificates and keys stored in the key chain. It is a secure knowledge base (secure repository) for sensitive user data ).

The commoncrypto interface also supports symmetric encryption, HMAC, and data summarization. There is no OpenSSL library in the iPhone OS, but the functions provided by the data digest are essentially the same as those provided by the OpenSSL library.

(6) SQLite

An iPhone application can embed a small SQL database SQLite without running another database server remotely. Developers can create local database files and manage tables and records in these files. Database SQLite is designed for general purposes, but can still be optimized to quickly access database records. The header file for accessing the database SQLite is located in <iphonesdk>/usr/include/sqlite3.h, where <iphonesdk> is the target path for SDK installation.

(7) Support for XML
The basic framework provides the nsxmlparser class to parse XML document elements. The libxml2 library provides the ability to operate XML content. This open source library can quickly parse and edit XML data and convert XML content to HTML. The header file used to access the libxml2 library is located in the directory <iphonesdk>/usr/include/libxml2/, where <iphonesdk> is the target directory for SDK installation.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.