Change the StatusBar textColor in swift and Objective c iOS

Solution:
Swift:
override var preferredStatusBarStyle: UIStatusBarStyle {
    return .lightContent
}
The above code will be used to display the lightcontent in the statusBar.

Objective C:

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;

}

Before implement that above method do the below steps

In info.plist file set the variable UIViewControllerBasedStatusBarAppearance value to YES.

In View Didload add the below code

[self setNeedsStatusBarAppearanceUpdate];

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift