In your Info.plist you need to define View controller-based status bar appearance to any value.
enter image description here
If you define it YES then you should override preferredStatusBarStyle function in each view controller.
If you define it NO then you can set style in AppDelegate using
NSLog("设置顶部状态栏的状态")
UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false)