     
     override init(frame frameRect: NSRect) {
         super.init(frame: frameRect)
-        self.wantsLayer = true
+        self.setup()
     }
 
     required public init?(coder: NSCoder) {
         super.init(coder: coder)
+        self.setup()
+    }
+    
+    func setup() {
         self.wantsLayer = true
+        
     }
     
     override open func viewWillMove(toWindow newWindow: NSWindow?) {

    }
    
    var manualScroll = false
//    @discardableResult open func scrollRectToVisible(_ aRect: NSRect, animated: Bool) -> Bool {
//        manualScroll = true
//        self.shouldAnimateOriginChange = animated
//        return super.scrollToVisible(aRect)
//    }
    
    @discardableResult open func scrollRectToVisible(_ rect: CGRect, animated: Bool, completion: AnimationCompletion? = nil) -> Bool {
        
        manualScroll = true
        shouldAnimateOriginChange = animated
        if animated == false {
            

            // super's implementation handle a normal scroll.
            
            super.scroll(to: newOrigin)
            // Can't remember why this is here, it may be to cleanup if needed
            if !manualScroll {
                self.endScrolling()
            }
        }
    }
    
