- An iOS overview
- Conditional settings for UI design
- iOS System Architecture Hierarchy
- Sequence of execution of two programs
First, iOS overview
iOS (originally, Apple did not give an iphone-issued iOS a separate title, until March 6, 2008, it was named as the iphone OS, and in June 2010 renamed the current name of iOS) is the operating system developed by Apple for mobile devices, Supported devices include iphone, IPod Touch, ipad and Apple TV. Unlike Android and Windows Phone, iOS does not support non-Apple hardware devices. January 9, 2007 Apple released iOS in the Macworld conference and released the first version of iOS in the same year on June 29. Currently, the latest version of iOS is 8.4 (released on June 30, 2015).
Conditional settings for UI design
While Apple has provided us with a number of controls to lay out the application, there is no principle, we need to arrange the controls reasonably, and the user experience is the best, the following are the constraints of the UI design:
- Displays the area. Minimal and compact interface elements, large enough interactive controls.
- File size. Limited storage space, download time and traffic cost, resource loading speed.
- Memory space. The program runs small, memory management is optimized to avoid high-quality pictures and audio.
- Program run limit. There is only one foreground program at a time, and the program exits no more than 5 seconds.
- Data access. You cannot use a static class library in another app, you cannot access any files other than the sandbox, and you cannot share the sandbox files. Some system resources, libraries, address books, etc. can be accessed through specific APIs, and network resources can be accessed when there is a network link.
- Energy consumption. CPU load, heat, battery consumption fast, algorithm optimization.
- User usage habits. Quick Start, short-term use, may exit at any time, avoid superfluous help, save automatically.
iOS System Architecture Hierarchy
iOS is based on the same kernel as Mac OS X, and the iOS app is supported by the OS technology level shown.
|
| Touch Application layer (the Cocoa touch layer) |
| Media layer |
| Core Services Layer |
| Core OS Layer |
1. Core OS and core services tiers provide underlying support, including file access, network protocols, low-level data types, and so on, which are C-based interfaces, including APIs such as Core Foundation,cfnetwork,sqlite.
2. The media layer provides some basic support for drawing, sound, and video technology, including C-based OpenGL Es,quartz,core Audio and Objective-c-based Core animation.
3. The Cocoa touch layer includes most APIs that use objective-c primarily by foundation and Uikit two frameworks, which provide object-oriented file access, network operations, data, collection types, and more.
In app development, these levels of technology should be used from top to bottom, and the Cocoa touch layer provides you with basic system behavior support, and minimizes your workload, and when you want to implement more complex behaviors and interfaces, consider seeking technical support from the lower level.
Ii. sequence of execution of procedures
1.MAIN.M is a program's mouth. Any program, whether based on Mac OS X or iOS, the program starts with the main function of the main.m file. The main function does only three things: Create an auto-free pool, call the Uiapplicationmain function, and use the auto-free pool.
int main(intchar * argv[]) { @autoreleasepool { // 执行UIApplicationMain函数时做了跳转,转到了AppDelete中 returnclass])); }}
2.UIApplicationMain () Creates an Application object and assigns a delegate to the object, monitors the execution of the program, and simultaneously turns on the event loop, which the handler receives.
The execution of the 3.UIApplicationDelegate method. The program agent, mainly detects the status of the application and makes corresponding processing. There are many applications, such as: program start, Active state, go backstage, memory warning, receive remote message, etc. Any object that accepts the Uiapplicationdelegate protocol can become an application proxy. Once a certain state of the program is triggered, the corresponding proxy method is executed. Uiapplicationdelegate is a objective-c protocol. The polygon declares a number of methods that are related to the state of the application's health and are implemented by the application proxy. The UIApplication object is responsible for the adjustment.
4. Load window. UIWindow as an application window, loads when the application starts. The various UI interfaces are rendered using window. UIWindow should be as large as the screen when it is created. Through [UIScreen mainscreen].bounds can get screen? Small.[self.window makeKeyAndVisible]; //让window变为可视状态,即显?window
5. Specify the root view controller.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
IOS UI Programming Overview and program execution order