title: Changing iPhone 11 torch/flashlight brightness with Swift does not seem to work properly
body: <p>I'm trying to make an iOS app where I can turn the torch on and change the brightness.</p>
  
  <p>I'm testing it on iPhone 11 with iOS 13.3.1 and Xcode 11.3.1</p>
  
  <p>I used one of the solutions here: <a href="https://stackoverflow.com/questions/27207278/how-to-turn-flashlight-on-and-off-in-swift">How to turn flashlight ON and OFF in swift?</a></p>
  
  <p>Everything works perfectly if I use: </p>
  
  <p><code>try self.device.setTorchModeOn(level: AVCaptureDevice.maxAvailableTorchLevel)</code></p>
  
  <p>I can turn it on and off freely.</p>
  
  <p>but if I try to change the brightness like this (using <code>var someFloat: Float</code> from 0.1 to 1): </p>
  
  <p><code>try self.device.setTorchModeOn(level: someFloat)</code></p>
  
  <p>everything goes haywire. The brightness dims, but then dims too much. Then, even if I use <code>AVCaptureDevice.maxAvailableTorchLevel</code>, it stays extremely dim. And the only way to restore it is to restart my iPhone. Then it's bright again until I try to mess with the level.</p>
  
  <p>Anyone seen this?</p>