Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to switch on all iphone 7 LEDs in swift/objective c

Similar question to this one but for the iPhone 7.

The iPhone 7 has 2 amber LEDs and 2 white LEDs. When you turn on the torch only 1 of the LEDs turns on. The amber ones turn on intermittently when using the camera in my app (I seem to have no control over this).

So I have 2 questions really:

  1. Can I switch on both white LEDs on demand in Swift?
  2. Is there a way to ensure the amber ones never switch on?

EDIT

I have already checked AVCaptureDevice and related (whatever is documented), so hoping someone there is someone who has looked under the bonnet and perhaps found another way.

like image 207
Manish Patel Avatar asked Feb 07 '17 14:02

Manish Patel


1 Answers

There is no public API method that allows for controlling the exact LED operation on an iPhone. There is only a flashMode property available for AVCaptureDevice, with three possible values: on, off, and auto.

like image 127
Nick Toumpelis Avatar answered Nov 12 '22 04:11

Nick Toumpelis