FUIStatusBarStyleHelper
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 which need to have the specific style. Application should
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 ? .default : .lightContent
}
}
-
The desired status bar style to be applied. The default is nil, no specified bar style for the SAPFiori component.
Declaration
Swift
public static var statusBarStyle: UIStatusBarStyle? { get set }