其他 macOS Sierra Framework 更改Additional macOS Sierra Framework Changes

加速框架增强Accelerate Framework Enhancements

已对 macOS Sierra 的加速框架进行了以下改进:The following enhancement have been made to the Accelerate Framework for macOS Sierra:

  • 添加了 Quadrature (微积分)。Added Quadrature (integral calculus).
  • 添加了用于构造神经网络的基本函数。Added Basic functions for constructing neural networks.
  • 添加了要测试的几何谓词函数,例如两个几何对象的交集。Added Geometric predicate functions to test for things like the intersection of two geometric objects.

AppKit 框架增强功能AppKit Framework Enhancements

已对 macOS Sierra 的 AppKit 框架进行了以下改进:The following enhancement have been made to the AppKit Framework for macOS Sierra:

  • NSCollectionView 的几项增强功能,例如:Several enhancements to NSCollectionView such as:
    • 折叠部分-允许用户将集合视图部分折叠到单个水平行中。Collapsible Sections - Allows the user to collapse a Collection View section into a single horizontal row.
    • 使用与 iOS 中的UICollectionView相同的 API,可以在流布局中浮动页眉和页脚。Floating Headers - Headers and Footers can now be floated (in a flow layout) using the same API as UICollectionView in iOS.
    • 滚动的背景视图-现在可以将 "集合视图背景" 设置为随内容一起滚动。Scrollable Background Views - A collection Views background can now be set to scroll along with the content.
  • 已对延迟的视图布局经过优化和扩展。The deferred view layout pass has been optimized and extended.
  • 拖放 API 现在包含新的 NSFilePromiseProviderNSFilePromiseReceiver 类以支持拖动群。The drag-and-drop API now includes the new NSFilePromiseProvider and NSFilePromiseReceiver classes to support drag flocking.
  • 已向现有控件添加了几个便利性构造函数:Several convenience constructors have been added to existing controls:
    • NSButton 包含用于创建推送按钮、复选框和单选按钮的新构造函数。NSButton includes new constructors for creating push buttons, checkboxes and radio buttons.
    • NSTextField 包括用于创建环绕和非环绕标签、特性化标签和可编辑文本字段的新构造函数。NSTextField includes new constructors for creating wrapping and non-wrapping labels, attributed labels and editable text fields.
    • NSSegmentedControl 包含用于从一组标签或图像创建分段控件的新构造函数。NSSegmentedControl includes new constructors for creating segmented controls from a group of labels or images.
    • NSSlider 包括用于创建水平线性滑块的新构造函数。NSSlider includes new constructors for creating horizontal linear sliders.
    • NSImageView 包括用于从给定的 NSImage创建不可编辑的图像视图的新构造函数。NSImageView includes new constructors for creating non-editable image views from a given NSImage.
  • 添加了新的 NSGridView,以自动将子视图的集合布局为具有可变大小的行和列的网格,可以动态隐藏或显示这些列。The new NSGridView has been added to auto layout a collection of sub views into a grid with variable sized rows and columns that can be dynamically hidden or shown.

AVFoundation 框架增强功能AVFoundation Framework Enhancements

已对 macOS Sierra 的 AVFoundation 框架进行了以下改进:The following enhancement have been made to the AVFoundation Framework for macOS Sierra:

  • 在 macOS 中,应用程序不再需要基于内容类型实现不同的AVPlayerItem行为。In macOS, the app no longer has to implement different AVPlayerItem behaviors based on content type. 只需设置 Rate 属性,AVFoundation 就会确定在没有停止的情况下是否有足够的内容可用于播放。Simply set the Rate property and AVFoundation will determine when enough content is available for playback without stalling.
  • 使用新的 AVPlayerLooper 类可以更轻松地在播放过程中循环给定的媒体。The new AVPlayerLooper class makes it easier to loop a given piece of media during playback.
  • AVAssetDownloadURLSession 类允许下载和以后播放 FairPlay 加密的 HLS 流。The AVAssetDownloadURLSession class allows for the downloading and later playback of FairPlay encrypted HLS streams.

核心数据框架增强功能Core Data Framework Enhancements

针对 macOS Sierra 的核心数据框架进行了以下改进:The following enhancement have been made to the Core Data Framework for macOS Sierra:

  • NSManagedObjectContext对象支持并发错误和不序列化的提取。Root NSManagedObjectContext objects supports concurrent faulting and fetching without serialization.
  • NSPersistentStoreCoordinator类维护 SQLite 数据存储的池。The NSPersistentStoreCoordinator class maintains a pool of SQLite data stores.
  • 在 WAL 日志模式下,具有 SQLite 数据存储的NSManagedObjectContext对象支持新的查询生成功能,在该功能中,托管对象上下文(MOC)可以固定到特定数据库版本,以供将来获取和出错事务。The NSManagedObjectContext objects with SQLite data stores in the WAL Journal Mode support the new query generation feature where Managed Object Contexts (MOC) can be pinned to specific database versions for future fetching and faulting transactions.
  • 使用高级 NSPersistenceContainer 引用 NSPersistentStoreCoordinatorNSManagedObjectModel和其他核心数据配置资源。Using the high-level NSPersistenceContainer to reference the NSPersistentStoreCoordinator, NSManagedObjectModel and other Core Data configuration resources.
  • 添加了几个新的便利方法,NSManagedObject 更轻松地执行提取和创建子类。Several new convenience methods have been added to NSManagedObject making it easier to perform fetches and create subclasses.

有关详细信息,请参阅 Apple 的核心数据框架参考For more information, please see Apple's Core Data Framework Reference.

核心映像框架增强功能Core Image Framework Enhancements

已对 macOS Sierra 的核心图像框架进行了以下改进:The following enhancement have been made to the Core Image Framework for macOS Sierra:

  • CIFilter类的 ImageWithExtent 方法可用于在筛选器操作中插入自定义处理。The ImageWithExtent method of the CIFilter class can be used to insert custom processing into the filter operation. 核心映像将在处理图像以进行输出或显示时调用筛选器之间的给定回调。Core Image will invoke the given callback between filters when processing an image for output or display.
  • 应用现在可以通过在处理之前和之后转换颜色空间来处理核心图像上下文工作颜色空间之外的颜色空间中的图像。The app can now process images in a color space outside of the Core Image context's working color space by converting in and out of the color space before and after processing.
  • 核心映像内核现在可以请求特定的像素输出格式。The Core Image kernel can now request a specific pixel output format.
  • 添加了以下新的映像筛选器: CINinePartTitledCINinePartStretchedCIHueSaturationValueGradientCIEdgePreserveUpsampleFilterCIClampThe following new image filters have been added: CINinePartTitled, CINinePartStretched, CIHueSaturationValueGradient, CIEdgePreserveUpsampleFilter and CIClamp.

基础框架增强功能Foundation Framework Enhancements

已对 macOS Sierra 的基础框架进行了以下改进:The following enhancement have been made to the Foundation Framework for macOS Sierra:

  • 使用NSDimentions API 来表示、转换和显示许多最常见的物理单位,例如大容量、长度、速度、持续时间和温度。Use the NSDimentions API for representing, converting and displaying many of the most common physical units such as mass, length, speed, duration and temperature.
  • 使用NSISO8601DateFormatter类来分析和生成 ISO 8601 格式的日期。Use the NSISO8601DateFormatter class for parsing and generating ISO 8601 formatted dates.
  • 使用新的NSDateInterval类可以进行日期和时间间隔计算,如持续时间,用于比较间隔和测试间隔交点。Use the new NSDateInterval class to make date and time interval calculations such as durations, for comparing intervals and testing for interval intersections.
  • 使用NSPersonNameComponentsFormatter类可从字符串分析人员姓名的元素。Use the NSPersonNameComponentsFormatter class to parse the elements of a person's name from a string.
  • 使用新的NSURLSessionTaskMetrics类获取 URL 网络会话的指标。Use the new NSURLSessionTaskMetrics class to obtain metrics for a URL networking session.

有关详细信息,请参阅适用于 OS X v 10.12 和 iOS 10 的 Apple Foundation 发行说明For more information, please see Apple's Foundation Release Notes for OS X v10.12 and iOS 10.

Gamekit\ 框架增强功能GameKit Framework Enhancements

已对 macOS Sierra 的 Gamekit\ 框架进行了以下改进:The following enhancement have been made to the GameKit Framework for macOS Sierra:

  • Game Center 应用已弃用,并已从 macOS 中删除。The Game Center App has been deprecated and removed from macOS. 如果应用使用 Gamekit\,它_必须_提供其自己的接口以显示 gamekit\ 功能,如排行榜等。If the app uses GameKit, it must present its own interface to display GameKit features such as leaderboards, etc.
  • GKCloudPlayer类已经实现了新的仅限 iCloud 的帐户类型。A new iCloud-only account type has been implemented by the GKCloudPlayer class.
  • 新的GKGameSession类提供了用于在 Game Center 上管理持久数据存储的通用解决方案。The new GKGameSession class provides a generalized solution for managing persistent data storage on Game Center. GKGameSession 维护一个播放器列表,应用负责实现如何以及何时在参与者之间存储、检索或交换参与者日期。GKGameSession maintains a list of players and the app is responsible form implementing how and when participant date is stored, retrieved or exchanged between players. 在许多情况下,游戏会话可以替换现有的基于转换的匹配、实时匹配或持久的游戏保存方法。In many instances Game Sessions can replace existing turn-based matches, real-time matches or persistent game save methods.

GamePlayKit 框架增强功能GamePlayKit Framework Enhancements

已对 macOS Sierra 的 GamePlayKit 框架进行了以下改进:The following enhancement have been made to the GamePlayKit Framework for macOS Sierra:

  • 添加了过程干扰,并可用于在自然的纹理中提高真实感,增加了对相机运动的真实感,并帮助生成了丰富的游戏世界。Procedural noise generation has been added and can be used to enhance the realism in natural-looking textures, add realism to camera movements and help generate rich game worlds.
  • 使用空间分区对游戏世界数据进行分区,以便高效搜索。Use Spatial Partitioning to partition the game world data for efficient searching.
  • 添加了新的 Monte Carlo 战略家(GKMonteCarloStrategist),以便进行可能的移动计算。A new Monte Carlo strategist (GKMonteCarloStrategist) has been added for exhaustive possible move computation.
  • 添加了新的决策树 API (GKDecisionTreeGKDecisionNode),以增强游戏构建 AI。A new Decision Tree API has been added (GKDecisionTree and GKDecisionNode) to enhance the game-building AI.
  • 已使用新的GKAgent3DGKGraphNode3D类将3d 支持添加到现有代理和路径查找行为。3D support has been added to existing agent and path-finding behaviors using the new GKAgent3D and GKGraphNode3D classes.
  • 使用新的GKMeshGraph类来提供高性能、外观上的路径。Use the new GKMeshGraph class to provide high-performance, natural-looking paths.
  • 新的GKSceneGKSKNodeComponent类使得 GameplayKit 和 SpriteKit 的组合比以往更容易。The new GKScene and GKSKNodeComponent classes make combining GameplayKit and SpriteKit easier than ever.

金属框架增强功能Metal Framework Enhancements

已对 macOS Sierra 的金属框架进行了以下改进:The following enhancement have been made to the Metal Framework for macOS Sierra:

  • 3D 应用和游戏现在可以通过 GPU 使用_分割_来有效地呈现复杂的场景和几何。3D apps and games can now use Tessellation to efficiently render complex scenes and geometry via the GPU.
  • 使用函数特殊化为场景创建高优化的材料和光源组合函数集合。Use Function Specialization to create a highly-optimized collection of material and light combination functions for a scene.
  • 提供资源分配的精细控制,使用资源堆和 Memoryless 呈现目标优化基于金属的应用的性能。Provide fine-grained control of resource allocation to optimize performance of Metal based apps using Resource Heaps and Memoryless Render Targets.

若要了解详细信息,请参阅 Apple 的金属编程指南To learn more, please see Apple's Metal Programming Guide.

模型 i/o 框架增强功能Model I/O Framework Enhancements

已对 macOS Sierra 的模型 i/o 框架进行了以下改进:The following enhancement have been made to the Model I/O Framework for macOS Sierra:

  • 现在支持 USD 文件格式。The USD file format is now supported.
  • 使用新的 MDLMaterialPropertyGraph 类轻松支持对模型的运行时更改。Use the new MDLMaterialPropertyGraph class to easily support runtime changes to models.
  • 已将已签名的距离字段支持添加到了MDLVoxelArray类中。Signed Distance Field support has been added to the MDLVoxelArray class.
  • 使用新的 MDLLightProbeIrradianceDataSource 类来帮助进行轻型探测放置。Use the new MDLLightProbeIrradianceDataSource class to assist in Light Probe placement.

照片框架增强功能Photos Framework Enhancements

已对 macOS Sierra 的照片框架进行了以下改进:The following enhancement have been made to the Photos Framework for macOS Sierra:

  • 实时照片编辑现在适用于支持照片框架和照片编辑扩展的应用(在照片和照相机应用内使用)。Live Photo editing is now available for apps that support the Photos framework and to photo editing extensions (for use inside of the Photos and Camera apps).
  • 使用新的PHLivePhotoEditingContext类将编辑同时应用于视频和活动照片的内容。Use the new PHLivePhotoEditingContext class to apply edits to both the video and still content of Live Photos.
  • 使用CIImageProcessorInputCIImageProcessorOutput类,利用新的核心映像处理器功能执行编辑。Use the CIImageProcessorInput and CIImageProcessorOutput classes to take advantage of the new Core Image processor feature to perform edits.
  • 若要支持实时照片, PHLivePhotoPHLivePhotoView类已从 iOS 移植到 macOS。To support Live Photos, the PHLivePhoto and PHLivePhotoView classes have been ported from iOS to macOS.

SceneKit 框架增强功能SceneKit Framework Enhancements

已对 macOS Sierra 的 SceneKit 框架进行了以下改进:The following enhancement have been made to the SceneKit Framework for macOS Sierra:

  • 现在提供了一个新的基于物理的渲染(.PBR)系统,通过更简单的资产创作获得更真实的结果。Now includes a new Physically Based Rendering (PBR) system for more realistic results with simpler asset authoring.
  • 使用新的SCNLightingModelPhysicallyBased明暗度模型来模拟各种现实的阴影效果,同时仅要求三个基本属性(DiffuseMetalnessRoughness)。Use the new SCNLightingModelPhysicallyBased shading model to product a wide range of realistic shading effects while requiring only three fundamental properties (Diffuse, Metalness and Roughness).
  • 由于 .PBR 着色最适用于基于环境的照明,因此请使用 LightingEnvironment 属性将基于图像的照明分配到茶色的整个场景。Since PBR shading works best with environment-based lighting, use the LightingEnvironment property to assign image-based lighting to tan entire scene.
  • 使用 "IESProfileURL" 属性可以导入在实际值(如 "亮度" (流明)和色温温度(温度)中定义光照基准的实际光源固定装置。Use the IESProfileURL property to import real-world light fixtures that define lighting base on real-world values such as intensity (in lumens) and color temperature (in degrees Kelvin).
  • 使用 HDR 特性和效果, SCNCamera类可提供更大的真实感。The SCNCamera class can provide greater realism by using HDR features and effects. 使用自适应曝光创建自动效果,或使用 vignetting、颜色 fringing 和颜色评分向游戏添加 filmatic 效果。Use adaptive exposure to create automatic effects or use vignetting, color fringing and color grading to add filmatic effects to the game.
  • 与传统的呈现技术相比,.PBR 和 HDR 相机功能提供了更好的结果,因此,SceneKit 现在在线性颜色空间中执行所有颜色计算(使用单色设备显示器上的 P3 颜色范围)。Both PBR and HDR camera features provide better results than traditional rendering techniques and, as a result, SceneKit now performs all color calculations in a linear color space (using P3 color gamut on wide-color device displays).
  • SceneKit 通过阅读颜色配置文件信息,使颜色与所有颜色匹配。SceneKit now color matches all colors by reading the color profile information.
  • SceneKit 解释所有着色器类型的线性 RGB 颜色空间中的颜色分量值。SceneKit interprets color component values in a linear RGB color space for all shader types.
  • 由于 SceneKit 读取和调整纹理图像中的颜色配置文件信息,因此请对所有图像使用资产目录,以确保提供此信息。Since SceneKit reads and adjust for color profile information in texture images, use Asset Catalogs for all images to ensure this information is provided.
  • 可以通过在应用的 Info.plist中指定 SCNDisableLinearSpaceRenderingSCNDisableWideGamut 键来禁用线性颜色空间渲染和宽色。Both linear color space rendering and wide-color can be disabled by specifying the SCNDisableLinearSpaceRendering and SCNDisableWideGamut keys in the app's Info.plist.
  • 生成任意多边形灵长类动物(从文件加载或以编程方式生成),以通过新的SCNGeometryPrimitiveTypePolygon类指定几何图形。Build arbitrary polygon primates (either loaded from files or generated programmatically) to specify geometry with the new SCNGeometryPrimitiveTypePolygon class.

安全框架增强功能Security Framework Enhancements

已对 macOS Sierra 的安全框架进行了以下改进:The following enhancement have been made to the Security Framework for macOS Sierra:

  • 在所有平台(iOS、tvOS、watchOS 和 macOS)上,SecKey 接口已现代化且统一。The SecKey interface has been modernized and unified across all platforms (iOS, tvOS, watchOS and macOS).

SpriteKit 框架增强功能SpriteKit Framework Enhancements

已对 macOS Sierra 的 SpriteKit 框架进行了以下改进:The following enhancement have been made to the SpriteKit Framework for macOS Sierra:

  • Tilemaps 现在支持使用 SKTileMapModeSKTileGroupSKTileGroupRuleSKTileSet 类的2D、2.5 D 和侧滚动游戏的正方形、六边形和等角磁贴形状。Tilemaps now support square, hexagonal and isometric tile shapes for 2D, 2.5D and side-scrolling games using the SKTileMapMode, SKTileGroup, SKTileGroupRule and SKTileSet classes.
  • 使用新的 SKWarpGeometry 类拉伸或扭曲SKSpriteNodeSKEffectNode渲染。Use the new SKWarpGeometry class to stretch or distort SKSpriteNode or SKEffectNode rendering. 新的SKAction类可用于对扭曲效果之间的转换进行动画处理。The new SKAction class can be used to animate transitions between warp effects.
  • 自定义着色器可以提供属性(SKAttribute),这些属性可通过提供属性值(SKAttributeValue),通过使用着色器的每个节点单独进行配置。Custom shaders can provide attributes (SKAttribute) that can be configured separately by each node that uses the shader by supplying an Attribute Value (SKAttributeValue).
  • SKView类提供了几种新的方法,可对场景的呈现时间和方式进行精细的控制。The SKView class provides several new methods to give fine-grained control over when and how a scene is rendered.

新框架New Frameworks

以下框架已添加到 macOS Sierra:The following frameworks have been added to macOS Sierra:

  • 意向框架-此框架允许应用检查交互(如位置或用户操作),并根据该信息采取措施。Intents Framework - This framework allow the app to examine interactions (such as location or user actions), and take action based on that information.
  • SafariServices 框架-此框架允许应用为 MacOS 和 IOS 开发 Safari (如内容阻止程序)的应用扩展。SafariServices Framework - This framework allow the app to develop app extensions for Safari (such as content blockers) for both macOS and iOS.