         thumbView.roundCornersToFormCircle()
     }
     
+    // MARK: - Working with slider value
+    
+    func updateValue() {
+        let endConstant = backgroundView.superview!.bounds.width - (5 + 5 + thumbView.frame.width)
+        let currentValue = max(0.0, min(1.0, Double(backgroundLeadingConstraint.constant / endConstant)))
+        
+        if value != currentValue {
+            value = currentValue
+            sendActionsForControlEvents([.ValueChanged])
+        }
+    }
+    
+    func updatePowerOffLabel() {
+        // Hide the power off label when the slider is panned
+        let desiredPowerOffLabelAlpha: CGFloat = (value == 0) ? 1.0 : 0.0
+        if self.informationalLabel.alpha != desiredPowerOffLabelAlpha {
+            UIView.animateWithDuration(0.10, animations: {
+                self.informationalLabel.alpha = desiredPowerOffLabelAlpha
+                self.backgroundInformationalLabel.alpha = desiredPowerOffLabelAlpha
+            })
+        }
+    }
+    
     // MARK: - Gesture Handling
     
     func thumbViewWasPanned(recognizer: UIPanGestureRecognizer) {
-        // Note that slider is prevented from sliding past its end by making the
-        // backgroundLeadingConstraint priority lower in the xib 
-
-        let updatePowerOffLabel: () -> () = {
-            // Hide the power off label when the slider is panned
-            let desiredPowerOffLabelAlpha: CGFloat = (self.backgroundLeadingConstraint.constant == 0) ? 1.0 : 0.0
-            if self.informationalLabel.alpha != desiredPowerOffLabelAlpha {
-                UIView.animateWithDuration(0.10, animations: {
-                    self.informationalLabel.alpha = desiredPowerOffLabelAlpha
-                    self.backgroundInformationalLabel.alpha = desiredPowerOffLabelAlpha
-                })
-            }
-        }
-        
         switch recognizer.state {
         case .Possible, .Began:
             break

    @IBOutlet private(set) weak var backgroundInformationalLabel: UILabel!
    @IBOutlet private weak var backgroundLeadingConstraint: NSLayoutConstraint!

    @IBInspectable var thumbViewImage: UIImage? {
        get { return thumbView.image }
        set { thumbView.image = newValue }

import UIKit

@IBDesignable
public class ThumbSliderView: UIControl {
    
    @IBOutlet private(set) weak var backgroundView: UIView!
    @IBOutlet private(set) weak var thumbView: UIImageView!
