Question: I added a scroll view to my view which is hover the status bar (I hid it). The scroll view is working fine, but when I'm scrolling to the top, I have a white space which disappears when I tap on my screen, and appears again when I scroll down then top. 

I noticed that the scroll bar is not going to the top of my view, but stopped at the status bar.

Here are screenshots which show you what I mean.

Here I'm at the top of my view but the scroll bar isn't:

![](https://i.stack.imgur.com/mzYPm.png)

Here is the same view with the white status bar which appears when I scroll top again:

![](https://i.stack.imgur.com/w5fm5.png)

It disappear when I tap on my screen or scroll down.

Here are my constraints:

[![constraints](https://i.stack.imgur.com/yDhn8.png)](https://i.stack.imgur.com/yDhn8.png)

I think it's a problem of Layout Margin or something like that, but I don't what I should change?

I hide the status bar like that in my view controller:

```
override func viewWillAppear(_ animated: Bool) {
    UIApplication.shared.keyWindow?.windowLevel = UIWindowLevelStatusBar

    super.viewWillAppear(animated)
}

```

**EDIT:** Even if I comment the line which hides the status bar, I still have the same problem with my scroll view. So the problem doesn't come from how I hide it.

Answer: 
As [Sam](https://stackoverflow.com/users/3585958/sam) said, I changed the `content insets` to "Never" on the scroll view and it works.
While unrelated to your question, I have to react to the way you hide the status bar - the proper way is to override `prefersStatusBarHidden` in your view controller and call `self.setNeedsStatusBarAppearanceUpdate()` in your `viewWillAppear`:

```
override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    self.setNeedsStatusBarAppearanceUpdate()
}

override var prefersStatusBarHidden: Bool {
    return true
}

```

**UPDATE**

Since your view controller is inside of a `UINavigationViewController`, you need to override `childViewControllerForStatusBarHidden` in `UINavigationViewController` to use `visibleViewController` as the controller to determine status bar hidden (I added override to `childViewControllerForStatusBarStyle` for the consistence):

```
extension UINavigationController {
    open override var childViewControllerForStatusBarStyle: UIViewController? {
        return visibleViewController
    }

    open override var childViewControllerForStatusBarHidden: UIViewController? {
        return visibleViewController
    }
}

```