I have a TableViewController and in it I created a UIView programatically that is the width and height of the status bar and has a colored background. Basically, it serves as the status bar's background:
let statusBarBG = UIView(frame: CGRectMake(0, 0, widthOfScreen, 20))
statusBarBG.backgroundColor = UIColor...
self.view.addSubView(statusBarBG)
However, when I drag the table up and down this status bar background moves with the entire table view, as seen in the following image (on the left is how it looks normally, the bigger section of red is my nav bar's bg):

So my question is: how do I create a view inside this tableViewController that is more like a sibling to the tableView rather than a child that moves with it? Thanks.



