                                               attribute: NSLayoutAttribute.centerY,
                                               multiplier: 1,
                                               constant: 0))
-        
-        
-    }
-    
+
+    }
+
     override open func layoutSubviews() {
         calculateElementSizes()
         super.layoutSubviews()
         self.bringSubview(toFront: movingView!)
     }
-    
+
     // MARK: - Tracking user actions
-    
-    override open func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool
-    {
+
+    override open func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool {
         let val = touch.location(in: movingView)
-        
+
         if dot1Layer?.frame.contains(val) == true {
             selectedLayer = dot1Layer
-        }
-        else if dot2Layer?.frame.contains(val) == true {
+        } else if dot2Layer?.frame.contains(val) == true {
             selectedLayer = dot2Layer
-        }
-        else {
+        } else {
             selectedLayer = nil
         }
-        
+
         return selectedLayer != nil
     }
-    
+
     override open func endTracking(_ touch: UITouch?, with event: UIEvent?) {
-        
-    }
-    
-    override open func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool
-    {
+
+    }
+
+    override open func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool {
         if selectedLayer != nil {
             let val = touch.location(in: self)
             getViewAngle(val)

                                              attribute: NSLayoutAttribute.width,
                                              multiplier: 1,
                                              constant: 0))
        
        self.addConstraint(NSLayoutConstraint(item: movingView!,
                                              attribute: NSLayoutAttribute.height,
                                              relatedBy: NSLayoutRelation.equal,


@IBDesignable
open class FRCircleSlider: UIControl {

    @IBInspectable let selectedColor = UIColor.blue
    @IBInspectable let dotColor = UIColor.red
    @IBInspectable let connectorColor = UIColor.yellow
    @IBInspectable let textFont = UIFont.systemFont(ofSize: 12)

    var circleRadius: CGFloat = 250
    var lineWidth: CGFloat = 1
    var circleWidth: CGFloat = 3
    var connectorWidth: CGFloat = 10
    var lineHeight: CGFloat = 10
    let arcRadius: CGFloat = 30

    var value1: CGFloat = 0.1 {
        willSet(value) {
            if(value != value1) {
                getViewAngleFromValue(value)
