IOS8 one of the new feature Extensions (Extension) Applications--today ExtensionsI. Understanding EXPANSION1. Introduction
Based on the security of the iOS system, its application data storage is through the sandbox mode, it is difficult to realize the data sharing between the applications, and the function sharing is more tricky. In the IOS8 system, Apple provides us with a revolutionary feature: scaling. We can extend the sharing of data and even functionality between apps.
2. Several expansion modes (1) Today's view extension: now
This extension is also called a widget. The extension can place a short message that occurs today in the "Today" view of the message center. This feature is similar to small controls on Android, but Android can be placed directly on the desktop for more freedom. Examples are as follows:
(2) Sharing function extension
This extension allows apps to upload photos, links, or other files to the online service. In previous releases, we had to do a complex operation to implement the sharing feature.
(3) Personalized operation
With this feature, you can share something in two apps, such as editing a picture in text and translating text from a Web page.
(4) Photo operation
This type of extension allows us to edit photos taken in the Ipone camera using other image editing software.
(5) file sharing
This extension allows the software to save files to various cloud storage providers.
(6) Custom keyboard
allows the user to use a third-party keyboard input method.
Ii. creation of the Today extension
Extension is an independent composition, and its related two concepts are host app and host app, host app is the place to extend storage, with extension can realize resource sharing, host app is extended run program, for example today extension has drawer in today app to run. To create a today extension, we first need to create a hosting app:
Create a new project:
Select File->new->target in the Xcode toolbar
In application extension There are 6 extensions mentioned above, we choose today.
This is one of the more extended folders in our project:
There is a viewcontroller in this folder, we can layout inside, and there is a plist file, but some properties of the extension are configured.
We create a button:
UIButton * btn = [[UIButton alloc]initwithframe:cgrectmake (0, 0, 100, 30)]; [Btn settitle:@ "231" forstate:uicontrolstatenormal]; [Self.view ADDSUBVIEW:BTN];
Then we run this extension:
Xcode will let us choose to run the extended host program because this is a today-type extension and we choose today:
After running, this extension will appear in the notification drawer of the system:
Similarly, we can create tableview,imageview and other complex view effects, we can also write a lot of logic functions, jump app and so on.
IOS8 one of the new feature Extensions (Extension) Applications--today Extensions