                 return
             }
 
-            let offset = scrollView.contentOffset.y - refersherContentInset.bottom
+            let offset = scrollView.contentOffset.y - appropriateContentInset.bottom
             let bottfomOffset = containerHeight + offset - contentHeight
 
             // Starts animation automatically and remember this location to prevent infinite animation

            }

            if scrollView.isDragging {
                if bottfomOffset > 0 && bottfomOffset < viewHeight {
                    let process = bottfomOffset / viewHeight
                    progressAnimating(process)
                }
            } else {
                if bottfomOffset >= viewHeight {


        switch direction {
        case .down:
            let offset = scrollView.contentOffset.y + appropriateContentInset.top
            if !scrollView.isDragging {
                if offset <= -viewHeight {
                    // Enough pulling, action should be triggered
