您的位置:首页 > 移动开发 > IOS开发

iOS8新特性

2015-02-07 16:30 190 查看
1.应用扩展(Extension)

使APP之间数据交互成为可能,无需离开当前应用。基于安全和性能的考虑,每一个扩展运行在一个单独的进程中,它拥有自己的bundle,bundle后缀名为appex,扩展bundle必须包含在一个普通应用的bundle的内部。

iOS8系统支持6个扩展的系统区域,分别是Today、Share、Action、Photo Editing、Storage Provider、Custom keyboard.支持扩展的系统区域也被称为扩展点。

Finder 扩展点只支持OS X,Today、Share、Action。

Today:widget

Share:可以自定义分享选项

Action:扩展性最强

Photo Editing:直接使用第三方美图程序。

Storage Provider:扩展检索存储文件

Custom Keyboard:自定义输入法

info.plist文件中包含了扩展的配置信息,其中最重要的键是NSExtension

****注意64-bit架构:

一个应用程序扩展在Architectures设置中必须要包含arm64的架构。

可以在Xcode的“Standard architectures”设置选项中选择arm64架构。

2.App开发时统一

3.iCloud相关

CloudKit/CloudKit.h

FMDB是数据库框架。可在数据平台上处理数据。

存储源的可变性

4.Handoff及其他iOS与Mac的协作开发

HomeKit:智能家居

HealthKit:健康

5.游戏方面

SceneKit:游戏方面

Metal渲染开发。

6.其他重要改动

弹窗需要用户许可

CoreLocation/CLLocation.h

Photos.framework:监听其他应用对照片的改动。

iOS8之后适配的机型要更多了。出了个sizeclass的类。

iOS8的UIAlert和actionsheet整合成了UIAlertController.

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//    UIAlertView;
//    UIActionSheet;
//    UIAlertController *ac = [[UIAlertController alloc] init];
//    ac.title = @"titlename";
//    ac.message = @"message";
    
    UIAlertController *ac = [UIAlertController alertControllerWithTitle:@"title1" message:@"title2" preferredStyle:UIAlertControllerStyleActionSheet];//alert style
    
    UIAlertAction *action = [UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
        NSLog(@"cancel");
    }];
    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"Default" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
        NSLog(@"Default");
    }];
    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"Destructive" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
        NSLog(@"Destructive");
    }];
    
    [ac addAction:action];
    [ac addAction:action1];
    [ac addAction:action2];
    
    //显示方法遵循控制器的显示方法
    [self presentViewController:ac animated:YES completion:nil];
}


UIViewController新增一个扩展上下文的extensionContext属性是来处理containing app与拓展之间的通信,上下文类型是:NSExtensionContext
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: