2
私の好みは、画面とあなたがコールを取得するときに、電話の着信音を消音している場合に類似ホーム/ボリューム/リンガーボタンe.t.c、上の任意の場所になります。
私は現在、このコードは、のために設定しているUIAlertController
let timerFinished = UIAlertController(title: "Timer Up", message: nil, preferredStyle: UIAlertControllerStyle.alert)
timerFinished.addAction(UIAlertAction(title: "OK", style: .cancel, handler: { (action: UIAlertAction!) in
}))
present(timerFinished, animated: true, completion: nil)
timerFinished.view.superview?.isUserInteractionEnabled = true timerFinished.view.superview?.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.alertClose)))
と
本質的にはそう@objc func alertClose(gesture: UITapGestureRecognizer) {
self.dismiss(animated: true, completion: nil)
}.
、私の質問は以下のとおりです。
1)物理的なボタンを使用することが可能ですシステムサウンドを無効にするアクションを実行するには? - もしそうなら、どのように?アクションが実行されると
2)どのようにセットアップ何かがシステムを無効にするでしょうが聞こえますか? IF(alertClose()、OKボタンと物理デバイスのボタンのアクションに
playSystemSound = false
:
while playSystemSound == true {
AudioServicesPlaySystemSound(SystemSoundID(THIS IS WHERE ID WOULD GO))
}
とのコードを実行します - あなたが何かを言うwhileループを設定するだろう可能)。これが答えではないよう
これは聞き取りたいものではありませんが、私はあなたができるとは思いません:https://stackoverflow.com/questions/7643942/is-it-possible-to-use-iphones-volume-control-buttonsいくつかの-他の目的--for – BHendricks
[OK]をもあなたにそれは私には不可能であることを知っている多くの時間を節約んので、私に告げるためBHendricksに感謝。 –