【问题标题】:How to recognize remote control hold?如何识别遥控器保持?
【发布时间】:2015-09-03 01:17:33
【问题描述】:

有没有办法识别何时按住 Apple Earphone Remote Control 按钮,而不是启动语音控制?我的意思是,禁用语音控制并在长按按钮时执行其他操作?

我知道How to receive single tap and hold Remote-Control Event with iOS?已经有人问过了,但是这个答案并没有解决我的问题。

【问题讨论】:

    标签: ios swift remote-control


    【解决方案1】:

    根据UIEventSubtype下的UIEventType,您将从Earbuds获得这4个事件

    UIEventSubtypeRemoteControlTogglePlayPause
    UIEventSubtypeRemoteControlPlay
    UIEventSubtypeRemoteControlPause
    UIEventSubtypeRemoteControlStop
    

    没有定义任何与长按按钮相关的子事件。

    【讨论】:

    • 是的,我已经看到了。但我想知道是否有另一种方法来检测它。甚至使用 Apple 的私有 API。
    猜你喜欢
    • 2019-08-11
    • 1970-01-01
    • 2010-12-07
    • 1970-01-01
    • 1970-01-01
    • 2016-02-06
    • 2020-08-19
    • 2015-07-18
    • 2014-01-25
    相关资源
    最近更新 更多