标签:
What‘s New in iOS9
This article summarizes the key developer-related features introduced in iOS 9, which runs on currently shipping iOS devices. The article also lists the documents that describe new features in more detail.
For late-breaking news and information about known issues, see iOS 9 Release Notes. For the complete list of new APIs added in iOS 9, see iOS 9.0 API Diffs. For more information on new devices, see iOS Device Compatibility Reference.
Multitasking Enhancements for iPad
iOS 9 enhances the user’s multitasking experience on iPad with Slide Over, Split View, and Picture in Picture. The Slide Over feature lets users pick a secondary app and quickly interact with it. The Split View feature gives users the ability to use two apps side by side on iPad Air 2. The Picture in Picture feature (also known as PiP) lets users watch video in a window that floats above other onscreen apps.
Users decide when they want to view two apps on the screen at the same time; you have no control over when this happens. Even though Split View and Slide Over are user-controlled, there are a few things you need to do to ensure that users have a great multitasking experience.
To learn more about preparing your app to respond well when users use Split View and Slide Over, see Adopting Multitasking Enhancements on iPad.
As with Split View and Slide Over, users control whether they want to use PiP to view a video on top of another running app. If video playback is not your app‘s primary functionality, there’s nothing you need to do to support the PiP experience.
To participate when users choose Picture in Picture, use AVKit or AV Foundation APIs. The video playback classes defined in the Media Player framework are deprecated in iOS 9 and do not support PiP. To learn how to prepare your video playback app for PiP, see Picture in Picture Quick Start.
多任务特性,iOS 9 中的多任务分为三种表现形式,分别是临时调出的滑动覆盖 (Slide Over),视频播放的画中画模式 (Picture in Picture) 以及真正的同时使用两个 app 的分割视图 (Split View)。现在能运行 iOS 9 的设备中只有最新的 iPad Air 2 支持分割视图方式,但是相信随着设备的更新,分割视图的使用方式很可能成为人们日常使用 iPad 的一种主流方式,因此提早进行准备是开发者们的必修功课。
虽然第一眼看上去感觉要支持多任务的视图会是一件非常复杂的事情,但是实际上如果你在前一年就紧跟 Apple 步伐的话,就很简单了。滑动覆盖和分割视图的 app 会使用 iOS 8 引入的 Size Class 中的 Compact Width 和 Regular Height 的设定,配合上 AutoLayout 来进行布局。也就是说,如果你的 app 之前就是 iPhone 和 iPad 通用的,并且已经使用了 Size Class 进行布局的话,基本上你不需要再额外做什么事儿就已经能支持 iOS 9 的多任务视图了。但是如果不幸你还没有使用这些技术的话,可能你会需要尽快迁移到这套布局方式中,才能完美支持了。
视频 app 的画中画模式相对简单一些,如果你使用 AVPlayerViewController 或者 AVPlayerLayer 来播放视频的话,那什么都不用做就已经支持了。但如果你之前选择的方案是 MPMoviePlayerController 或者 MPMoviePlayerViewController 的话,你可能也需要尽早迁移到 AVKit 的框架下来,因为 Media Player 将在 iOS 9 被标记为 deprecated 并不再继续维护。
Search
Search in iOS 9 gives users great new ways to access information inside of your app, even when it isn’t installed. When you make your content searchable, users can access activities and content deep within your app through Spotlight and Safari search results, Handoff, and Siri suggestions. Using APIs related to search, you decide what content gets indexed, what information to show in search results, and where the user is redirected after tapping a result from your app or website.
Integrating with search in iOS 9 is easy: You don’t need any prior experience with implementing search, and most developers find that it takes only a few hours to make their content universally searchable. To learn how to make your app and website content searchable, seeApp Search Programming Guide.
Privacy is an essential feature of search in iOS 9. To give users the best search experience while protecting their private data, iOS 9 makes the following indexes available:
iOS 9 provides the following APIs to help you make your content searchable:
主要是spotlight开放了部分api,可以搜索app中的内容。
Gaming
iOS 9 includes several technology improvements that make it easier than ever to implement your game’s graphics and audio features. Take advantage of high-level frameworks for ease-of-development, or use new low-level enhancements to harness the power of the GPU.
GameplayKit
The GameplayKit framework (GameplayKit.framework) provides foundational technologies for building games. Use GameplayKit to develop gameplay mechanics, and combine it with any high-level graphics engine—such as SceneKit or SpriteKit—to build a complete game. This framework provides building blocks for creating games with modular architecture, including:
GameplayKit also includes standard implementations of common gameplay algorithms, so you can spend less time reading white papers and more time working on the mechanics that make your game unique. Several of the standard algorithm implementations in GameplayKit are listed below.
To learn more about GameplayKit, see GameplayKit Programming Guide and GameplayKit Framework Reference. To see GameplayKit in action, download the sample code projects FourInARow: Using the GameplayKit Minmax Strategist for Opponent AI, AgentsCatalog: Using the Agents System in GameplayKit, and DemoBots: Building a Cross Platform Game with SpriteKit and GameplayKit.
游戏类,忽略
Model I/O
The Model I/O framework (ModelIO.framework) provides a system-level understanding of 3D model assets and related resources. You can use this framework for several types of tasks, such as:
To learn more about Model I/O, see Model I/O Framework Reference.
游戏类,忽略
MetalKit
The MetalKit framework (MetalKit.framework) provides a set of utility functions and classes that reduce the effort required to create a Metal app. MetalKit provides development support for three key areas:
To learn more about MetalKit APIs, see MetalKit Framework Reference. For more information about Metal in general, see Metal Programming Guide, Metal Framework Reference, and Metal Shading Language Guide.
游戏类,忽略
Metal Performance Shaders
The Metal Performance Shaders framework (MetalPerformanceShaders.framework) provides highly-optimized compute and graphics shaders that are designed to integrate easily and efficiently into your Metal app. These data-parallel shaders are specially tuned to take advantage of the unique hardware characteristics of each Metal-supported iOS GPU.
Use the Metal Performance Shader classes to achieve optimal performance for all supported hardware, without having to target or update your shader code to specific iOS GPU families. MetalPerformanceShader objects fit seamlessly into your Metal apps and can be used with Metal resource objects such as buffers and textures.
Common shaders provided by the Metal Performance Shader framework include:
New Features in Metal
The Metal framework (Metal.framework) adds new features to make your graphics-rendering apps look even better and be more performant. These features include:
游戏类,忽略
New Features in SceneKit
The SceneKit framework (SceneKit.framework) includes new features in iOS 9, including:
For details on these and many other new features, see SceneKit Framework Reference.
New Features in SpriteKit
The SpriteKit framework (SpriteKit.framework) includes new features in iOS 9, such as:
For details on these and many other new features, see SpriteKit Framework Reference.
游戏类,忽略
App Thinning
App thinning helps you develop apps for diverse platforms and deliver an optimized installation automatically. App thinning includes the following elements:
To learn more about app thinning, see App Thinning (iOS, watchOS).
1、仅选择需要的内容 (Slicing) 下载。对于开发者来说,并没有太多要做的事情,只需要使用 asset catalog 来管理素材标记 2x 3x 就可以了。
2、按需加载资源,提供附加内容给Appstore服务器,在需要时,异步下载和安装需要的资源。
3、给 App 瘦身的另一个手段是提交 Bitcode 给 Apple,而不是最终的二进制。Bitcode 是 LLVM 的中间码,在编译器更新时,Apple 可以用你之前提交的 Bitcode 进行优化,这样你就不必在编译器更新后再次提交你的 app,也能享受到编译器改进所带来的好处。Bitcode 支持在新项目中是默认开启的,没有特别理由的话,你也不需要将它特意关掉。
按需加载的资源,这可能在游戏中应用场景会多一些。你可以用 tag 来组织像图像或者声音这样的资源,比如把它们标记为 level1,level2 这样。然后一开始只需要下载 level1 的内容,在玩的过程中再去下载 level2。或者也可以通过这个来推后下载那些需要内购才能获得的资源文件。在一些大型游戏里这是很常见的优化方法,现在在 iOS 9 里也可以方便地使用了。
Support for Right-to-Left Languages
iOS 9 brings comprehensive support for right-to-left languages, which makes it easier for you to provide a flipped user interface. For example:
To learn more about providing a flipped user interface, see Supporting Right-to-Left Languages.
支持从右向左显示的语言格式。
App Transport Security
App Transport Security (ATS) enforces best practices in the secure connections between an app and its back end. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt; it is also on by default in iOS 9 and OS X v10.11. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.
If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn‘t follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this domain in your app‘sInfo.plist file.
默认Https连接方式进行更安全的网络通信。
Extension Points
iOS 9 introduces several new extension points (an extension point defines usage policies and provides APIs to use when you create an app extension for that area). Specifically:
To learn more about creating app extensions in general, see App Extension Programming Guide.
Extension 增加新功能
Network extension增加:
1、使用Packet Tunnel Provider extension可以实现自定义VPN代理。
2、使用App Proxy Provider extension实现完全透明的网络代理。
3、使用Filter Data Provider and the Filter Control Provider extension 实现动态内容过滤。
以上所有Network extension功能需要从系统获取权限。
Safari extension 增加:
1、使用Shared Links extension 时,用户可以在Safari的“共享连接”里面看到你的内容。
2、使用Content Blocking extension时,当你的用户正在访问网页时,可以给Safari一个阻碍列表,实现控制内容显示。 如Safari广告过滤。
Index Maintenance extension 支持不启动App就能搜素App的内容。
Audio Unit extension 允许开发者的App提供音频工具、资源、声效等,不需要使用GarageBand, Logic这样的专业App。这个extension 给音频处理带来了一个新形式。
Contacts and Contacts UI
iOS 9 introduces the Contacts and Contacts UI frameworks (Contacts.framework and ContactsUI.framework), which provide modern object-oriented replacements for the Address Book and Address Book UI frameworks. To learn more, see Contacts Framework Referenceand ContactsUI Framework Reference.
联系人框架 Address Book and Address Book UI frameworks过时,以后使用新版本的Contacts and Contacts UI frameworks。
Watch Connectivity
The Watch Connectivity framework (WatchConnectivity.framework) provides two-way communication between an iPhone and a paired Apple Watch. Use this framework to coordinate activities between your iOS app and your corresponding Watch app. The framework supports immediate messaging between the apps when they are both running, and background messaging in other cases. To learn more, see Watch Connectivity Framework Reference.
Keychain
The keychain provides more item protection options and a new type of encryption keys owned by the secure enclave. Specifically:
keychain 钥匙串数据存储,提供了更多的数据保护方式,和一种只有使用者掌握的新的加密密钥。
1、新的访问列表安全限制,创建约束必须有TouchID 或者密码。
2、新的TouchID安全限制,当指纹添加或修改时,会使钥匙串数据失效。
3、支持使用访问控制列表中App自己设置的密码,加密钥匙串数据。
4、支持使用单独的授权会话,与普通的SecItem钥匙串数据对象分开。
5、支持生成密钥并且只在使用kSecAttrTokenIDSecureEnclave属性的安全环境下使用,注意访问这些密钥,也受访问访问控制列表的约束。
Swift Enhancements
To learn about what’s new in Swift, see Swift Language.
Additional Framework Changes
In addition to the major changes described above, iOS 9 includes many other improvements.
AV Foundation Framework
The AV Foundation framework (AVFoundation.framework) adds new AVSpeechSynthesisVoice API that lets you specify a voice by identifier, instead of by language. You can also use the name and quality properties to get information about a voice.
AVSpeechSynthesisVoice ,可以用来给声音加标志位, 而不是之前的语言。你也可以获取一个声音信息里面的名字和质量。
AVKit Framework
The AVKit framework (AVKit.framework) includes the AVPictureInPictureController and AVPlayerViewController classes, which help you participate in Picture in Picture. For more information about Picture in Picture, see Multitasking Enhancements for iPad.
增加画中画相关的API。
CloudKit Framework
If you have a CloudKit app, you can use CloudKit web services or CloudKit JS, a JavaScript library, to provide a web interface for users to access the same data as your app. You must have the schema for your databases already created to use a web interface to fetch, create, update, and delete records, zones, and subscriptions. For more information, see CloudKit JS Reference, CloudKit Web Services Reference, and CloudKit Catalog: An Introduction to CloudKit (Cocoa and JavaScript) .
对于使用iCloud 数据存储的App,可以在App里面,通过网页接口访问存储的数据。 也可以通过App里面知晓的结构,通过网页接口对iCoud数据增删改查。
Foundation Framework
The Foundation framework (Foundation.framework) includes the following enhancements:
Foundation framework 扩展
1、按需加载资源的相关API
2、字符文件,支持与上下文相关的大量宽度文本。
3、NSProcessInfo 接口里面增加电源接口和散热管理。
HealthKit Framework
The HealthKit framework (HealthKit.framework) includes the following enhancements:
健康框架
Local Authentication Framework
The Local Authentication framework (LocalAuthentication.framework) includes the following enhancements:
本地授权框架:
1、当指纹登记和移除时,App可以得到变化通知,修改相关内容。
2、支持取消代码提示框。
3、支持在钥匙串里面,管理钥匙串访问控制列表,和授权访问会话。
4、支持touchID 重复匹配。 有电话通知时,可以用evaluateAccessControl和 evaluatePolicy:localizedReason:reply:方法,实现touchID解锁。
MapKit Framework
The MapKit framework (MapKit.framework) includes several additions that help you provide a richer user experience. Specifically:
1、支持查询路经地点,和启动地图App进入地点方向。
2、支持3D显示。
3、可以完全自定义地图元素。
4、MapKit和GLGEocoder的搜索结果,可以同时知道结果对应的时区。
PassKit Framework
The PassKit framework (PassKit.framework) includes several additions that support enhancements in Apple Pay. Specifically:
iOS9里面,Apple Pay 支持发现卡、商店借记卡、信用卡.
Safari Services Framework
The Safari Services framework (SafariServices.framework) includes the following enhancement.
SFSafariViewController can be used to display web content within your app. It shares cookies and other website data with Safari, and has many of Safari‘s great features, such as Safari AutoFill and Safari Reader. Unlike Safari itself, the SFSafariViewController UI is tailored for displaying a single page, featuring a Done button that takes users back to where they were in your app.
If your app displays web content, but does not customize that content, consider replacing your WKWebView or UIWebView-based browsers with SFSafariViewController.
Safari Services Framework。这个东西非常屌,当你的app需要展示一个WebView又不需要太多定制的时候,用它来替换掉你现在在用的UIWebView或者WKWebView。他可以让Safari以一个Controller的形式加载你的网页,和系统的Safari完全共享Cookie和Autofill等特性,最重要的,Safari的JavaScript引擎。
UIKit Framework
The UIKit framework (UIKit.framework) includes many enhancements, such as:
1、UIStackView类,用来帮助管理一系列的子视图,可以水平布局和垂直方向布局。
2、UIView 布局增加新的锚点(leadingAnchor and widthAnchor), NSLayoutAnchor, and NSLayoutDimension,可以帮助更加方便的布局。
3、新的布局指导,帮助你控制只读的内容和需要绘制的内容。
4、新的UIApplicationDelegate方法,你可以用来打开或者修改一个文档,而不是打开文档的副本。要支持这个功能,在Info.plist 文件中把LSSupportsOpeningDocumentsInPlace 属性设为YES。
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options NS_AVAILABLE_IOS(9_0); // no equiv. notification. return NO if the application can‘t open for some reason
5、UITextInputAssistantItem 类, 帮助你布局工具栏上的按钮。
6、touch 事件增强,例如,拿到从上次刷新界面到这一次触摸事件中间的所有触摸动作。
7、UIKit 动力学,如增强支持非矩形的边界。 新的UIFieldBehavior 类,支持更多可以自定义的区域类型,和追加的UIAttachmentBehavior的附件类型。
8、UIUserNotificationAction 推送通知的答复动作,支持像短信一样的直接输入文本回复。
9、新的NSDataAsset类, 可以更简单的从内存和屏幕上获取需要的内容。
10、所有标准的UI控件,支持从右到左显示的语言形式。 同时,导航栏、手势、collection views、表格也能合适的翻转。
Deprecated APIs
The following APIs are deprecated:
过期API
1、Address Book and Address Book UI frameworks 过期,用Contacts and Contacts UI frameworks 代替。
2、NSURLConnection 过期,用NSURLSession代替。 NSURLSession就是我们新缓存使用的技术方案,苹果强制开发者往新技术转变了。
标签:
原文地址:http://www.cnblogs.com/chen1987lei/p/4861055.html