In your Info.plist add the following attribute:
View controller-based status bar appearance
and set its value to
NO
as described in the image below:
In your AppDelegate.swift file, in didFinishLaunchingWithOptions
method, add this code:
UIApplication.shared.statusBarStyle = .lightContent
or
UIApplication.shared.statusBarStyle = .default
Follow the first step from the SWIFT Section. Then add this code to the AppDelegate.m file:
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
or