                     scrollWithDelta(delta)
                 }
 
-                if headerTopOffset == -headerFrame.height {
+                if headerTopOffset == -headerFrame.height - UIApplication.sharedApplication().statusBarFrame.height {
                     toolbarState = .Collapsed
                 } else if headerTopOffset == 0 {
                     toolbarState = .Visible

        }

        var updatedOffset = headerTopOffset - delta
        headerTopOffset = clamp(updatedOffset, min: -headerFrame.height, max: 0)
        if isHeaderDisplayedForGivenOffset(updatedOffset) {
            scrollView?.contentOffset = CGPoint(x: contentOffset.x, y: contentOffset.y - delta)
        }

    }

    func isHeaderDisplayedForGivenOffset(offset: CGFloat) -> Bool {
        return offset > -headerFrame.height - UIApplication.sharedApplication().statusBarFrame.height && offset < 0
    }

    func clamp(y: CGFloat, min: CGFloat, max: CGFloat) -> CGFloat {
