 
             let newSize = newSizeValue.cgSizeValue
 
-            guard abs(self.size.width - newSize.width) > 0.1 || abs(self.size.height - newSize.height) > 0.1 else {
+            guard abs(size.width - newSize.width) > 0.1 || abs(size.height - newSize.height) > 0.1 else {
                 return
             }
 
-            self.size = newSize
+            size = newSize
 
-            DDLogVerbose("[PullToAction] contentSize:w: \(self.size.width) h:\(self.size.height)")
-            self.delegate?.scrollViewContentSizeDidChange?(self.size)
+            DDLogVerbose("[PullToAction] contentSize:w: \(size.width) h:\(size.height)")
+            delegate?.scrollViewContentSizeDidChange?(size)
         }
 
         if keyPath == "contentInset" {
-            guard let changes = change, let newInsetValue = changes[.newKey] as? NSValue else { return }
-            self.inset = newInsetValue.uiEdgeInsetsValue
-            DDLogVerbose("[PullToAction] inset: top: \(self.inset.top) bottom: \(self.inset.bottom)")
+            guard
+                let changes = change,
+                let newInsetValue = changes[.newKey] as? NSValue else {
+                return
+            }
+
+            inset = newInsetValue.uiEdgeInsetsValue
+            DDLogVerbose("[PullToAction] inset: top: \(inset.top) bottom: \(inset.bottom)")
         }
     }
 

extension PullToActionController: UIScrollViewDelegate {
    open func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
        //TODO: consider content inset
        let topOffset = self.offset.y
        if topOffset < 0.0 {
            DDLogDebug("[PullToAction] End dragging <- \(topOffset)")
            self.delegate?.scrollViewDidEndDraggingOutsideTopBound?(with: topOffset)
            return
        }

        let bottomOffset = self.offset.y + scrollView.bounds.height - self.size.height
        if bottomOffset > 0.0 {
            DDLogDebug("[PullToAction] End dragging -> \(bottomOffset)")
            self.delegate?.scrollViewDidEndDraggingOutsideBottomBound?(with: bottomOffset)
            return
        }
    }


        switch baseLine {
        case .top:
            return Double(offset.y)
        case .bottom:
            return Double(offset.y - max(size.height - scrollView.bounds.height, 0.0))
        case .left:
            return Double(offset.x)
        case .right:
            return Double(offset.x - max(size.width - scrollView.bounds.width, 0.0))
        }
    }
}
