0
votes

So I know that in my ViewController.m I can override my

-(UIStatusBarStyle) preferredStatusBarStyle

method to change the return of the preferredStatusBarStyle. But here's the thing: I have a property

@property UIStatusBarStyle *customPreferredStatusBarStyle

and I'm changing the value of customPreferredStatusBarStyle in this bridge block:

[_bridge registerHandler:@"setStatusBarHandler_iOS" handler:^(id data, WVJBResponseCallback responseCallback) {
_customPreferredStatusBarStyle = UIStatusBarStyleDefault;
}]

which means if the website calls the bridge I'll change its value. But I found out that **-(UIStatusBarStyle) preferredStatusBarStyle** method only gets called once when the ViewController is initiated.

Is there any way for me to change my status bar style after the the bridge gets called?

2

2 Answers

4
votes

Just call:

Obj-C

[self setNeedsStatusBarAppearanceUpdate];

Swift

setNeedsStatusBarAppearanceUpdate()
1
votes

In your case I think you can call setNeedsStatusBarAppearanceUpdate() to trigger an update to status bar update.