问题描述
我正在尝试播放触觉反馈,系统报告它受支持。断点被击中,但设备不振动。静音开关关闭。设备是 iPhone 12,运行 AVCapture 会话。我有类似的代码在 iPhoneX 上成功播放触觉
与相机交互是否会禁用触觉反馈?
UINotificationFeedbackGenerator 不播放触觉是否有其他原因?
import CoreHaptics
let generator = UINotificationFeedbackGenerator()
dispatchQueue.main.async {
if CHHapticEngine.capabilitiesForHardware().supportsHaptics {
generator.prepare()
generator.notificationOccurred(.success)
} else {
print("Haptics not supported")
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)