Short answer: You can’t.
- There is no public API to read the ring/silent switch state or to be notified when it changes. Apple explicitly does not expose this (see Apple QA1692 “Detecting the Ringer/Silent Switch and Volume Buttons”).
- No AVAudioSession property, notification, or route-change event reflects the ring/silent switch. Interruption, route, and secondary-audio hints are unrelated.
- Private options (AVSystemController, GraphicsServices/GSEvent, Celestial, etc.) are not permitted for App Store apps and are not reliable across iOS versions. Relying on them is grounds for rejection.
What you can do
- Keep using an audio session category that respects the switch (e.g., AVAudioSessionCategorySoloAmbient). That’s the supported approach.
- If you want to show a “muted” UI, do it based on your own playback policy rather than the switch. Many apps (e.g., social video feeds) default videos to muted and show an overlay until the user explicitly unmutes. They are not detecting the switch; they’re controlling their own mute state.
- Note that even if you could detect the switch, it wouldn’t be a reliable indicator of audibility: headphones, Bluetooth or AirPlay, and certain categories (e.g., Playback) change behavior.
Bottom line: There is no supported, event-based way to detect the ring/silent switch position or changes. Design your UI around your app’s own audio state and user intent, not the hardware switch.