FUIStatusBarStyleHelper

@available(*, deprecated, message: "No longer supported.")
public struct FUIStatusBarStyleHelper

This FUIStatusBarStyleHelper is to help the application developer set the status bar style on iOS devices. This is needed since iOS does not provide an API to directly manipulate the status bar style and some of the SAPFiori UI components need to have specific status bar style. The statusBarStyle of FUIStatusBarStyleHelper will be set by the SAPFiori UI components that need to have the specific style. Before iOS 13.4, applications could override UINavigationController‘s preferredStatusBarStyle property similar to the code below to apply the status bar style to the application.

extension UINavigationController {
    open override var preferredStatusBarStyle: UIStatusBarStyle {
        if let statusBarStyle = FUIStatusBarStyleHelper.statusBarStyle {
            return statusBarStyle
        }
        return navigationBar.barStyle == .default ? .lightContent : .darkContent
    }
}

However, beginning with iOS 13.4 the above code in UINavigationController extention is not invoked. Instead, SAPFiori provides an FUINavgationController that overrides the preferredStatusBarStyle property using the above code above. The application should then use FUINavigationController in its main interface in order to have the status bar style match the statusBarStyle property in FUIStatusBarStyleHelper. This solution works for both the iOS 13 before and after 13.4.

  • The desired status bar style to be applied. The default is nil, no specified bar style for the SAPFiori component.

    Declaration

    Swift

    @available(*, deprecated, message: "No longer supported.")
    public static var statusBarStyle: UIStatusBarStyle?