大多数浏览器和
Developer App 均支持流媒体播放。
-
充分利用 Apple Pencil 的强大功能
作为 iOS 18,iPadOS 18 和 visionOS 2 中的新功能,PencilKit 工具选择器现在支持自定属性,让用户能够选择完全自定的工具。了解如何利用同样出色的系统级工具选择体验,充分优化工具选择器带来的自定绘画体验。探索如何访问 Apple Pencil Pro 的新功能,包括侧旋角度、轻捏手势以及触觉反馈。
章节
- 0:00 - Introduction
- 1:16 - Configuring the tool picker
- 5:20 - Custom tools in the tool picker
- 8:47 - Apple Pencil Pro features and APIs
资源
- Apple Pencil
- Apple Pencil updates
- Configuring the PencilKit tool picker
- Forum: UI Frameworks
- Human Interface Guidelines: Apple Pencil and Scribble
- Playing haptic feedback in your app
相关视频
WWDC20
WWDC19
-
下载Array
-
-
10:24 - Respond to squeeze in UIKit
class MyViewController: UIViewController, UIPencilInteractionDelegate { func pencilInteraction(_ interaction: UIPencilInteraction, didReceiveSqueeze squeeze: UIPencilInteraction.Squeeze) { if UIPencilInteraction.preferredSqueezeAction == .showContextualPalette && squeeze.phase == .ended { let anchorPoint = squeeze.hoverPose?.location ?? myDefaultLocation presentMyContextualPaletteAtPosition(anchorPoint) } } }
-
10:46 - Respond to squeeze in SwiftUI
@Environment(\.preferredPencilSqueezeAction) var preferredAction @State var contextualPalettePresented = false @State var contextualPaletteAnchor = MyPaletteAnchor.default var body: some View { MyView() .onPencilSqueeze { phase in if preferredAction == .showContextualPalette, case let .ended(value) = phase { if let anchorPoint = value.hoverPose?.anchor { contextualPaletteAnchor = .point(anchorPoint) } contextualPalettePresented = true } } }
-
11:50 - Provide canvas feedback in UIKit
class MyViewController: UIViewController { @ViewLoading var feedbackGenerator: UICanvasFeedbackGenerator override func viewDidLoad() { super.viewDidLoad() feedbackGenerator = UICanvasFeedbackGenerator(view: view) } func dragAlignedToGuide(_ sender: MyDragGesture) { feedbackGenerator.alignmentOccurred(at: sender.location(in: view)) } func snappedToShape(_ sender: MyDrawGesture) { feedbackGenerator.pathCompleted(at: sender.location(in: view)) } }
-
12:29 - Provide canvas feedback in SwiftUI
@State var dragAlignedToGuide = 0 @State var snappedToShape = 0 var body: some View { MyView() .sensoryFeedback(.alignment, trigger: dragAlignedToGuide) .sensoryFeedback(.pathComplete, trigger: snappedToShape) }
-
-
正在查找特定内容?在上方输入一个主题,就能直接跳转到相应的精彩内容。
提交你查询的内容时出现错误。请检查互联网连接,然后再试一次。