I think all the answers do not really point the problem because all of them work in specific scenarios. But if you need to cover all the cases follow the points bellow:
Depending on where you need the status bar light style you should always have in mind these 3 points:
**1)If you need the status bar at the launch screen or in other places, where you can't control it (not in view controllers, but rather some system controlled elements/moments like Launch Screen)**
You go to your project settings
[![Project settings][1]][1]
**2) if you have a controller inside a navigation controller**
You can change it in the interface builder as follows:
a) Select the navigation bar of your navigation controller
[![Select the navigation bar of your navigation controller][2]][2]
b) Then set the style of the navigation bar to "Black", because this means you'll have a "black" -> dark background under your status bar, so it will set the status bar to white
[![enter image description here][3]][3]
Or do it in code as follows
navigationController?.navigationBar.barStyle = UIBarStyle.Black
**3) If you have the controller alone that needs to have it's own status bar style and it's not embedded in some container structure as a UINavigationController**
Set the status bar style in code for the controller:
[![Setting the status bar style in code][4]][4]
[1]:
[2]:
[3]:
[4]: