title: Adjust the main screen brightness using Swift
body: <p>I would like to adjust the iPhone's main screen brightness in code using Swift.</p>
  
  <p>I know in Objective-C it can be done by: </p>
  
  <pre><code>[[UIScreen mainScreen] setBrightness:0.5];
  </code></pre>
  
  <p>How do I do this in Swift?</p>