             setLockViewNeedUpdate(needRecalculateDotsFrame: false)
         }
     }
+    @IBInspectable var succeededOuterCircleColor: UIColor = HUIPatternLockView.defaultSucceededColor {
+        didSet {
+            setLockViewNeedUpdate(needRecalculateDotsFrame: false)
+        }
+    }
+    @IBInspectable var failedOuterCircleColor: UIColor = HUIPatternLockView.defaultFailedColor {
+        didSet {
+            setLockViewNeedUpdate(needRecalculateDotsFrame: false)
+        }
+    }
     @IBInspectable var normalInnerDotColor: UIColor = UIColor.blackColor() {
         didSet {
             setLockViewNeedUpdate(needRecalculateDotsFrame: false)

}

@IBDesignable public class HUIPatternLockView : UIView {
    static let defaultColor = UIColor(red: 248.00/255.00, green: 200.00/255.00, blue: 79.00/255.00, alpha: 1.0)
    
    //MARK: Layouts Related Properties
    @IBInspectable var numberOfRows: Int = 3 {

    }
    
    public override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
        guard !highlightedDots.isEmpty else {
            resetDotsState()
            return
        }
        
        endLinePathWithPoint((touches.first?.locationInView(self))!)
        
        let dotCounts = highlightedDots.count
        var currentPassword = String()
        for dot in highlightedDots {
            currentPassword.appendContentsOf("[\(dot.tag)]")
        }
        
        //if the correct password is set, redraw the dots and line in a success/failed state
        if let pwd = password {
            let succeeded = pwd == currentPassword
            
            if (succeeded) {
                state = .Succeeded
                succeededDots.appendContentsOf(normalDots)
                succeededDots.appendContentsOf(highlightedDots)
            } else {
                state = .Failed
                failedDots.appendContentsOf(normalDots)
                failedDots.appendContentsOf(highlightedDots)
            }
            
            
            normalDots.removeAll()
            highlightedDots.removeAll()
            setLockViewNeedUpdate(needRecalculateDotsFrame: false)
        }
        
        if let callback = didDrawPatternWithPassword {
            callback(lockeView: self, dotCounts: dotCounts, password: currentPassword)
        }
        
        //reset dots state after resetDelay seconds. Make the line display resetDelay seconds
        resetTimer?.invalidate()
        resetTimer = NSTimer.scheduledTimerWithTimeInterval(resetDelay, target: self, selector: "timerFired:", userInfo: ["dotCounts": dotCounts, "password": currentPassword], repeats: false)
    }
    
    func timerFired(timer: NSTimer) {
        let dotCounts = timer.userInfo!["dotCounts"] as! Int
        let currentPassword = timer.userInfo!["password"] as! String
        if let callback = self.willResetPatternWithPassword {
            callback(lockeView: self, dotCounts: dotCounts, password: currentPassword)
        }
        self.resetDotsState()
        self.setNeedsDisplay()
    }
    
    public override func touchesCancelled(touches: Set<UITouch>?, withEvent event: UIEvent?) {
