         addSubview(increaseButton)
         
         // Control events
-        decreaseButton.addTarget(self, action: #selector(decrease(_:)), for: .touchUpInside)
-        increaseButton.addTarget(self, action: #selector(increase(_:)), for: .touchUpInside)
+        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)

    
    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()
    }

    private var rightSeparator = CAShapeLayer()
    
    // Timer used in case that autorepeat is true to change the value continuously.
    private var continuousTimer: Timer? {
        didSet {
            if let timer = oldValue {
                timer.invalidate()
            }
        }
    }

    
    // MARK: Initializers
