iOS 9中的Taptic [英] Taptic in iOS 9

查看:441
本文介绍了iOS 9中的Taptic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你可以在iOS 9和iPhone 6s中使用taptic引擎吗? WatchOS2和OS X能够使用触觉引擎,所以我认为它也适用于iOS 9,但我找不到任何API。

Can you use the taptic engine in iOS 9 with iPhone 6s? WatchOS2 and OS X have the ability to use the haptic engine, so I assumed it would be in iOS 9 too, but I coudn't find any APIs for it.

推荐答案

是的,我有逆向工程内部 UIKit 的东西,我找到了另一种(更简单的)方法来通过 TapticEngine !我们可以使用 AudioToolbox 框架和几个魔术常量。

Yay, I had reverse engineered internal UIKit stuff and I found another (much simpler) way to actuate feedback via TapticEngine! We can just use AudioToolbox framework and several magic constants.

import AudioToolbox

AudioServicesPlaySystemSound(1519) // Actuate `Peek` feedback (weak boom)
AudioServicesPlaySystemSound(1520) // Actuate `Pop` feedback (strong boom)
AudioServicesPlaySystemSound(1521) // Actuate `Nope` feedback (series of three weak booms)

希望这有帮助!

这篇关于iOS 9中的Taptic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆