惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
T
Tenable Blog
博客园_首页
S
Securelist
Spread Privacy
Spread Privacy
Google Online Security Blog
Google Online Security Blog
Forbes - Security
Forbes - Security
Engineering at Meta
Engineering at Meta
U
Unit 42
L
LINUX DO - 热门话题
量子位
T
Threat Research - Cisco Blogs
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
K
Kaspersky official blog
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
Martin Fowler
Martin Fowler
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Security Latest
Security Latest
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
Know Your Adversary
Know Your Adversary
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
V2EX - 技术
V2EX - 技术
T
Tailwind CSS Blog
月光博客
月光博客
Recent Announcements
Recent Announcements
G
Google Developers Blog
F
Full Disclosure
W
WeLiveSecurity
宝玉的分享
宝玉的分享
腾讯CDC
G
GRAHAM CLULEY
Vercel News
Vercel News
Simon Willison's Weblog
Simon Willison's Weblog
美团技术团队
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security

Inside Nutrient

A guide to the invisible work behind documents Introducing Nutrient Documents for Salesforce: Native document generation and signing Document AI vs. traditional OCR: Choosing between OCR, AI, and hybrid pipelines PDF SDK compliance and security evaluation checklist for enterprise teams (2026) Invariant Corp replaces paper processes with Nutrient Workflow and scales without limits What is process mapping? A complete guide Nutrient vs. Conga Composer for Salesforce document generation (2026) Document routing: How to automate document distribution The CTO’s AI playbook: Why accountability architecture beats orchestration Compliance workflow automation: Why built-in compliance is table stakes Workflow diagrams: Examples, symbols, and how to build one that actually runs Digital forms: Replace paper forms with automated workflows Approval workflow software: How to automate approvals Why document-centric automation is different The CEO’s AI playbook: Why decision architecture beats model selection Nutrient SDK product updates for Q1 2026 PDF redaction verification: How to prove sensitive data is permanently removed What is a VPAT? The complete guide to accessibility conformance reports What is PDF/UA? The accessible PDF standard explained Salesforce eSignatures: Generate, sign, and track documents in one flow Online document viewer: Options, tradeoffs, and how to embed one Document viewer for web apps: React, Vue, Angular (2026) Best document viewers in 2026: A buyer’s guide How to edit a PDF in Python: Add text, images, and annotations Nutrient advances Workflow platform with agentic AI for enterprise-grade speed and consistency in document-heavy operations How to create a Salesforce quote template from opportunity data The business case for accessibility: Five ways it drives enterprise value Python PDF library comparison (2026): 7 libraries for developers Why your AI agent hallucinates PDF table data PDF.js limitations: When to upgrade to a commercial PDF SDK How Subject scaled 5× with Nutrient’s PDF SDK without rebuilding its document layer I replaced our sales training with an AI coach that runs in Slack — here’s what broke Redirecting to: https://securitybuzz.com/cybersecurity-news/why-enterprise-permissions-are-ais-most-dangerous-inheritance/ Nutrient .NET SDK vs. iText Core: Complete comparison for .NET developers DocuVieware: Support’s most frequently asked setup questions Introducing Nutrient Workflow How to convert PDF to Word in C# (.NET) When email and spreadsheets stop working: Work order approval workflows for field teams on the move Compliance with confidence: Why document-centric automation is the foundation of your mission Nutrient expands AI Assistant, automating multistep document workflows inside any application What is document generation? A developer’s guide to PDF generation Document Converter data flow and how real-time watermarks skip the queue PDF/UA compliance guide: Requirements, standards, and best practices Computers still can’t understand you How Athena Intelligence built AI agents for regulated enterprises with Nutrient’s document infrastructure How to convert HTML to PDF (2026): 4 methods from browser print to SDK How to build a document extraction pipeline with Nutrient Vision API OCR vs. intelligent document processing: Choosing the right document extraction engine Beyond OCR: How document intelligence eliminates manual processing in regulated industries Nutrient vs. IronPDF: Complete comparison for .NET developers Nutrient vs. Aspose.PDF: Complete comparison for .NET developers Redirecting to: https://fortune.com/2026/02/19/openclaw-who-is-peter-steinberger-openai-sam-altman-anthropic-moltbook/ Lufthansa Systems uses Nutrient to deliver reliable, scalable PDF rendering for pilots worldwide Nutrient vs. Syncfusion: Complete comparison for .NET developers React’s useTransition: The hook you’re probably using wrong First City Monument Bank streamlines banking processes with Nutrient Workflow Redirecting to: https://www.sdcexec.com/warehousing/automation/article/22957364/nutrient-workflow-automation-the-missing-link-in-supply-chain-efficiency The complete guide to digital signatures: PAdES, CAdES, and XAdES explained Nutrient Python SDK: Production-grade document processing for Python Introducing agentic document editing for web applications with AI Assistant Nutrient vs. QuestPDF: Complete comparison for .NET developers How we fixed the GdPicture license expiration (and what to do if you’re affected) Red team security testing with agentic AI The future of healthcare document automation Best healthcare workflow software compared Nutrient SDK product updates for Q4 2025 How Harvey scaled legal document workflows 50 percent MoM without rebuilding infrastructure HIPAA-compliant document management in hospitals How we optimized rendering performance while handling thousands of annotations in React — Part 2 Automated PII removal with Nutrient API Redirecting to: https://www.devopsdigest.com/2026-low-code-no-code-predictions Redirecting to: https://www.kmworld.com/Articles/Editorial/ViewPoints/Leaders-predict-AI-to-continue-permeating-all-aspects-of-KM-in-2026-172594.aspx What are deep agents and how do they solve complex problems? Whipping up document magic: Your easy-bake recipe for Vue and Nutrient Web SDK 🧁 What I’ve learned about product iteration planning while building SDKs Passwordless document signing: Three-layer security guide New zip folder functionality streamlines file management in Document Automation Server The keyboard shortcuts playbook: Taking control of keyboard events in Nutrient Web SDK From experienced engineer to AI beginner: My unexpected journey AI-assisted manual testing: Handling Safari’s PDF rendering and UI quirks How to keep a 20-year-old SDK up to date How we optimized rendering performance while handling thousands of annotations in React — Part 1 Nutrient announces new executive hires to accelerate next phase of growth High performance UI using web workers Automate document conversion at scale with Python and Nutrient DCS From curiosity to PLG (and AI): My journey to understanding product-led growth Prost to progress: One year as Nutrient Pigeon usage at Nutrient: Bridging native SDKs to Flutter Modernizing CI build servers: How to migrate from Chef to Ansible Unix man pages: AI-friendly documentation since 1971 Consistent hashing for even load distribution Best AI redaction APIs: Complete comparison guide for 2025 Why AI document redaction matters for modern security From coding to coordinating: How AI transformed my workflow What is intelligent document processing (IDP)? A complete guide Enterprise PDF SDKs: Best PSPDFKit (now Nutrient) alternatives Nutrient SDK product updates for Q3 2025 GdPicture support best practices Redacting sensitive data with Nutrient AI redaction API How AI is transforming the customer experience at Nutrient: From instant answers to intelligent support
Haptic feedback across iPad and iPhone
Douglas Hill · 2025-01-15 · via Inside Nutrient

Haptic feedback enhances the tactile experience for users by providing physical sensations in response to interactions. This can be used alongside visual feedback to create more polished apps. In this post, we’ll explore implementing haptic feedback so it works across both iPhones and iPads — which requires going against Apple’s recommendations.

Apple’s Taptic Engine(opens in a new tab) for haptic feedback has been built into all iPhones since 2015. iPads don’t have this hardware in the device itself, but since 2024, haptic feedback has been available through the Apple Pencil Pro and the trackpad on the Magic Keyboard for iPad Pro (M4). The built-in trackpads on MacBooks and the Bluetooth Apple Magic Trackpad also have haptic feedback hardware.

Our PDF SDK has supported haptic feedback on iPhones when resizing annotations since version 6 in 2016. When an annotation is close to its original aspect ratio or a square aspect ratio, we snap to exactly that aspect ratio, show a dashed line as visual feedback, and use a UIImpactFeedbackGenerator(opens in a new tab) to play haptic feedback.

We wanted to add similar haptic feedback on iPads to support the Apple Pencil Pro and the trackpad on the Magic Keyboard for iPad Pro (M4).

Canvas feedback generator

iOS 17.5 added UICanvasFeedbackGenerator(opens in a new tab). The documentation for this class says:

Use canvas feedback to indicate when a drawing event occurs, such as an object snapping to a guide or ruler.

This sounds perfect for what we’re building, so I thought we could simply change our UIImpactFeedbackGenerator(opens in a new tab) to a UICanvasFeedbackGenerator(opens in a new tab), and then we’d have haptics on the Apple Pencil Pro and trackpad. This was true, but haptic feedback no longer occurred on iPhones. In other words:

  • UICanvasFeedbackGenerator only works with the Pencil and Magic Keyboard on iPads, not on iPhones.
  • UIImpactFeedbackGenerator only works on iPhones. You get no feedback from the Pencil or Magic Keyboard with iPads.

Trust or test?

Further research led me to Apple’s Playing haptic feedback in your app(opens in a new tab) article, which says:

Not all types of haptic feedback play on every type of device. As a general rule, trust the system to determine whether it should play feedback. Don’t check the device type or app state to conditionally trigger feedback.

This is troublingly vague, and because I couldn’t find any documentation specifying exactly which feedback generators were expected to play haptic feedback in which situations, I made a test project to find out by experimentation. Here’s what I found (last tested with Xcode 16.2 and iOS 18.2):

GeneratoriPhonePencilTrackpad dragTrackpad scroll
Canvas alignment
Canvas path completed
Impact
Selection
Notification

Notes:

  • A ✅ means feedback occurred.
  • Pencil refers to the Apple Pencil Pro on iPad Pro (M4).
  • Trackpad refers to the Magic Keyboard for iPad Pro (M4).
  • Trackpad scroll involves two fingers without clicking, detected using UIPanGestureRecognizer.allowedScrollTypesMask.

In my tests, these configurations never generated feedback, although this could be due to issues with the sequence of events in the test app:

  • Apple Pencil Pro hover
  • Trackpad hover on the Magic Keyboard for iPad Pro (M4)
  • Any interaction on a Bluetooth Apple Magic Trackpad connected to an iPad
  • Any interaction on any trackpad when the app ran on a Mac using Mac Catalyst

While the documentation says “Not all types of haptic feedback play on every type of device”, it’s more accurate to say no type of haptic feedback plays on every type of device.

This split creates a frustrating gap: You can’t rely on a single API to deliver haptics across devices. And Apple’s documentation is maddeningly vague about when feedback will actually fire. I can’t say our QA team will be too pleased if the answer to “what’s the expected behaviour?” is “just trust Apple”.

It seems like we’re not supposed to have haptic feedback on iPhones when snapping while resizing shapes. However, our own judgment says that this feedback is nice, and it would be a regression to take away this feature that users have had for years on their iPhones. We decided we want feedback across both iPhones and iPads.

Solution: Device checks (sorry, Apple)

Since Apple’s advice to “trust the system” doesn’t hold up, we took matters into our own hands and used device checks to use UICanvasFeedbackGenerator on iPads and UIImpactFeedbackGenerator on other platforms (although this is only known to do anything on iPhones).

We created a protocol to abstract the API:

@MainActor private protocol CanvasFeedbackGenerating {

func prepare()

func alignmentOccurred(at location: CGPoint)

}

This protocol matches the API of UICanvasFeedbackGenerator, so we can conform to this protocol without additional implementations:

extension UICanvasFeedbackGenerator: CanvasFeedbackGenerating { }

The prepare() method already matches UIImpactFeedbackGenerator, so our protocol conformance just needs to add the other method:

extension UIImpactFeedbackGenerator: CanvasFeedbackGenerating {

func alignmentOccurred(at location: CGPoint) {

impactOccurred(at: location)

}

}

We use a wrapper type, CanvasFeedbackGenerator, which has the same API as UICanvasFeedbackGenerator but internally handles the device checks and forwards to a private object conforming to CanvasFeedbackGenerating:

@MainActor final class CanvasFeedbackGenerator {

private let implementation: any CanvasFeedbackGenerating

init(view: UIView) {

switch UIDevice.current.userInterfaceIdiom {

case .pad:

implementation = UICanvasFeedbackGenerator(view: view)

case .unspecified, .phone, .tv, .carPlay, .mac, .vision:

fallthrough

@unknown default:

implementation = UIImpactFeedbackGenerator(style: .light, view: view)

}

}

func prepare() {

implementation.prepare()

}

func alignmentOccurred(at location: CGPoint) {

implementation.alignmentOccurred(at: location)

}

}

The code above is simplified to assume it compiles only for iOS and runs on iOS 17.5 or later.

In practice, our SDK compiles for iOS, Mac Catalyst, and visionOS. UIFeedbackGenerator and all its subclasses are marked unavailable on visionOS and tvOS. (Given these APIs don’t always do something when they are available, it’s inconvenient that we also have to deal with API unavailability on some platforms; it would’ve been nice if these APIs had been made fully available but did nothing on some platforms.) We’ll make our wrapper handle this detail internally using #if os() compile-time checks.

Additionally, some apps support OS versions earlier than iOS 17.5, so we need #available runtime checks.

The full code for our cross-device canvas feedback generator is below. This should work back to iOS 10 and compile for iOS, Mac Catalyst, visionOS, and tvOS:

@MainActor final class CanvasFeedbackGenerator {

private let implementation: (any CanvasFeedbackGenerating)?

init(view: UIView) {

#if os(iOS)

// The only known cases that generate feedback are `UICanvasFeedbackGenerator` on iPad and `UIImpactFeedbackGenerator` on iPhone.

// Neither of these seem to do anything on Mac (checked with macOS 15.1.1).

if #available(iOS 17.5, *) {

switch UIDevice.current.userInterfaceIdiom {

case .pad:

implementation = UICanvasFeedbackGenerator(view: view)

case .unspecified, .phone, .tv, .carPlay, .mac, .vision:

fallthrough

@unknown default:

implementation = UIImpactFeedbackGenerator(style: .light, view: view)

}

} else {

implementation = UIImpactFeedbackGenerator(style: .light)

}

#else

implementation = nil

#endif

}

func prepare() {

implementation?.prepare()

}

func alignmentOccurred(at location: CGPoint) {

implementation?.alignmentOccurred(at: location)

}

}

@MainActor private protocol CanvasFeedbackGenerating {

func prepare()

func alignmentOccurred(at location: CGPoint)

}

#if os(iOS)

@available(iOS 17.5, *)

extension UICanvasFeedbackGenerator: CanvasFeedbackGenerating { }

extension UIImpactFeedbackGenerator: CanvasFeedbackGenerating {

func alignmentOccurred(at location: CGPoint) {

if #available(iOS 17.5, *) {

impactOccurred(at: location)

} else {

impactOccurred()

}

}

}

#endif

Closing thoughts

With that, we have haptic feedback when snapping occurs while resizing annotations, both on iPhones and on iPads when using the Apple Pencil Pro or the trackpad on the Magic Keyboard for iPad Pro (M4). We shipped this in Nutrient iOS SDK 14.4 and PDF Viewer(opens in a new tab) 2025.1.

As Apple’s frameworks expand across platforms, we’re left to fill in the gaps where consistency falls short. Adding device-specific checks isn’t ideal, but it seems pragmatic and gives users the best tactile experience, whether they’re on an iPhone or iPad.

Encouraging developers to trust the system is a nice idea, but professional engineering should be based on clear documentation rather than vague trust, especially for QA. It would be easy to miss a bug in your own code if you trusted that haptic feedback might play on another device, just not the one you’re using for testing.