且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检测音量按钮按下并释放iOS

更新时间:2023-11-18 12:04:10

查看 http://fredandrandall.com/ blog / 2011/11/18 / take-control-of-the-volume-buttons-on-ios-like-camera /

以初始化音频会话,使其活动,然后监听改变。最后你启动一个回调。

Essentially you have to initialize an audio session, make it active, and then listen for changes. Finally you initiate a callback.

但是,要小心你的硬件命令的实现。无意中滥用可以让您从应用商店禁止。

However, be careful with your implementations of hardware commands. Unintentional misuse can get you banned from the app store.