   }
 
   private func restoreContentOffset(_ delta: CGFloat) {
-    if navigationBar.isTranslucent || delta == 0 {
+    if isTopViewControllerExtendsUnderNavigationBar || delta == 0 {
       return
     }
 

  private func shouldScrollWithDelta(_ delta: CGFloat) -> Bool {
    let scrollDelta = delta
    // Do not hide too early
    if contentOffset.y < ((navigationBar.isTranslucent ? -fullNavbarHeight : 0) + scrollDelta) {
      return false
    }
    // Check for rubberbanding

    frame.origin = CGPoint(x: frame.origin.x, y: frame.origin.y - delta)
    navigationBar.frame = frame

    // Resize the view if it does not extend under navigation bar
    if !isTopViewControllerExtendsUnderNavigationBar {
      let navBarY = navigationBar.frame.origin.y + navigationBar.frame.size.height
      frame = topViewController.view.frame
      frame.origin = CGPoint(x: frame.origin.x, y: navBarY)
