8

What code do I use to determine if the users iPhone ringer is on or off?

The app I am making, plays music in the background, if the iphone ringer switch is turned off, then I want the music to stop playing.

My question is similar to this, but I want an answer in swift and IOS8...

Detect silent mode in iOS 7

Code:

if iphoneRinger == On {
  self.playmusic()
}
else {
  self.stopmusic()
}
Community
  • 1
  • 1
nachshon fertel
  • 121
  • 1
  • 6

0 Answers0