     open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
         
         if let viewController = object as? UIViewController {
-            if keyPath == "title" {
+            if keyPath == #keyPath(UIViewController.title) {
                 if let index = viewControllers.index(of: viewController) {
                     pageSegmentedControl.setTitle(viewController.title, forSegmentAt: index)
+                }
+            }
+        }
+        else if let scrollView = object as? UIScrollView {
+            if scrollView == pageScrollView {
+                if keyPath == #keyPath(UIScrollView.delegate) {
+                    fatalError("Cannot set delegate of pageScrollView to different object than DTPagerController that owns it.")
                 }
             }
         }

            viewController.removeObserver(self, forKeyPath: #keyPath(title))
        }
    }
}


    
    /// Page scroll view
    /// This should not be exposed. Changing behavior of pageScrollView will destroy functionality of DTPagerController
    public private(set) lazy var pageScrollView : UIScrollView = {
        let pageScrollView = UIScrollView()
        pageScrollView.autoresizingMask = [UIViewAutoresizing.flexibleWidth, UIViewAutoresizing.flexibleHeight]
        pageScrollView.showsHorizontalScrollIndicator = false
