How to detect when Camera Control button pressed in iPhone 16

I want to detect when the Hardware Camer control button is pressed/interacted in the iPhone 16

Does Apple provide any API to detect the Hardware Camera control button in iPhone 16?

Hello,

You use AVCaptureEventInteraction to detect when the camera button is pressed: https://developer.apple.com/documentation/AVKit/AVCaptureEventInteraction

And this guide shows how to work with camera controls: https://developer.apple.com/documentation/avfoundation/capture_setup/enhancing_your_app_experience_with_the_camera_control

Hello @Sahabe, the sessionControlsDidBecomeActive(_:) delegate method from AVCaptureSessionControlsDelegate tells you when the Camera Control becomes active.

How to detect when Camera Control button pressed in iPhone 16
 
 
Q