             return
         }
         isTracking = false
-
+        
         thumbSignView1.layer.timeOffset = animationDuration
         thumbSignView2.layer.timeOffset = animationDuration
         backgroundView.layer.timeOffset = animationDuration
     }
-
+    
     private func setupSignViews() {
         thumbSignView1 = createThumbSignView()
-        thumbSignView1.transform = CGAffineTransformMakeRotation(CGFloat(M_PI_4))
+        thumbSignView1.transform = CGAffineTransform(rotationAngle: .pi/4)
         self.addSubview(thumbSignView1);
         
         thumbSignView2 = createThumbSignView()
-        thumbSignView2.transform = CGAffineTransformMakeRotation(CGFloat(-M_PI_4))
+        thumbSignView2.transform = CGAffineTransform(rotationAngle: -(.pi/4))
         self.addSubview(thumbSignView2);
     }
     
     private func createThumbSignView() -> UIView {
         let thumbSignHeight = self.bounds.height / 2 - thumbSignWidth
-        let thumbSignView = UIView(frame: CGRectMake(self.bounds.width / 2 - 4, self.bounds.height / 2 - thumbSignHeight / 2, thumbSignWidth, thumbSignHeight))
+        let thumbSignView = UIView(frame: CGRect(x: self.bounds.width / 2 - 4, y: self.bounds.height / 2 - thumbSignHeight / 2, width: thumbSignWidth, height: thumbSignHeight))
         thumbSignView.layer.cornerRadius = thumbSignWidth / 2
-        thumbSignView.backgroundColor = UIColor.whiteColor()
+        thumbSignView.backgroundColor = .white
         
         return thumbSignView
     }

    private var thumbAnimationGroup: CAAnimationGroup!
    private var isOn: Bool = false
    private var isTracking: Bool = false

    // MARK: - Lifecycle -
    /**
    *   Initialization
    */
    
    required internal init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

    }
    
    override internal init(frame: CGRect) {
        let squareRect = CGRect(x: 0, y: 0, width: defaultFrame.height, height: defaultFrame.height)
        let initialFrame = frame.isEmpty ? squareRect.inset(by: UIEdgeInsets(top: borderMargin, left: borderMargin, bottom: borderMargin, right: borderMargin)) : frame
        super.init(frame: initialFrame)
        setup()
    }
    
    private func setup() {
        backgroundView = UIView(frame: self.bounds)
        
        backgroundView.layer.cornerRadius = self.frame.height * 0.5
        backgroundView.layer.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius: backgroundView.layer.cornerRadius).cgPath
        backgroundView.layer.shadowRadius = 4.0
        backgroundView.layer.shadowOpacity = 0
        backgroundView.layer.shadowColor = shadowColor.cgColor
        backgroundView.layer.shadowOffset = CGSize(width: 0, height: 7)
        backgroundView.layer.masksToBounds = false
        
        self.addSubview(backgroundView)
        self.isUserInteractionEnabled = false
        
        setupSignViews()
    }
