I know there have been some questions posted about this, but none have helped me with my specific issue. I would like to display a custom modal above the entire screen, but I would like to keep the Apple status bar visible. For the modal, I am using one UIView
for the dimming effect and another for the actual view that the user would interact with. The entire modal is then added as a subview to the current view and brought to the front. Essentially, I am trying to replicate the behavior of the UIAlertView, except with a custom view. Here is some of my code:
var modalView:UIView = UIView(frame: self.view.window!.bounds)
modalView.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.66)
modalView.addSubview(customView)
self.view.window!.addSubview(modalView)
modalView.window!.windowLevel = UIWindowLevelStatusBar + 1
self.bringSubviewToFront(modalView)
Above, customView
is the UIView
that the user interacts with.
This works great, but for some reason, the text on the Apple status bar just simply disappears even though the style of the status bar is set to LightContent. As can be seen in the code, I do not touch the status bar.
I am trying to get the text on the status bar to dim just like the rest of the screen and am currently stuck. Does anyone have any insight on how I can get the desired behavior?
Any help would be greatly appreciated!