             animateViewBackToOrigin()
         }
     }
+    ///Computed var returning the optional first TimerSetting in the list.
+    var firstTimerSetting: TimerSetting? {
+        return timerSettings.first
+    }
     ///Set to the original incremental value
     fileprivate func setDefaultIntervalSetting() {
         incrementalValue = timerSettings[0].increment
     }
-    /**
-        Sets the timer with the interval
-        - parameters:
-          - interval: The double interval for executing the timer
-     */
+
+    ///Sets the timer with the interval
+    /// - Parameter interval: The double interval for executing the timer
     fileprivate func addTimer(_ interval: Double) {
         timer = Timer.scheduledTimer(timeInterval: interval,
                                      target: self,


    ///Called when the view moves (dragged by the user)
    @objc func panned(_ sender: UIPanGestureRecognizer) {
        if sender.state == .began {
            delegate?.barcelonetaDidStartMoving(self)
            //The first set of the timer
            addTimer(timerSettings[0].timer)
            timerHasBeenCalledAtLeastOnce = false
        }

        let translation = self.axis == .vertical ? sender.translation(in: self).y : sender.translation(in: self).x
        //If ! movesUp, consider that the view moves down
        movesUp = self.axis == .vertical ? (translation < 0) : (translation > 0)
        //If the view is dragged beyond the draggingLimit (Up or down)
        //too low
        if translation > draggingLimit {
            moveConstraint.constant = originalConstant + logConstraintValueForYPosition(translation)
        } else if translation < (draggingLimit * -1.0) {
            moveConstraint.constant = originalConstant + ((logConstraintValueForYPosition(translation * -1)) * -1)
        } else {
            moveConstraint.constant = originalConstant + translation
        }

        let prct = Int(100.0 / (draggingLimit/moveConstraint.constant))
        percentage = prct < 0 ? prct * -1 : prct

        //Find a timer setting matching the percentage
        if let timerSetting = timerSettings.filter({return $0.range ~= percentage}).first {

    fileprivate var originalConstant: CGFloat = 0.0
    fileprivate var movesUp = true
    fileprivate var currentTimerSetting: TimerSetting! = nil

    ///Initializes the gesture
    /// - Parameter constraint: The constraint attached to the Barceloneta view
    /// - Parameter axis: The axis : .horizontal or .vertical
    /// - Parameter delegate: The object receiving events for the view
    public func makeElastic(withConstraint constraint: NSLayoutConstraint,
                            onAxis axis: Axis,
                            andDelegate delegate: BarcelonetaDelegate) {
