             return CGSize(width: 36, height: 36)
         }
     }
-	
-	/**
+    
+    /**
      An initializer that initializes the object with a NSCoder object.
      - Parameter aDecoder: A NSCoder instance.
      */
-	public required init?(coder aDecoder: NSCoder) {
-		track = UIView()
-		button = FABButton()
-		super.init(coder: aDecoder)
-		prepare()
-	}
-	
-	/**
+    public required init?(coder aDecoder: NSCoder) {
+        track = UIView()
+        button = FABButton()
+        super.init(coder: aDecoder)
+        prepare()
+    }
+    
+    /**
      An initializer that initializes the object with a CGRect object.
      If AutoLayout is used, it is better to initilize the instance
      using the init(state:style:size:) initializer, or set the CGRect
      to CGRectNull.
      - Parameter frame: A CGRect instance.
      */
-	public override init(frame: CGRect) {
-		track = UIView()
-		button = FABButton()
-		super.init(frame: frame)
-		prepare()
-	}
-	
-	/**
+    public override init(frame: CGRect) {
+        track = UIView()
+        button = FABButton()
+        super.init(frame: frame)
+        prepare()
+    }
+    
+    /**
      An initializer that sets the state, style, and size of the Switch instance.
      - Parameter state: A SwitchState value.
      - Parameter style: A SwitchStyle value.
      - Parameter size: A SwitchSize value.
      */
-	public init(state: SwitchState = .off, style: SwitchStyle = .dark, size: SwitchSize = .medium) {
-		track = UIView()
-		button = FABButton()
-		super.init(frame: .zero)
+    public init(state: SwitchState = .off, style: SwitchStyle = .dark, size: SwitchSize = .medium) {
+        track = UIView()
+        button = FABButton()
+        super.init(frame: .zero)
         prepare()
         prepareSwitchState(state: state)
         prepareSwitchStyle(style: style)
         prepareSwitchSize(size: size)
-	}
-	
+    }
+    
     open override func layoutSubviews() {
         super.layoutSubviews()
         guard willLayout else {

    fileprivate func animateToState(state: SwitchState, completion: ((Switch) -> Void)? = nil) {
        isUserInteractionEnabled = false
        UIView.animate(withDuration: 0.15,
            delay: 0.05,
            options: [.curveEaseIn, .curveEaseOut],
            animations: { [weak self] in
            guard let s = self else {
                return
            }

            s.button.x = .on == state ? s.onPosition + s.bounceOffset : s.offPosition - s.bounceOffset
            s.styleForState(state: state)
        }) { [weak self] _ in
            UIView.animate(withDuration: 0.15,
                animations: { [weak self] in
                guard let s = self else {
                    return
                }

                s.button.x = .on == state ? s.onPosition : s.offPosition
            }) { [weak self] _ in
                guard let s = self else {
                    return


@objc(SwitchStyle)
public enum SwitchStyle: Int {
    case light
    case dark
}

@objc(SwitchState)
public enum SwitchState: Int {
    case on
    case off
}

@objc(SwitchSize)
public enum SwitchSize: Int {
    case small
    case medium
    case large
}

@objc(SwitchDelegate)
public protocol SwitchDelegate {
    /**
     A Switch delegate method for state changes.
     - Parameter control: Switch control.
     - Parameter state: SwitchState value.
