[ios/translation] Cocoa Touch Layer

Source: Internet
Author: User
Tags app service uikit

This article is my own hard translation, please reprint the friend annotated, translated in Z.mjun csdn blog http://blog.csdn.net/Zheng_Paul, thanks!

Translated on October 6, 2015

Cocoa Touch Layer

The Cocoa touch layer contains key libraries to build iOS apps. These libraries define the performance of the application. They provide basic space for applications and provide key technologies such as multitasking, contact-based input, message push, and many advanced system services. When you design your application, you need to study them first.

High-level features

The following chapters describe some of the key technologies

    • app Extensions app extension ( App Extension Programming Guide )
    • Handoff Transfer ( guide )
    • D Ocument Picker Document Selector ( guide )
    • AirDrop
    • textkit ( guide )
    • UIKit Dynamics
    • Multitasking ( guide )
    • Auto Layout ( guide )
    • Storyboard storyboards
    • UI Sta Te Preservation
    • Apple message push service Apple push Notification service Local and Remote Notification Programming Guide
    • gesture Recognition Gesture recognizers Event handling guide for IOS
    • Standard System View Controllers ( View Controller Programming Guide for IOS )
    • App Extensions app extension (App Extension programmingGuide)
      IOS8 allows you to use application extensions in the System extension area to implement custom functionality in a user task. For example, you can provide an extension of an app that helps users send content to a public sharing network. After users have installed and can use the extensions, they can choose to share them in the current app by clicking Share button. Your custom share extension gives you the acceptance, validation, and sending of user content. The extended list of systems is in the shared menu and depends on the user selection.
      In Xcode, you create an app extension to add a preconfigured app extension to your app. After a user installs an app that contains extensions, the "setting app" has this extension. When used to run other references, the system can be visualized in the UI of the system, such as sharing menus.
      iOS Support app Extensions
    • Share, share content to a public network, or anywhere else.
    • Perform. Perform a small task
    • Gadgets that provide a quick upgrade or allow a brief task in the message of today's interface
    • Image editing to perform an image or video modification in the photo application
    • A document provider that gives a document to be saved locally so that other apps can access it. Apps use the Picker interface to manage or move files.
    • Custom keyboards, all apps on the device, with customizable keyboards available

Each of the extended points defines the appropriate APIs. When you use the app extension template to develop, you can get the default target, the content method stub, and the Extended attribute list settings you choose.

  • Handoff Transfer (Guide)
    Handoff is a feature of OS X systems and iOS systems that span the continuity of a device's user experience. Handoff allows users to perform an activity on one device, jump to other devices, and live a similar activity on other devices. For example, a user browses a long article on safari, extracts an article to an iOS device that uses the same AppleID, or opens an identical webpage on iOS Safri, and on the same scroll point as the original device. Handoff enables users to feel a seamless user experience.
    Handoff can be used with a small API that is only needed by the application. Each activity in the app will restore the content activity on the other device. When using the Select Reply activity, this object is sent to the device that will be restored. Each user's active object has a callback that resumes the active state at the appropriate time, such as before the user's active object, sent to the device.
    If you continue an activity that requires a lot of data, the user's active object is easy to transfer. Applications in recovery have an option to open a stream to the source app. Document-based apps can automatically support activities under icloud-based documents for users.

  • Document Picker File Selector (Guide)
    The document Picker (Uidocumentpickerviewcontroller) interface consents to users accessing files other than the application sandbox. It is a simple sharing principle between applications. Also allows for a composite workflow, because users can modify a document in different applications.
    Document Picker lets you access files from many document vendors. For example, the icloud document provider agrees to access icloud's document memory in other apps. Third-party developers can provide additional documentation providers from the extended storage provider.

  • AirDrop
    AirDrop provides users with the ability to share pictures, documents, links and other data on nearby devices. Support for sharing files under the Uiactivityviewcontroller class in other applications. These classes display different options to share content to the place you specify. If you are using this class, you need to consider adding your interface.
    To receive files using airdrop, you need to

    • You need to add the appropriate document type keywords to the XOCDE info.plist. The system uses this information to determine how your app can use it
    • When the application receives a file, the callback is implemented in the application application:openURL:sourceApplication:annotation:

    The received file is saved in the Documents/inbox dictionary, and if you plan to modify the file, you must move it out of the dictionary and make any changes. (under Inbox, the system only allows files to be read and deleted). The file is encrypted under this path, so the file cannot be retrieved when the device is locked.

  • Textkit (Guide)
    Textkit is a full-featured, high-level class that handles text and fine typography. With Textkit, you can release different styles in paragraphs, columns and pages. You can make the text appear like a picture in any area. At the same time you can use it to manage different fonts. If you consider using core text to implement reading text, you should use Textkit. Textkit is a full text-based library. It makes it easier for apps to create, modify, display and store text, and use less code in iOS.
    The Textkit contains the new Uikit class, along with the already existing class

    • The Nsattributedstring class, which can support new features.
    • Nslayoutmanager class, generating glyphs and text typesetting
    • Nstextcontainer class, defining a text layout for a region
    • Nstextstorage defines an underlying interface for managing text content
  • UIKit Dynamics
    Apps can now make dynamic behavior on UIView objects, and also follow Uidynamicitem protocols for other objects. (The object follows this protocol, called Dynamic item ). Dynamic behavior provides a way to make the user experience of an application the same as the dynamic behavior and characteristics of the real world. The Uikit dynamic supports the following features:

    • Uiattachmentbehavior class, which defines a connection relationship between two dynamic objects or a dynamic object and a point. When one moves, it strikes another and the other moves as well. This connection is not completely static. An impact behavior also has the bounce and vibration properties to determine how the behavior changes. The
    • Uicollisionbehavior class allows dynamic items to be added to a collision, and each item and the edge of the item collide. This behavior also allows them to respond appropriately after a collision. The
    • Uigravitybehavior class, which adds a gravity vector for dynamic item. The gravitational vector causes the dynamic items to accelerate in the vector direction until they collide to the appropriate bounds. The
    • Uipushbehavior class, which defines a dynamic items
    • Uisnapbehavior class for a connected or instantaneous press, defining an elastic point for a dynamic item. This item bounces to a point that shows the configured effect. For example, dynamic item can bounce to a point, like an attack on a spring.

    When you add it to an animated object, the dynamic behavior becomes active, and the dynamic object is defined as the Uidynamicanimator class. This animation provides the execution of dynamic behavior content. A dynamic item can have multiple behaviors, but many behaviors must be in the same animated object.

  • Multitasking (Guide)
    The battery file is an important user-considered iOS device. The goal of the multitasking model in iOS is to maximize battery life while giving their applications the important work they need to do. When the user presses the home key, the foreground app is ranked to the background. If the app does not have much to do, it will be suspended, and placed in a frozen area, memory will not execute his code. The application needs to provide a specific type of work to tell the system to request background time.

    • Apply and request a limited amount of time to accomplish some important tasks
    • Apps can support specific services to request implementations to give these services, such as playing
    • Apps can use local notifications at a specific time to generate user notifications, even if the app is not running
    • Apps can download specific content from the network
    • App can download content and push a message
  • Auto Layout (Guide)
    Auto-Fit helps you build a dynamic interface with less code. With automatic adaptation, you can define rules for how to fit elements in your user interface. These rules express a lot of class relationships and are more intuitive to use than the previously used springs and struts model. For example, you can define a key that is always 20 pixels from the left boundary of the parent interface.

    • They support localization through a separate string exchange, rather than requiring you to update your layout.
    • They support mirroring of user interface elements for right-to-left languages such as Hebrew and Arabic
    • They provide better segmentation responsibilities between objects in the interface or on the controller layer.
      An interface object usually has a standard size, they are positioned under the parent interface, and have a positional relationship to their own equivalent level of interface. The control of an interface can override those that are not in accordance with standard requirements.
  • Story Board storyboards
    Storyboards, a recommended way to design the user interface. Storyboards lets you design your user interface in one place, so you can see all of your interfaces, view controllers, and understand how they work together. An important part is that storyboards has the ability to define segues connections, and he can help with the transfer between view controllers. These transfers allow you to capture the flow of your set interface, in addition to the content. You can define this transmission on the surface. In Xcode, or the program initializes them.
    You can use a simple storyboard file to store all of your apps ' interfaces, and Viewcontroller, or use multiple storyboards to manage them. When created, Xcode divides the storyboard's file content into discrete parts, which makes it even better to initialize the load. Your app doesn't need to manipulate them directly. The Uikit library provides a convenient class to access the content of the storyboard.

  • UI State Preservation
    State retention provides a seamless user experience so that your app is always running, even though it's not. If the system's memory pressure, he can quickly close one or more background with the application. When the app moves from the foreground to the background, he can protect the interface and view controller state. To the next cycle, he can protect the information state to the restart interface and Viewcontroller, provide the configuration and let him display the same content as before, rather than reopen it.

  • Apple message push service Apple push Notification service Local and Remote Notification Programming Guide
    The Apple message Push service provides a way to tell users about new information about an iOS app, even if the app is not running. Using this service, you can push text messages at any time, and add an app icon, or sound effects on the user device. These messages let users know that they need to open your app to receive relevant information. In IOS7, you can push a static message to let your app know that new content can be downloaded.
    From a design standpoint, this is the two part that makes the push for iOS app service. First, the app must request a delivery notification, and when it is delivered, process the notification immediately. Second, you need to provide the service side, the first time to process the generated notifications. This processing needs to work on your own local server and with the Apple push service to generate notifications.

  • Local notifications (local and Remote Notification programmingGuide)
    Local notifications supplement the existing push notification mechanism, providing a way for the app to generate local notifications instead of using the server. When the app is running in the background, you can use local notifications to tell the user something important has happened. For example, if the navigation app is running in the background, you can use local notifications to warn the user when to turn. The app can also set a local notification at a future time, even if the app is not running, and can deliver notifications.
    One of the benefits of local notifications is that they are application-independent. After setting good one notifications, the system will manage to deliver them, and your app won't need to run.

  • Gesture recognition Gesture recognizers Event handling guide for IOS
    Gesture recognition is used to detect common gestures, such as swipes sliding and pinches pinching in your application. Because they use the same gesture recognition as the system, gesture recognition provides consistent behavior for the application. Using one, add a gesture recognition to the app and give him a way to perform gesture events. Gesture recognition is a difficult final work from the original touch and determines when they are a gesture.
    All gesture recognition is based on the Uigesturerecognizer class, which determines the basic behavior. Uikit supports standard gesture recognition, such as taps taps, pinches pinch, pans, swipes slide, rotations rotation, etc. You can define some gesture recognition in your app. For example, you can tell the tap this behavior is to define multiple taps to execute your method.

  • Standard System View Controllers (View Controller ProgrammingGuide for IOS)
    Many system libraries define the standard system interface for view controllers. Whenever possible, using the view controller provided is better than the one you define. Encourage the use of these view controllers to implement your user interface within your application. Whenever possible you need to perform a subsequent task, you can use the view controller from the corresponding library.

    • Display and modify the relevant information. View controller using the Address Book UI Library
    • Create and modify calendar events, using the view controller of the Eventkit UI Library
    • Write a message or SMS, use the view controller of the Message UI Library
    • Open or preview the contents of the file, using the Uidocumentinteractioncontroller class of the Uikit library
    • Take a picture or hang a photo in the album, use the Uiimagepickercontroller class of the Uikit library
    • Take a video clip, use the Uiimagepickercontroller class of the Uikit library
Cocoa Touch Layer

The next step is to introduce the functions under this library and library.

List
    • 2.0 Address Book Interface addressbookui.framework (AB)
    • 4.0 Calendar Event UI _eventkitui.framework
      _ (EK)
    • 3.0 Games _gamekit.framework
      _ (Guide) (GK)
    • 4.0 Advertising iad.framework (Guide) (AD)
    • 3.0 Maps mapkit.framework (Guide) (MK)
    • 3.0 Information UI messageui.framework (aboutSystem Messaging) (MF)
    • 8.0 Notice notificationcenter.framework (Guide) (NK)
    • 8.0 Push pushkit.framework (PK)
    • 5.0 Twitter twitter.framework(TW)
    • 2.0 Interface uikit.framework(UI)
  • 2.0 Address Book Interface addressbookui.framework
    Provides a display interface to the standard system of contacts, as well as the creation of new address book information and changes to existing information. This library regulates the interface of the contacts and simplifies the display. So that all programs use a unified interface. (AB)

  • 4.0 Calendar Event UI _eventkitui.framework
    _
    Provides a standard system calendar interface for Viewcontroller to display and modify calendar events. In the Eventkit library, the library is built on top of the associated data. (EK)

  • 3.0 Games _gamekit.framework
    _ (Guide)
    Support Game Center, which users can use to share the data associated with games. (GK)

    • Allows users to create network accounts, users log in to Game Center and communicate with anonymous users. Users can set a label for their friends.
    • Leaderboards, support for uploading game scores on games Center, and retrieving scores. You can use this feature to let users tell their friends about their best results.
    • Achievements, allowing the app to record what the user has achieved in the game.
    • Challenge, the user can challenge a friend in the app to get a score or achievement.
    • Turn-based games to create a lasting match. The status of the game is stored in icloud
  • 4.0 Advertising iad.framework (Guide)
    Allows you to run banner-based ads in your app. Ads integrate the standard interface, and push the interface you want. This interface is an apple IAD service that automatically gets related to loading and pushing different media, and handling ad click events. (AD)

  • 3.0 Maps mapkit.framework (Guide)
    You can place a map with a volume page function in your app's interface. You can use this library to automatically map content and display before you display the map. You can mark a point of interest and mark a comment, or you can use a custom overlay area on the map to decorate a slice. For example, you might be using an area to draw a bus station, using annotations to highlight the stores and restaurants that are attached.
    In addition, when the map is displayed, the library combines the map app with the Apple Map Service to provide better navigation. From the Map app, users can callback the map navigation from the app. Applications can provide professional navigation types, such as Metro information. Users can request these navigation. The app can also request a walk from the Apple server, navigate from the car, and then integrate the navigation information to provide point-and-click Navigation routes to the user. (MK)

  • 3.0 Information UI messageui.framework (aboutSystem Messaging)
    Email and SMS SMS display for your app. This information is pushed to the interface via a viewcontroller. You can fill in the fields in the recipient, subject, main content, and attachments. After the display interface, users can change the information in the message before sending. (MF)

  • 8.0 Notice notificationcenter.framework (Guide)
    Create a widget to display notifications in the dashboard. (NK)

  • 8.0 Push pushkit.framework
    Provides registration support for VoIP applications. This library replaces the IPAs that was previously registered with the VoIP app. Instead of maintaining a continuous connection, it consumes power and can be notified by the app when a phone signal comes in. (PK)

  • 5.0 Twitter twitter.framework
    has been replaced by the social library. Support tweets UI, and provide create URLs to access Twitter services. (TW)

  • 2.0 Interface uikit.framework
    Under iOS, create a key infrastructure for implementing graphics, event-driven applications (UI)

      • Basic application management and underlying controls, including the main thread of the app
      • User interface management, including support storyboards (storyboards) and explicit management (NIB) files
      • A viewcontroller model to compress the contents of your user interface
      • Objects are displayed under the standard system interface and control
      • Support for managing touch-and motion-Events
      • Support document mode includes ICloud integration (document-based APP Programming Guide for IOS)
      • Graphics and interface support with support for additional display (View Programming for IOS)
      • Multi-tasking support (multitasking)
      • Support Painting (Drawing and Printing Guide for IOS)
      • Uikitking controls that support custom standards
      • Support for text and Web content
      • Cut, copy and paste
      • Support User Interface Content animation effect
      • Integrate other applications under the system via URL schemes and library interfaces
      • Support for disabling accessibility of users
      • Apple Push Notification Service support
      • Scheduling and delivery of local messages (locally notifications)
      • PDF creation
      • Support for using a similar system-customized interface keyboard
      • Support for creating text view and system keyboard interaction
      • Support for sharing content via email, twitter,facebook or other servers
        In addition to the basic code that supports building applications, Uikit supports the special features of some devices at the same time.
      • Built-in camera
      • User's picture library
      • Device Name and model information
      • Power status information
      • Distance sensor information
      • Long-range control information via headset links

[ios/translation] Cocoa Touch Layer

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.