79111034

Date: 2024-10-21 16:59:39
Score: 1.5
Natty:
Report link

Could you use NotificationCenter observers? https://developer.apple.com/documentation/foundation/notificationcenter/1415360-addobserver



let audioSession = AVAudioSession.sharedInstance()

NotificationCenter.default.addObserver(self, selector: #selector(handleVolumeChange(_:)), name: AVAudioSession.volumeChangedNotificationName, object: nil)


Then handle your logic to pop-up the alert for changing volume in another function handleVolumeChange

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Anonymous