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+

沒有介紹


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章