Search code examples
swiftcamerastatusbar

Swift - Status Bar (Battery) show on camera


I have a popover and inside that popover is a camera button, I have got the camera working perfectly but at the top the battery symbol overlaps the camera, heres a screenshot below.

If anyone knows the answer, it would be appreciated.

enter image description here


Solution

  • You can hide the status bar for that view so it won't overlap the camera button and look kind of ugly. You can use this code:

    override func prefersStatusBarHidden() -> Bool {
        return true
    }
    

    Hope it helps :D