         circleLayer.setNeedsDisplay()
     }
     
+    /// Sublayer layouting
     override public func layoutSubviews() {
         super.layoutSubviews()
         ringLayer.frame = bounds

        addTarget(self, action: Selector("handleShortPress:"), forControlEvents: UIControlEvents.TouchUpInside)
    }
    
    func redraw() {
        ringLayer.lineWidth = ringWidth
        ringLayer.strokeColor = ringColor?.CGColor
        ringLayer.path = UIBezierPath(ovalInRect: outerRect).CGPath

    /// The minmal duration, that the record button is supposed
    /// to stay in the 'selected' state, once the long press has
    /// started.
    @IBInspectable public var minPressDuration : Float = 1.0
    
    /// The width of the outer ring of the record button.
    @IBInspectable public var ringWidth : CGFloat = 4.0 {
        didSet { redraw() }
    }
    
    /// The color of the outer ring of the record button.
    @IBInspectable public var ringColor : UIColor? = UIColor.whiteColor() {
        didSet { redraw() }
    }
    
    /// The margin between the outer ring and inner circle
    /// of the record button.
    @IBInspectable public var circleMargin : CGFloat = 0.0 {
        didSet { redraw() }
    }
    
    /// The color of the inner circle of the record button.
    @IBInspectable public var circleColor : UIColor? = UIColor.redColor() {
        didSet { redraw() }
    }
    
    /// The text that the tooltip is supposed to display,
    /// if the user did short-press the button.
    public lazy var toolTipText : String = {
        return "Tap and Hold"
    }()
    
    /// The font of the tooltip text.
    public var toolTipFont : UIFont = {
        return UIFont.systemFontOfSize(12.0)
    }()
    
    /// The background color of the tooltip.
    public var toolTipColor : UIColor = {
        return UIColor.whiteColor()
    }()
    
    /// The text color of the tooltip.
    public var toolTipTextColor : UIColor = {
        return UIColor(white: 0.0, alpha: 0.8)
    }()
    
    /// Determines if the record button is enabled.
    override public var enabled: Bool {
        didSet {
            let state : UIControlState = enabled ? .Normal : .Disabled
            circleLayer.fillColor = circleColorForState(state)?.CGColor
            ringLayer.strokeColor = ringColorForState(state)?.CGColor
        }
    }
    
    // MARK: Initializers
    
    /// Initializer
    override init (frame : CGRect) {
        super.init(frame : frame)
        commonInit()
    }
    
    /// Initializer
    convenience init () {
        self.init(frame:CGRect.zero)
    }
    
    /// Initializer
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        commonInit()
    }
    
    
    // MARK: Private
