IOS UIKit framework open source

IOS UIKit framework open source
“UIKit Framework Annotation Practical Case”

We are often referred to as the “Cocoa framework”, in fact, Cocoa itself is a collection of frames, which contains the multi frame, which is the most important to “Foundation” and “UIKit””. The former is the basis of the framework, and the interface has nothing to do, which contains a large number of commonly used API; the latter is the foundation of the UI class library, after which we will often use iOS development. The location of the two frameworks in the system architecture is shown below:

IOS UIKit framework open source
Cocoa framework

Image annotation:

  • 1, Core OS layer
    is located in the bottom of the iOS framework, including the kernel, file system, network infrastructure, security management, power management, device drivers, thread management, memory management, etc.. In short, the layer provides the lowest level, system level services.
  • 2, Core Services
    can be called the core service layer, as the name implies, it provides as string management, collection management, network operations, the URL utility, contact management, preferences and other services. In addition, it also provides a lot of hardware based services, such as GPS, accelerometer, gyroscope, etc.. The layer contains Core Location, Core Motion, SystemConfiguration, Foundation and Core Foundation submodule. Among them, Foundation and Core Foundation sub module provides the abstraction of common data types (strings, collections, etc.), and the Core Data sub module in Core Foundation can realize object graph management and object persistence.
  • 3, Media layer: rely on Core
    Services layer provides functionality, mainly responsible for graphics and multimedia services. It includes CoreGraphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio and graphics, video and audio related functional modules.
  • 4, Cocoa Touch layer
    is to provide a variety of basic functions to support iOS applications. The UIKit framework provides a variety of visual controls to supply the use of procedures, such as windows, views, view controllers and a variety of user controls. In addition, UIKit defines the default behavior and event handling structure of the application.

The UIKit framework is the Objective-C language used in Apple’s mobile devices interface presentation and management function of library functions, the topic will be dedicated to Apple’s official website massive documents classified, the classification framework document annotations, and the common functions of each kind of gradual case analysis, in order to simplify the complicated process for beginners introduction and review of the veteran, as soon as possible subject, application quickly.

In the “time & knowledge” is limited, the summary of the article will inevitably have “incomplete, inadequate” place, but also hope that the friends pointed out that in order to improve the quality of the article.

My GitHub project has been created well, just waiting for your arrival

Here we might as well look at the UIKit class structure:

IOS UIKit framework open source
UIKit framework

  • 1 UIAcceleration:
    is an instance of a class of UIAcceleration called acceleration events that is used to represent real-time 3D acceleration data. To receive the acceleration of gravity, register an application application as a delegate object for a shared UIAccelerater object (refer to the UIAcceleromete class).
  • 2 UIAccelerater:
    UIAccelerater class allows you to receive the register received from the on-board hardware acceleration related data. When the device moves, its hardware is able to report changes in linear acceleration along the main line in three dimensions. You can use this data to detect the current direction of the device and the instantaneous change in the direction of the device. You can use this instantaneous change to enter a game or start some action in the application.
  • 3 UIaccessibilityElement:
    UIAccessibilityElement package of project information for some special people visible, by default, is not accessible. For example, an icon or text image is not automatically accessed because it does not inherit the UIView (or UIControl). A project that contains a non – uniform view to create an instance of the UIAccessibilityElement that each item needs to access.
  • 4 UIBarItem:
    UIBarItem is an abstract superclass used to add a column to the bottom of the screen. The way a column is similar to a button. They have titles, pictures, actions and goals. You can enable and disable a column entry in the project. 4.1 UIBarButtonItem:
    a bar button item is placed in a UIToolbar or UINavigation object with a dedicated button. It starts with the behavior of the parent class of UIBarItem, which inherits the basic buttons. UIBarButtonItem defines additional initialization methods and properties, using toolbars and navigation bars. 4.2 UITabBarItem:
    UITabBarItem class to achieve a label with the bar project, UITabBar example. A tab bar operates strictly in radio mode, and one of the items is selected at the time, click the tab bar item to switch to the tab bar above. You can also specify information on items in the tab bar, for example by adding an additional visual badge value, using the badge on the phone application to display the number of new messages. This class also provides a number of projects that are created by default.
  • 5 UIBezierPath:
    UIBezierPath class, you can define a path composed of straight lines and curves of the line segment, and present in your custom view path. You can use this class initially only for the geometry specified in your path. Paths can be defined by simple shapes such as rectangles, ellipses, and arcs, or they can define complex polygons using a mixture of straight lines and curve segments. After defining a shape, you can use the other methods of this class to present the path of the current graphics context.
  • 6 UIColor:
    a UIColor object represents the color, sometimes opaque (alpha). You can use the UIColor object to store the color data, and in the painting process, you can use them to set the current fill and stroke color.
  • 7 UIDecive:
    UIDevice class provides a single instance representing the current device. From this example, you can get information about the device’s unique ID, distribution name, device type, and operating system name and version. You can also use the UIDevice instance to detect device characteristics, such as changes in physical direction. Use the direction property to get the current direction, or to register a UIDeviceOrientationDidChangeNotification notification to receive a change notification. Before using these techniques to obtain location data, you must make the data transfer using the beginGeneratingDeviceOrientationNotifications method. When you no longer need to track the direction of the device, call the endGeneratingDeviceOrientationNotifications method to disable the delivery notification
  • 8 UIDocumentInteractionController:
    a file interaction controller together with a delegate object that provides support for user interaction with file management in the application system. For example, an email program may use this class to allow users to preview attachments and other applications to open them. Use this class to preview the corresponding user interface, open, copy or print the specified file.
  • 9 UIEvent:
    a UIEvent object (or simply, an event object) representing events in iOS. There are three types of events: touch events, motion events, and remote control events,. The remote control event enables a Responder object to receive commands from external attachments or headphones, so that it can manage audio and video management, for example, play video or skip to the next track.
  • 10 UIFont:
    UIFont class provides access to and set the font information interface. The class provides access to font features and provides access to font information systems that are used in the layout process. By accepting them as arguments, you can use the font object.
  • 11 UIGestureRecognizer:
    UIGestureRecognizer is an abstract base class for a specific gesture recognition class. A gesture recognition object (or, simply, a gesture recognition) is isolated from the logic of recognizing such gestures and actions on recognition. When one of these objects acknowledges a common gesture, or, in some cases, changes the pose, it sends an action message to each of the specified objective lenses. The following specific
    subclasses: 11.1 UITapGestureRecognizer. Specifies the number of fingers that must be acknowledged by the gesture, digging the specified number of times. 11.2 UIPinchGestureRecognizer:
    looks pinch gesture, involving two contacts. When the user will be two fingers, to the other side of the traditional meaning is reduced; when the user will be two fingers away from each other, the traditional meaning of zoom. 11.3 UIRotationGestureRecognizer:
    looks like rotation involves a touch of two gestures. When the user moves the finger across the other side of the circular motion, the basic point of view should be in the corresponding direction and speed of rotation. 11.4 UISwipeGestureRecognizer:
    looks swipe in one or more directions. The attack is an independent gesture, so that the associated operation of the message is sent only once for each gesture. 11.5 UIPanGestureRecognizer:
    look translation (drag) gestures. The user must press to view one or more of the fingers while they are panning. The implementation of this gesture recognition action method by the client can ask for its current translation and gesture speed. 11.6 UILongPressGestureRecognizer:
    looks long by gesture. The user must press one or more fingers to move the message to the specified time limit. In addition, the fingers may have to admit that the gesture moves only the specified distance; if they go beyond this limit the gesture fails.
  • 12 UIImage:
    a UIImage object is a high-level way to display image data. You can create an image from a file from an object in a quartz image or from the original image data you received. The UIImage class also provides several options for drawing images into the context of the current graphics using different blending modes and opacity values.
  • 13 UILocalizedIndexedCollation:
    UILocalizedIndexedCollation class is easy to organize, organize, and data localization for some index charts. Table view of the data source, and then use the sort object to provide the input section of the title and the title of the section index table view.
  • 14 UILocalNotification:
    UILocalNotification instance indicates that the application can be submitted to its users in a specific date and time to arrange the notification. The operating system is responsible for providing notification at the right time; there is no application to run. Although local notifications are similar because they are used to display alerts, play sounds and badges for application icons, remote notifications, which are composed and local delivery, do not need to be connected with remote servers.
  • 15 UIMenuController:
    his singleton UIMenuController example describes the menu interface of the cut, copy, paste, select, select, and delete commands.
  • 16 UINavigationItem:
    UINavigationItem class encapsulates a UINavigationBar object on the stack push navigation project information. A navigation bar is used to control the content of the navigation hierarchy. A UINavigationItem specifies what is displayed on the navigation bar, and when it is top of the project, it also represents how it is when the back of the item.
  • 17 UINib:
    UINib class as an object wrapper or container, InterfaceBuilder NIB file. A UINib object in memory cache of a nib file content, files and examples. When your application needs to instantiate the contents of the nib file, it can do so without having to load data from the nib file, thus improving performance. The UINib object can automatically release the cache header data free of charge for your application under low memory conditions, reloading data next time your application instance nib. Your application should use the UINib object when it needs to repeat the same instance of the nib data. For example, if your table view uses NIB file instance table view cells, the tip of the UINib object in the cache can provide significant performance improvements.
  • 18 UIPasteboard:
    UIPasteboard allows applications to share applications or with other applications using the whole system or application specific clipboard data.
  • 19 UIPopoverController:
    UIPopoverController class is used to manage the presentation of content in popover. You use popovers to temporarily present the current information temporarily and use a method that does not exceed the entire screen as a modal view. The Popover content is layered on the existing content of a particular type of window. Popover is still visible until the user taps outside the Popover window or you explicitly reject. Popover controller for iPad and other equipment to provide the use of only. Try to create a new one when other device results are abnormal.
  • Abstract class 20 UIPrintFormatter:
    print format: UIPrintFormatter display can print the contents of the traditional boundary can be spread. As a result of the print format, the printing system can automatically print the type associated with the print formatted content. The following is a subclass of UIPrintFormatter: 20.1 UISimpleTextPrintFormatter:
    UISimpleTextPrintFormatter class layout for the layout of the print text, may be more than one page. Class allows you to specify the global font, color, alignment, and line break pattern properties of the printed text. 20.2 UIMarkupTextPrintFormatter:
    UIMarkupTextPrintFormatter example shows a multi page print job HTML labeled text. 20.3 UIViewPrintFormatter:
    UIViewPrintFormatter an example of the class, sketched out the contents of the view for the print rendering. Views can span multiple pages.
  • 21 UIPrintInfo:
    a UIPrintInfo object encapsulates the print operation information including printer identification, job name, the type of output (photos, normal, gray scale), direction (vertical or horizontal), and any selected duplex mode,. Use this information when printing the print system.
  • 22 UIPrintInteractionController:
    UIPrintInteractionController class shared instance, proposed the printing of the user interface and the management of documents, images and other printable content in iOS printing. UIPrintInteractionController is the iOS central printing class. Its shared instance represents a print job. Print jobs, including their printed information and options, such as output type, job name, paper size and orientation, to print the content.
  • 23 UIPrintPageRenderer:
    a UIPrintPageRenderer object draws to an instance of the printed page content with or without print format.A page rendering is the UIPrintPageRenderer custom subclass. When you write a UIPrintInteractionController shared instance used by a print job, you specify the page to render to the instance’s printPageRenderer property.
  • 24 UIPrintPaper:
    UIPrintPaper class of an example of the use of packaging paper size, print jobs, and in which the content can be printed rectangular.
  • The 25 UIResponder:
    UIResponder class defines an interface to respond to and handle events of the object. It is the superclass of UIApplication, UIView and its subclasses (including UIWindow). Instances of these classes are sometimes referred to as responder objects or simply answer. 25.1 UIApplication:
    UiApplication class provides a centralized control and coordination of applications running on the iOS. Each application must have exactly one instance of UIApplication (or subclass UIApplication). When an application starts, the UIApplicationMain function is called, and in other tasks, this function creates a single UIApplication object. After that, you can call the sharedApplication class method. 25.2 UIViewController:
    UIViewController class provides the basic view of the iPhone application management model. The basic view controller class supports the presentation of associated views, provides support for the management mode view, and supports changes in response to changes in the direction of the device. Subclasses such as UINavigationController and UITabBarController, such as providing management of complex hierarchical view controllers and other behaviors of views. The 25.2.1 UITabBarController: UITabBarController
    class implements a dedicated view controller to manage a broadcast selection interface. Not applicable to subclasses of this class. Instead, you can use an instance of it to present an interface that allows the user to choose between different operating modes. The tab bar interface displays different patterns between tabs at the bottom of the window to display the views of the model. 25.2.2 UITableViewController:
    UITableViewController class to create a controller object, manage table view. The class of the 25.2.3 UINavigationController:
    UINavigationController implements a specialized view controller to manage the hierarchical content navigation. Not applicable to subclasses of this class. Instead, you can use instances when you want your application’s user interface to reflect the level of your content. This navigation interface makes it easier for you to display data and make it easier for users to browse content. 25.2.3-1 UIImagePickerController:
    UIImagePickerController class management custom and system user interface, support the equipment on the pictures and movies, and choose to use pictures and movies stored in your application. The image picker controller manages the user interaction and the delegate object provides the results of these interactions. 25.2.3-1 UIVideoEditorController:
    a UIVideoEditorController object, or video editor, began recording from the previous film by pruning and the end of the video frame, and re encoding to reduce the quality management system provides the user interface. Object management for user interaction, and provides a template file system path for your delegate object editing. UIVideoEditorController class features are only available on devices that support video recording. 25.3 UIView:
    UIView class defines the content of this area by defining a rectangular area on the screen and interface. At run time, the view object handles any content rendering in its area, and handles any interaction with the content. The UIView class itself provides the basic behavior of the background color to fill the rectangular area. More complex content can be displayed by inheriting the UIView and implementing the necessary drawing and event handling code. The UIKit framework also includes a class that can be used from a simple button to a complex set of tables. For example, a UILabel object draws a text string and a UIImageView object draws an image. 25.3-1 UIWindow: UIWindow
    class defines, manages and coordinates the Windows application to display objects on the screen (such as Windows). One of the two main functions of a window is to show its views on the area and the distribution of views. The window is the root of the view hierarchy. A window belongs to a level; a level window appears on another level. For example, an alert appears above the normal window. Typically, there is only one window in the iOS application. 25.3-2 UILabel:
    UILabel class to achieve a read-only text view. You can use this class of static text, such as you might use it to identify other parts of your user interface, drawing one or more lines. The basic UILabel class provides control over the appearance of the text, including whether it uses a layer of shadow, or draws a major highlight. If necessary, you can customize the appearance of the text further through inheritance. 25.3-3 UIPickerView:
    UIPickerView to achieve the object, the view that the use of a selector, a spinning wheel or slot machine metaphor to display one or more sets of values. The user can select the rotation of the wheel, so that the value of the desired row and the corresponding value of the selected value. The UIDatePicker class uses a custom subclass of UIPickerView display date and time. To see an example, tap the button in the clock application to add a “+” button. 25.3-4 UIProgressView:
    the progress bar will be displayed at the bottom of the application when a mail application downloads messages. The UIProgressView class provides a progress bar for the management style, which is used to get and set the progress properties of a fixed value. The 25.3-5 UIActivityIndicatorView:
    UIActivityIndicatorView class creates and manages an indicator to display the uncertain task schedule. From the outside, this refers to a “gear” that is animated to rotate. The view object of the 25.3-6 UIImageView:
    image provides a view based container for displaying a single image or a series of animated images. For animated images, the UIImageView class provides control over the duration and frequency of the animation settings. You can also start and stop animation free. The 25.3-7 UITabBar: UITabBar
    class implements a selection of two or more buttons to control, and is called a project. One of the most common uses of a tab bar is to implement a modal interface to attack a project by changing the selection. If you want to temporarily highlight or not change the appearance of an item, press the button to use a UIToolbar object. The UITabBar class provides users with the ability to customize the tab bar, delete and add items to the bar. You can use the tab bar delegate to increase this behavior. 25.3-8 UIToolBar:
    a toolbar is a control that displays one or more buttons called the toolbar item. When the toolbar is light on time to highlight or not change the appearance of a project. 25.3-9 UINavigationBar:
    UINavigationBar class implements a hierarchical content navigation control. It is a bar bar, usually displayed on top of the screen, containing buttons for up and down levels of navigation. The main attribute is the left (backward) button, the center name and an optional right button. You can specify these custom views. 25.3-10 UITableViewCell:
    UITableViewCell class defines the properties and behavior of cells that appear in UITableView objects. 25.3-11 UIActionSheet:
    using the UIActionSheet class can be a set of how to continue to give a substitute for the task to the user. You can also use the action table to prompt the user to confirm if there is potentially dangerous action. The action table contains an optional header and one or more buttons, each of which corresponds to the action taken. 25.3-12 UIAlterView:
    uses the UIAlertView class to display a warning message to the user. The function of the alert view is similar, but is different from an action table (an instance of UIActionSheet). 25.3-13 UIScrollView:
    UIScrollView class provides support for displaying content that is larger than the application window size. It can be used indoors to scroll through the contents of the swipe gesture, and pinch gestures to enlarge and partially. 25.3-13.1 UITextView:
    UITextView class to achieve a scrolling, multi line text area behavior. Class supports the use of custom fonts, colors, and aligned text displays, while also supporting text editing. You can usually use a text view to display multiple lines of text, such as displaying a large text file,. An instance of the 25.3-13.2
    UITableView UITableView: (or, simply, a table view) is a means for displaying and editing hierarchical information. 25.3-13.3 UICollectionView:
    UICollectionView (comprehensive view) is a new data display, simply can put him into the rows of the UITableView, can do a view Jiugongge layout. 25.3-14 UISearchBar:
    UISearchBar class to achieve a text-based search of the text field control. The control provides a search button, enter the text of the text field Bookmarks button, a cancel button. The UISearchBar object does not actually perform any search. You can use the delegate that conforms to the UISearchBarDelegate protocol object to implement the action when the input text and buttons are clicked. 25.3-15 UIWebView:
    you use the UIWebView class to embed web content in your application. To do this, you simply create a UIWebView object and attach it to a window that sends a request to load the page content. You can also use this class to move forward and backward in the history of a web page, and you can even set some web content properties for programming. The 25.3-16
    UIControl is the base class for the control object, such as the user’s intention to convey the buttons and sliders to the application. You cannot use the UIControl class to instantiate control directly. Instead, it defines a common interface and the behavioral structure of all its subclasses. 25.3-16.1 UIButton:
    class of an instance of the realization of the touch screen button on the UIButton. Touch a button to intercept event and action messages sent to the target object. Set goals and actions are inherited from UIControl. This class provides a way to set the title, image, buttons and other appearance attributes. With these access, you can specify a different look for each button state. The 25.3-16.2 UIDatePicker: UIDatePicker
    class implements an object that uses multiple rotating wheels to allow users to select dates and times. The iPhone example is a date selector, timer and alarm clock set for the alarm clock application pane. You can also use the date selector as a countdown timer. 25.3-16.3 UIPageControl:
    you can use the UIPageControl class to create and manage page controls. A page control is a point inheritance in the control center. Each point corresponds to an application’s document (or other entity’s data model) page, a white dot that represents the current page. 25.3-16.4 UISegmentedControl:
    a UISegmentedControl object is a lateral control of multiple segments, each segment functioning as a separate button. Segment control provides a compact means of combining control together. 25.3-16.5 UITextField:
    UITextField object is a display
  • 26 UIScreen:
    a UIScreen object containing the entire screen of the device’s bounding rectangle. When setting up the user interface of the application, you should use the attributes of this object to be the window of the proposed framework for your application window.
  • 27 UIScreenMode:
    a UIScreenMode object representation that can be applied to the attributes of a UIScreen object may. The object encapsulates the size of the underlying display buffer on the screen and the aspect ratio information using a single pixel.
  • 28 UISearchDisplayController:
    search shows that the controller manages a search bar that displays the results of a table view showing another view that the controller manages the data search.
  • 29 UITextChecker:
    you use an instance of the UITextChecker class to check spelling words (usually text in the document).
  • 30 UITextPosition:
    a UITextPosition object represents a location in a text container, in other words, it is an index to a supported string in the text display.
  • 31 UITextRange:
    a UITextRange object represents a character in the text container range, in other words, it is determined that a start index and end index of a string, support a text object.
  • 32 UITouch:
    a UITouch object indicates the presence of a specific event on the screen with a finger or movement. You can pass the UIEvent object to the event handler object UITouch object.

The above reference http://www.jianshu.com/p/ae3ab9fdc23c


In short, when learning a new framework class library, you need to trace the source, the outline of the outline of the collar, that is to grasp the overall situation, but also in-depth details. Starting from the system root class, combined with the principle of incident response handling mechanism, further to each interface components or custom, will not mess up the answers.

expect


  • If you encounter error in the process of reading, I hope you can Issues me, thank you.
  • If you want to share something with this article, I hope you can Issues me, I would like to add more practical content for this article, thank you.
  • “The original blog”, I will continue to update, [not timing, learning experience and practical articles, is the hard truth ^_^.]
  • UIKit framework, classification, classification and annotation of the documents, the common functions of each kind of gradual case analysis, starting from zero, to simplify the process of propagation from the shallower to the deeper; cable entry for beginners and old driver review, as soon as the theme, the use of fast. Here just waiting for you to come! Star & Fork

Follow up & About me


I am also a summary of the time spent

About me:@ “brief introduction”

I just thought of a [Code] [ape with your study summary] up to write the article.