I am trying to hide status bar in one of my UIViewControllers (Swift 4).
Firstly, I set View controller-based status bar appearance to
Try checking Hide Status Bar under the General section of your project's settings.