     
     func stopContinuous(_ sender: UIButton) {
         // When dragged outside, stop the timer.
-        continuousTimer?.invalidate()
+        continuousTimer = nil
     }
     
     func increaseValue() {

    
    internal func decrease(_ sender: UIButton) {
        sender.backgroundColor = UIColor(white: 1.0, alpha: 0.0)
        continuousTimer?.invalidate()
        continuousTimer = nil
        decreaseValue()
    }
    
    internal func increase(_ sender: UIButton) {
        sender.backgroundColor = UIColor(white: 1.0, alpha: 0.0)
        continuousTimer?.invalidate()
        continuousTimer = nil
        increaseValue()
    }

        addSubview(increaseButton)
        
        // Control events
        decreaseButton.addTarget(self, action: #selector(decrease(_:)), for: [.touchUpInside, .touchCancel])
        increaseButton.addTarget(self, action: #selector(increase(_:)), for: [.touchUpInside, .touchCancel])
        increaseButton.addTarget(self, action: #selector(stopContinuous(_:)), for: .touchUpOutside)
        decreaseButton.addTarget(self, action: #selector(stopContinuous(_:)), for: .touchUpOutside)
        decreaseButton.addTarget(self, action: #selector(selected(_:)), for: .touchDown)
