如何在iOS中获得触控尺寸? [英] How to get touch size in iOS?

查看:121
本文介绍了如何在iOS中获得触控尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,此回复明确指出,如果没有私人函数调用,这是不可能的。因此,根据Apple的条款,这种方法不能在App Store应用程序上使用。

I understand that this response clearly states that this is not possible without a private function call. Therefore, according to Apple's terms, this approach cannot be used on an App Store app.

但是,某些应用程序似乎已经使用此函数调用:

However, some apps already seem to use this function call:


  • 倒数第二个实际手掌拒绝,没有预定义的拒绝区域,如Note Taker HD

  • Virtuoso的压力敏感度,他们称之为TrueVelocity 2

  • GarageBand也用于压力敏感度

  • Penultimate for actual palm rejection without a predefined rejection area like in Note Taker HD
  • Virtuoso for pressure sensitivity, which they call "TrueVelocity 2"
  • GarageBand also for pressure sensitivity

显然,尽管有Apple的限制,这种方法已经广泛应用于App Store应用程序。

Clearly, this approach is already widely used in App Store apps despite Apple's restrictions.

tl; dr iOS上用于获取触摸尺寸的私有函数调用是什么?

tl;dr What is the private function call on iOS to get touch size?

推荐答案

尺寸和压力是两种不同的动物。倒数第二个最有可能测试某个区域的大量触摸(毕竟手掌有很大的面积,产生大量的触摸)。

Size and pressure are two different animals. Penultimate most likely tests for a large amount of touches in a certain area (palms have a large area after all, generate tons of touches).

触摸尺寸不存在。当手指接触屏幕时会生成IOS触摸事件。操作系统然后从触摸中获取一个中心点,这就是你得到的。它不是CGRect,它是CGPoint。

Touch "size" does not exist. IOS touch events are generated when a finger contacts the screen. The OS then takes a center point from the touch and that's what you get. It's not a CGRect, it's a CGPoint.

虽然压力更容易。请参阅此处获取解决方法:使用加速度计检测压力强度

Pressure is 'easier' though. see here for a workaround: Tap pressure strength detection using accelerometer

虽然我看到你在私有API的市场上,但github会托管一些类转储: http://github.com/kennytm/iphone-private-frameworks https://github.com/nst/iOS-Runtime-Headers

And while I see you're in the market for private API's, github hosts a number of class dumps: http://github.com/kennytm/iphone-private-frameworks and https://github.com/nst/iOS-Runtime-Headers

这篇关于如何在iOS中获得触控尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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