       if gesture.state == .Began {
         scrollState = .None
         lastContentOffsetY = contentOffsetY
+        gestureIsActive = true
         return
       }
       

      // move the navbar
      self.frame = newFrame
      
      // move the scrollviews parent view by the offset...check to make sure we have a scrollView first
      if let myScrollView = self.scrollView {
        var parentViewFrame = myScrollView.superview?.frame
        parentViewFrame?.origin.y += offsetY
        parentViewFrame?.size.height -= offsetY
        myScrollView.superview?.frame = parentViewFrame!
      }
      
    }
    
    // Animate the moveFrame() changes if desired, otherwise just execute them

      moveFrame()
    }

  }
  
  func setContentInset() {
    if scrollView == nil {
      return
    }
    
    // what is this for?
    if scrollView!.contentInset.top == 0 && scrollView!.contentOffset.y == 0 {
      return
    }
    
    var insets = scrollView!.contentInset
    insets.top = frame.origin.y + frame.size.height
    scrollView!.contentInset = insets
    
    let isAtTop = !gestureIsActive && scrollView!.contentOffset.y <= 0
    if isAtTop && scrollView!.contentOffset.y != scrollView!.contentInset.top {
      let newContentOffset = CGPointMake(scrollView!.contentOffset.x, -scrollView!.contentInset.top)
      scrollView!.setContentOffset(newContentOffset, animated: false)
    }
  }
  
  func statusBarHeight() -> CGFloat {
