     }
     
     func adjustInsets() {
-        if var contentInset = self.scrollView?.contentInset {
+        if let contentInset = self.scrollView?.contentInset {
+            var newInsets = contentInset
             if self.isEnabled {
-                contentInset.bottom = self.originalInset.bottom + self.height
-            }
-            self.setContentInset(contentInset)
+                newInsets.bottom = self.originalInset.bottom + self.height
+            }
+//            self.setContentInset(contentInset)
+            if contentInset.bottom != newInsets.bottom {
+                self.scrollView?.removeObserver(self, forKeyPath: "contentInset")
+                self.setContentInset(newInsets)
+                self.scrollView?.addObserver(self, forKeyPath: "contentInset", options: .new, context: nil)
+            }
         }
     }
     

        if !self.isObserving {
            self.scrollView?.addObserver(self, forKeyPath: "contentOffset", options: .new, context: nil)
            self.scrollView?.addObserver(self, forKeyPath: "contentSize", options: .new, context: nil)
            _isObserving = true
            self.adjustInsets()
        }

//        UIView.animate(withDuration: 0.3, delay: 0, options: options, animations: { [weak self] in
        // TODO: Needs testing.
        // Because of animation it gives animation for ScrollView
        
            self.scrollView?.contentInset = contentInset
//            }, completion: nil)
    }
