【发布时间】:2021-09-15 20:37:40
【问题描述】:
我使用以下代码来检测用户更改的系统音量。
NotificationCenter.default.addObserver(self, selector: #selector(volumeChanged), name: NSNotification.Name(rawValue: "AVSystemController_SystemVolumeDidChangeNotification"), object: nil)
当我更新到 iOS 15 时,我发现这段代码不起作用,但对于任何以前的 iOS 版本它都可以。
我也使用了addObserver 函数,但没关系。
这是 iOS 15 的错误吗?如果是,我该怎么做才能修复它。
谢谢:)
【问题讨论】: