 	}
 
 	// MARK: - Events
-	public override func mouseDown(theEvent: NSEvent) {
+	public override func mouseDown(with theEvent: NSEvent) {
 		pressed = true
 		needsDisplay = true
 	}
 
-	public override func mouseUp(theEvent: NSEvent) {
+	public override func mouseUp(with theEvent: NSEvent) {
 		pressed = false
 		on = !on
 	}

	// MARK: - Drawing
	public override func updateLayer() {
		// Background
		backgroundLayer.frame = bounds
		backgroundLayer.cornerRadius = ceil(bounds.height / 2)
		backgroundLayer.borderWidth = on ? ceil(backgroundLayer.bounds.height) : 3.0 * ceil(backgroundLayer.bounds.height / baseHeight)
		backgroundLayer.borderColor = on ? tintColor.CGColor : NSColor.blackColor().colorWithAlphaComponent(0.09).CGColor

		// Knob
		knobContainer.frame = knobFrameForState(on: on, pressed: pressed)

import AppKit

public class JSSwitch: NSControl {
	// MARK: - Properties
	private var pressed = false
	private let backgroundLayer = CALayer()
	private let knobContainer = CALayer()
	private let knobLayer = CALayer()
	private let knobShadows = (smallStroke: CALayer(), smallShadow: CALayer(), mediumShadow: CALayer(), bigShadow: CALayer())

	// MARK: Computed
	public override var wantsUpdateLayer: Bool { return true }
	public override var intrinsicContentSize: NSSize {
		return CGSize(width: 52, height: 32)
	}

	private var scaleFactor: CGFloat {
		return ceil(frame.size.height / 62) // Hardcoded base height
	}

	public var tintColor = NSColor(deviceRed: 76/255, green: 217/255, blue: 100/255, alpha: 1.0) {
		didSet { needsDisplay = true }
	}
	public var on = false {
