I am adding a transparent look to my statusbar using the following piece of code in my AppDelegate.swift
:
statusBar = UIView(frame: CGRectMake(0, 0, self.window!.frame.width, 20))
statusBar!.backgroundColor = someTransparentColor // customized UIColor
self.window!.rootViewController!.view.addSubview(statusBar!)
This is the structure of my app:
X Y
| |
NC NC
| |
NC -> A -> B -> C (NC = Navigation Controller)
The above code works fine for views A, B, C; but does not apply to X and Y (This is because I added the statusBar subview to the rootViewController). What is it that I can do to make it applicable to X and Y as well? Of course I can copy that code in each respective view controller, but I wan't to avoid that!
Note: I have X and Y use Separate Navigation Controllers, as I am presenting them Modally, and the NCs make it easy to add a Navigation Bar/ToolBar, especially because they are UITableViewControllers
with static tables.