检测iOS8可达性手势 [英] Detect iOS8 Reachability Gesture

查看:146
本文介绍了检测iOS8可达性手势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有哪些方法可以在Objective-C中检测iOS8的新可达性手势?

Any ways to detect the new Reachability gesture of iOS8 in Objective-C?

手势被激活,双击TouchID按钮iPhone6和iPhone6Plus。

The gesture is activated double tapping the TouchID button on the iPhone6 and iPhone6Plus.

推荐答案

没有公共API。

<$ c上的两个相关私有API方法$ c> UIApplication 我可以找到(使用其中任何一个应该从App Store拒绝你的应用程序):

There are two related private API methods on UIApplication I can find (using either of these should get your app rejected from the App Store):


  • _setReachabilitySupported:,可能会启用/禁用可达性(如Spotlight)

  • _deactivateReachability ,它会将视图返回到屏幕上的正常位置

  • _setReachabilitySupported:, which presumably would en/disable reachability (like Spotlight)
  • _deactivateReachability, which would return the view to the normal place on the screen

我什么都看不到通知你的a然而,用户已执行手势的应用程序。

I don't see anything that informs your application that the user has performed the gesture, however.

您还可以尝试子类化 UIWindow 并覆盖 setFrame:。在此方法中设置断点,如果在启用可达性时触发断点,则可以查看堆栈跟踪以获取更多信息。

You could also experiment with subclassing UIWindow and overriding setFrame:. Set a breakpoint in this method, and if it fires when you enable Reachability, you can look at the stack trace for more information.

这篇关于检测iOS8可达性手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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