WWDC 2019 新的 framework

WWDC 2019 新的 framework

参考翻译自:https://developer.apple.com/documentation/



RealityKit

https://developer.apple.com/documentation/realitykit
iOS 13.0+
macOS 10.15+
UIKit for Mac 13.0+


WWDC 2019 : Building Apps with RealityKit
https://developer.apple.com/videos/play/wwdc2019/605/


Simulate and render 3D content for use in your augmented reality apps.

在你的增强现实(AR)应用中 模拟和渲染3D 内容。


Overview

Use the RealityKit framework to implement high-performance 3D simulation and rendering. RealityKit leverages information provided by the ARKit framework to seamlessly integrate virtual objects into the real world.

Use RealityKit’s rich functionality to create compelling augmented reality (AR) experiences.

  • Import fully formed assets, including sophisticated compositions that you make with the Reality Composer app, or build them from meshes, materials, and textures.

  • Place audio sources in the environment.

  • Animate objects, both manually and with physics simulations.

  • Respond to user input and changes in the environment.

  • Synchronize across devices, enabling group AR experiences.


使用 RealityKit 框架来实现高表现力的 3D 模拟和渲染功能。RealityKit 使用 ARKit 框架提供的信息来无缝的衔接虚拟物体和现实世界。

使用 RealityKit 的功能来创造强烈的 AR 体验。

  • 引入完全成型的资源,包含你在Reality Composer 中 复杂的构图。
  • 在环境中放置音频资源。
  • 让对象生动起来,包含手动的和物理模拟的;
  • 与用户输入进行交互,并在环境中改变。
  • 跨设备同步,实现 AR组 的体验。

PencilKit

https://developer.apple.com/documentation/pencilkit
iOS 13.0+
macOS 10.15+
UIKit for Mac 13.0+


相关WWDC video : 《Introducing PencilKit》

https://developer.apple.com/videos/play/wwdc2019/221/


Capture touch input as an opaque drawing and display that content from your app.

从你的应用中 捕捉触摸输入作为书写和展示。


Overview

PencilKit makes it easy to incorporate hand-drawn content into your iOS or macOS apps quickly and easily. PencilKit provides a drawing environment for your iOS app that takes input from Apple Pencil, or the user’s finger, and turns it into high quality images you display in either iOS or macOS. The environment comes with tools for creating, erasing, and selecting lines.

You capture content in your iOS app using a PKCanvasViewobject. The canvas object is a view that you integrate into your existing view hierarchy. It supports the low-latency capture of touches originating from Apple Pencil or your finger. It then vends the final results as a PKDrawingReference object, whose contents you can save with your app’s content. You can also convert the drawn content into an image, which you can display in your iOS or macOS app.

PencilKit 让往 iOS 和 macOS 中手写内容变得快捷。PencilKit 给ios 应用提供了一个从 Apple Pencil 或者用户手指输入 的书写环境,并将此转化为高质量图片在 iOS 或 macOS 上展示。这个环境从创建、擦除或选择线条开始。

你使用 PKCanvasView 对象在 iOS 中捕捉内容。canvas 对象是一个视图,可以集成在你的视图结构中。它提供了铅笔或手指的低延时的触控捕捉。然后产生 PKDrawingReference 对象的结果,你可以保存这个对象的内容。你也可以转化绘制内容为图片,展示在你的 iOS 或 macOS 应用中。


VisionKit

https://developer.apple.com/documentation/visionkit
iOS 13.0+
UIKit for Mac 13.0+


Use the iOS camera to scan documents like those you capture in the Notes app.

像在备忘录应用一样,使用 iOS 摄像头来扫描文档。


Overview

VisionKit is a small framework that lets your app use the system’s document scanner. Present the document camera as a view controller, which covers the entire screen like the camera function in Notes. Implement the VNDocumentCameraViewControllerDelegate in your own view controller to receive callbacks from the document camera, such as completed scans.

VisionKit 是一个轻量级框架,可以让你的应用使用系统的文档扫描器。

展示文档摄像头作为一个全屏的视图控制器 VC。在你自己的 VC 中使用 VNDocumentCameraViewControllerDelegate 来接受文档摄像头完成扫描后的回调。


SoundAnalysis

https://developer.apple.com/documentation/soundanalysis
iOS 13.0+
macOS 10.15+
UIKit for Mac 13.0+
tvOS 13.0+
watchOS 6.0+


Analyze streamed and file-based audio to classify it as a particular type.

分析流或者基于文件的音频,来作为特殊类型分类。


Overview

Use the SoundAnalysis framework to analyze audio and recognize it as a particular type, such as laughter or applause. The framework performs its analysis using a Core ML model trained by an MLSoundClassifier. Using the framework’s ability to analyze streamed or file-based audio lets you add intelligent audio recognition capabilites to your app.

使用SoundAnalysis 框架来分析音频,并将它识别为特殊类型,比如大笑或者喝彩。这个框架使用 被 MLSoundClassifier 训练 的 Core ML 模型来实现他的分析。使用这个框架来分析流或者文件音频 可以让你对应用添加更智能的音频识别。


Core Haptics

https://developer.apple.com/documentation/corehaptics
iOS 13.0+
UIKit for Mac 13.0+


Compose and play haptic patterns to customize your iOS app’s haptic feedback.

组成和使用触觉模式,来自定义你的 iOS 应用的触觉反馈。


Overview

Core Haptics lets you add customized haptic and audio feedback to your app. Use haptics to engage users physically, with tactile and audio feedback that gets attention and reinforces actions. Some system-provided interface elements—like pickers, switches, and sliders—automatically provide haptic feedback as users interact with them. With Core Haptics, you extend this functionality by composing and combining haptics beyond the default patterns.

Your app can play custom haptic patterns crafted from basic building blocks called haptic events (CHHapticEvent). Events can be transient, like the feedback you get from toggling a switch, or continuous, like the vibration or sound from a ringtone. You can use transient and continuous patterns independently, or build your pattern from precise combinations of the two. For example, the following haptic pattern combines a series of transient haptic events, shown in blue as short impulses, with a single continuous haptic event, shown in orange:

A visual representation of a haptic pattern as a series of filled bars. Short blue bars represent transient events, and the wide orange ramp represents a continuous event of decreasing intensity.

Intensity maps to the haptic’s amplitude or strength. Sharpness maps to the persistence or frequency of the haptic pattern.

The Core Haptics engine also supports an event type that allows you to play customized audio content as part of your pattern.

To add haptics to your app, you create an instance of CHHapticEngine, load a pattern, and use the engine to create a player to play that pattern. You create a pattern in one of three ways:

  • Dictionaries. Each entry in the dictionary defines a single characteristic of the haptic, like its intensity, start time, or duration. See Playing a Single-Tap Haptic Pattern to learn more about creating a dictionary inline.
  • Arrays of events and parameters. The CHHapticEvent class represents a haptic event as an object in code. The key-value pairs in a dictionary correspond to the properties and parameters associated with a CHHapticEvent. Haptic event objects are just another representation of the haptics dictionary.
  • AHAP files. This JSON-compliant file format specifies a haptic pattern through key-value pairs, analogous to a dictionary literal, except in a text file. Add this file to your Xcode project bundle.

All forms of pattern creation result in patterns with the exact same kind of content.


Core Audio Types

https://developer.apple.com/documentation/coreaudiotypes
iOS 13.0+
macOS 10.15+
UIKit for Mac 13.0+
tvOS 13.0+
watchOS 6.0+


Use specialized data types to interact with audio streams, complex buffers, and audiovisual timestamps.

使用特殊的数据类型来和音频流、复杂的缓冲、试听时间戳 交互。


Overview

The CoreAudioTypes framework declares common data types and constants used by other Core Audio interfaces. This framework also includes a handful of convenience functions.

If you are unfamiliar with the specialized terminology used when manipulating audio data, refer to Core Audio Glossary.

CoreAudioTypes 框架申明普通数据类型和其它 Core Audio 接口使用的常量。这个框架同时包含一些方便的功能。

如果你对操作音频数据时的特殊数据不熟悉,请参阅 Core Audio Glossary.


QuickLookThumbnailing

https://developer.apple.com/documentation/quicklookthumbnailing
iOS 13.0+
macOS 10.15+
UIKit for Mac 13.0+

无介绍。


Combine

https://developer.apple.com/documentation/combine
iOS 13.0+
macOS 10.15+
UIKit for Mac 13.0+
tvOS 13.0+
watchOS 6.0+


Customize handling of asynchronous events by combining event-processing operators.

使用合成事件处理操作来自定义处理异步事件。


Overview

The Combine framework provides a declarative Swift API for processing values over time. These values can represent user interface events, network responses, scheduled events, and many other kinds of asynchronous data. Combine declares publishers to expose values that can change over time, and subscribers to receive those values from the publishers.

  • The Publisher protocol declares a type that can deliver a sequence of values over time. Publishers have operators to act on the values received from upstream publishers and republish them.
  • At the end of a chain of publishers, a Subscriber acts on elements as it receives them. Publishers only emit values when explicitly requested to do so by subscribers. This puts your subscriber code in control of how fast it receives events from the publishers it’s connected to.

Several Foundation types expose their functionality through publishers, including Timer, NotificationCenter, and URLSession. Combine also provides a built-in publisher for any property that’s compliant with Key-Value Observing.

You can combine the output of multiple publishers and coordinate their interaction. For example, you can subscribe to updates from a text field’s publisher, and use the text to perform URL requests. You can then use another publisher to process the responses and use them to update your app.

By adopting Combine, you’ll make your code easier to read and maintain, by centralizing your event-processing code and eliminating troublesome techniques like nested closures and convention-based callbacks.

Combine 框架提供 描述性的 Swift API 来随着时间处理值。这些值可以在用户界面事件、网络响应、预定事件和很多同步数据中展示。 Combine 声明 发布者(publishers)来揭示这些随着时间会改变的数据。


BackgroundTasks

https://developer.apple.com/documentation/backgroundtasks
iOS 13.0+
UIKit for Mac 13.0+
tvOS 13.0+


Request the system to launch your app in the background to run tasks.

请求系统在后台启动应用 来执行任务。


Overview

Use the BackgroundTasks framework to keep your app content up to date and run tasks requiring minutes to complete while your app is in the background. Longer tasks can optionally require a powered device and network connectivity.

Register launch handlers for tasks when the app launches and schedule them as required. The system will launch your app in the background and execute the tasks.

使用 BackgroundTasks 框架来保持你的应用内容最新,应用在后台时执行任务需要几分钟完成。较长的任务可以选择性的需要电量充足的设备和保持网络连通性。


IOUSBHost

https://developer.apple.com/documentation/iousbhost
macOS 10.15+
UIKit for Mac 13.0+

无介绍。


Logging

macOS 10.15+
UIKit for Mac 13.0+
https://developer.apple.com/documentation/logging

没有介绍。


MetricKit

https://developer.apple.com/documentation/metrickit
iOS 13.0+
UIKit for Mac 13.0+


Aggregate and analyze per-device reports on power and performance metrics.

聚集和分析每个设备电量和性能指标的报告。


Overview

With MetricKit, you can receive on-device app power and performance metrics captured by the system. A registered app receives reports containing data about the previous 24 hours at most once per day.

Use the data in the reports to help improve the performance of your app.

The framework includes:

  • A manager class and a subscriber protocol.
  • A payload class for reported data.
  • Classes for each category of metrics.
  • Classes for measurement units, such as bars of cellular connectivity.
  • Classes for representing accumulated data such as histograms.

NoteThis framework doesn’t return data to iPad apps running in macOS.

使用 MetricKit , 你可以收到系统捕捉的 设备上应用的电量和性能指标的报告。一个注册的 app 每天接受的报告包含过去最多过去 24小时内的数据。

使用报告中的数据来帮助完成提高你应用的表现。

这个框架包含

  • 一个管理来和一个成员协议;
  • 一个报告数据的负载类型;
  • metrics 的每一个分类类型;
  • 测量单元类,比如 蜂窝连接 的bars ???

Apple CryptoKit

https://developer.apple.com/documentation/cryptokit
iOS 13.0+
macOS 10.15+


Perform cryptographic operations securely and efficiently.

安全有效的实现加密操作。


Overview

Use Apple CryptoKit to perform common cryptographic operations:

  • Compute and compare cryptographically secure digests.
  • Use public-key cryptography to create and evaluate digital signatures, and to perform key exchange. In addition to working with keys stored in memory, you can also use private keys stored in and managed by the Secure Enclave.
  • Generate symmetric keys, and use them in operations like message authentication and encryption.

Prefer CryptoKit over lower-level interfaces. CryptoKit frees your app from managing raw pointers, and automatically handles tasks that make your app more secure, like overwriting sensitive data during memory deallocation.

使用CryptoKit 来执行加密操作:

  • 计算和比较密码安全摘要;

  • 使用公钥来创建 评估数字签名,执行钥匙交换。在保存在内存中的钥匙之外,你也可以使用Secure Enclave 存储和管理的私钥。

  • 生成对称钥匙,并在消息授权和加密中使用。


UIKit for Mac 13.0+

tvOS 13.0+


NetworkingDriverKit

macOS 10.15+

没有介绍。


DriverKit

https://developer.apple.com/documentation/driverkit
macOS 10.15+


Develop device drivers that run in user space.

开发设备驱动并在用户空间运行。


Overview

Use DriverKit to create device drivers that the user installs on their Mac. Drivers built with DriverKit run in user space, rather than as kernel extensions, for improved system security and stability.

The DriverKit framework provides C++ classes for IO services, device matching, memory descriptors, and dispatch queues. It also defines IO-appropriate types for numbers, collections, strings, and other common types. You use these with family-specific driver frameworks like USBDriverKit and HIDDriverKit.

Develop your driver with DriverKit, and package it in an app that uses the SystemExtensions framework to install and upgrade the driver on the user’s Mac.

使用 DriverKit 来创建 Mac 上的设备驱动。为了提高系统的安全和稳定性,使用 DriverKit 来创建用户空间的驱动 替代内核拓展。

DriverKit 框架对 IO 服务、设备匹配、内存描述符、队列调度 提供 C++ 类。它同时也定义了 numbers, collections, strings 和其他常见类型的合适的 IO 类型。你可以使用相关系列的驱动框架,如 USBDriverKit and HIDDriverKit

使用 DriverKit 开发你的驱动,并将它打包进一个使用 SystemExtensions 框架安装和升级驱动的 app。


EndpointSecurity

https://developer.apple.com/documentation/endpointsecurity
macOS 10.15+
UIKit for Mac 13.0+


Develop system extensions that enhance user security.

开发系统拓展来增强用户安全性。


Overview

Use the Endpoint Security library to create security-related software. Endpoint Security clients monitor system events for potentially malicious activity. Your client registers with Endpoint Security to authorize pending events, or receive notifications of events that have already occurred. These events include process executions, mounting file systems, forking processes, and raising signals.

Develop your system extension with Endpoint Security and package it in an app that uses the SystemExtensions framework to install and upgrade the driver on the user’s Mac.

使用 Endpoint Security 资源来创建安全相关软件。Endpoint Security 客户端给潜在的恶意活动模拟系统事件。你的客户端注册 Endpoint Security 来授权给挂起的事件,或者接收已经发生的事件的通知。这些事件包含进程执行、挂载文件系统、 分发进程和发起信号。

使用 Endpoint Security 开发你的系统拓展 ,并将它打包进一个使用 SystemExtensions 框架安装和升级驱动的 app。


ExecutionPolicy

https://developer.apple.com/documentation/executionpolicy
macOS 10.15+
UIKit for Mac 13.0+

没有介绍。


SystemExtensions

https://developer.apple.com/documentation/systemextensions
macOS 10.15+


Install and manage user-space code that extends the capabilities of macOS.

安装和管理用户空间编码来拓展 macOS 的功能。


Overview

Creating system extensions allows your app to enhance the capabilities of the user’s Mac, without the associated risks of developing kernel extentions (KEXTs). System extensions run in user space, where they can’t compromise the security or stability of macOS. The system grants these extensions a high level of privilege, so they can perform the kinds of tasks previously reserved to KEXTs.

You use frameworks like DriverKit and USBDriverKit to write your extension, before packaging the driver in your app bundle. At runtime, your app calls the SystemExtensions framework to install or update the extension for the user. Once installed, an extension remains available for all users on the system. Users can disable the extension by deleting the last copy of the host app, which deletes the extension.

创建系统拓展允许你的应用在不冒险开发内核拓展(KEXTs)的情况下,增强用户 Mac 的功能。系统拓展允许在用户空间,他们无法对 macOS 的安全和稳定妥协。系统授予这些拓展高级别的权限,所以他们可以执行各种KEXTs 保留的任务。

你可以在将驱动打包进你的 app 之前,使用类似 DriverKitUSBDriverKit 的框架来编写你的拓展。在运行时,你的应用将调用 SystemExtensions 框架来安装或更新。一旦安装,驱动将在系统上对所有用户有效。用户可以通过删除主应用程序,来使驱动删除而无效。


USBDriverKit

macOS 10.15+


Develop drivers for USB-based devices.

开发基于 USB 设备的驱动。


Overview

Use the USBDriverKit framework to develop drivers for custom or non-class compliant USB devices for use with macOS. USBDriverKit provides C++ classes you can use to attach and configure your device, and create USB message and stream pipes to exchange data. USBDriverKit devices work with the core types defined in the DriverKit framework.

Develop your driver with DriverKit and USBDriverKit, and package it in an app that uses the SystemExtensions framework to install and upgrade the driver on the user’s Mac.

使用 USBDriverKit 框架来开发Mac 上自定义或没有等级的 USB 驱动。USBDriverKit 提供了 C++ 类,你可以用来配置你的设备,并创建 USB 消息和流管道来交换数据。USBDriverKit 设备对 DriverKit 框架定义的核心类型有效。

使用 DriverKit 和 USBDriverKit 开发你的驱动,需要将它打包进一个使用 SystemExtensions 框架安装和升级驱动的 app。


USBSerialDriverKit

https://developer.apple.com/documentation/usbserialdriverkit
macOS 10.15+


Develop drivers for serial IO devices connected to your Mac.

开发连接 Mac的 串行 IO 设备的驱动。


Overview

The USBSerialDriverKit framework provides an API for developing serial communication drivers for USB devices like modems and serial adapters. The framework builds on DriverKit by adding the ability to set attributes like baud rate and parity, and work with a device’s universal asynchronous receiver/transmitter (UART).

Develop your driver with DriverKit and USBSerialDriverKit, and package it in an app that uses the SystemExtensions framework to install and upgrade the driver on the user’s Mac.

USBSerialDriverKit 提供开发如 调制解调器 和 串行适配器 的 USB设备 使用的串行 IO 通信接口驱动。这个框架基于 DriverKit 构建,并添加 波特率、奇偶性的功能,用于设备的通用异步收发器。


HIDDriverKit

https://developer.apple.com/documentation/hiddriverkit
macOS 10.15+


Develop drivers for devices that users interact with.

开发与用户交互的设备的驱动。


Overview

The HIDDriverKit framework provides C++ classes for developing drivers for human interface devices: keyboards, pointing devices, and digitizers like pens and touch pads. HIDDriverKit uses the core types defined in DriverKit, and adds features specific to human interface device development.

Develop your driver with DriverKit and HIDDriverKit, and package it in an app that uses the SystemExtensions framework to install and upgrade the driver on the user’s Mac.

HIDDriverKit 提供 C++ 类来开发人机交互设备驱动,这些设备如:键盘、点击设备、笔 和触控板。HIDDriverKit 使用 DriverKit 定义的核心类型,并添加用户交互设备开发的未来特性。


SwiftUI

https://developer.apple.com/documentation/swiftui
iOS 13.0+
macOS 10.15+
UIKit for Mac 13.0+
tvOS 13.0+
watchOS 6.0+


Declare the user interface and behavior for your app on every platform.

申明应用在各个平台的用户界面和表现。


Overview

SwiftUI provides views, controls, and layout structures for declaring your app’s user interface. The framework provides event handlers for delivering taps, gestures, and other types of input to your app, and tools to manage the flow of data from your app’s models down to the views and controls that users will see and interact with.

Create your own custom views that conform to the View protocol, and compose them with SwiftUI views for displaying text, images, and custom shapes using stacks, lists, and more. Apply powerful modifiers to built-in views and your own views to customize their rendering and interactivity. Share code between apps on multiple platforms with views and controls that adapt to their context and presentation.

An image showing an app built using SwiftUI running on the Mac, iPhone, and Apple Watch.

You can integrate SwiftUI views with objects from the UIKit, AppKit, and WatchKit frameworks to take further advantage of platform-specific functionality. You can also customize accessibility support in SwiftUI, and localize your app’s interface for different languages, countries, or cultural regions.

SwiftUI 提供生命应用用户接口的视图、控制和布局结构。这个框架提供手势等各个输入的事件处理;并提供工具管理 从应用模型到用户交互的视图控制的数据流。

创建遵守 View 协议的自定义视图,并使用 SwiftUI 视图来展示文字、图片和自定义形状来执行它们。应用强大编辑器来让内置视图和你自己的视图产生自定义的渲染和交互效果。在不同的平台间分享代码并适配。

你可以从 UIKit, AppKit 和 WatchKit 框架中集成 SwiftUI 视图,来充分发挥平台特性。你也可以在 SwiftUI 中自定义 accessibility 支持,并将应用界面国际化。


Bundle Resources

https://developer.apple.com/documentation/bundleresources
iOS 13.0+
macOS 10.15+
tvOS 13.0+
watchOS 6.0+


Resources located in an app, framework, or plugin bundle.

应用、框架、插件包中的资源。


Overview

A bundle is a directory with a standardized hierarchical structure that holds executable code and the resources used by that code. The bundle contains resources that may be accessed at runtime, such as images, audio files, user interface files, and property lists.

bundle包 是一个标准化层次结构的文件夹,包含可执行代码和代码需要使用的资源。bundle包 包含可以在运行时访问的资源,比如图片、音频文件、用户交互文件和 plist 文件。


LinkPresentation

https://developer.apple.com/documentation/linkpresentation
iOS 13.0+
macOS 10.15+
UIKit for Mac 13.0+

没有介绍


伊织 2019-06-18

发布了164 篇原创文章 · 获赞 162 · 访问量 65万+

猜你喜欢

转载自blog.csdn.net/lovechris00/article/details/92801736