             setLockViewNeedUpdate(needRecalculateDotsFrame: false)
         }
     }
+    @IBInspectable var succeededDotImage: UIImage? = nil {
+        didSet {
+            setLockViewNeedUpdate(needRecalculateDotsFrame: false)
+        }
+    }
+    @IBInspectable var failedDotImage: UIImage? = nil {
+        didSet {
+            setLockViewNeedUpdate(needRecalculateDotsFrame: false)
+        }
+    }
+    
+    var password: String?
+    var resetDelay: NSTimeInterval = 1
     
     
     //MARK: Callback
     var didDrawPatternWithPassword: ((lockeView: HUIPatternLockView, dotCounts: Int, password: String?) -> Void)? = nil
+    var willResetPatternWithPassword: ((lockeView: HUIPatternLockView, dotCounts: Int, password: String?) -> Void)? = nil
     
     //MARK: Private Internal vars
     private var normalDots = Array<HUIPatternLockViewDot>()
     private var highlightedDots = Array<HUIPatternLockViewDot>()
+    private var succeededDots = Array<HUIPatternLockViewDot>()
+    private var failedDots = Array<HUIPatternLockViewDot>()
     private var linePath = Array<CGPoint>()
     private var needRecalculateDotsFrame = true
-    
+    private var state: State = .Normal
+    private var resetTimer: NSTimer?
+
     override public var bounds: CGRect {
         didSet {
             setLockViewNeedUpdate(needRecalculateDotsFrame: true)

            setLockViewNeedUpdate(needRecalculateDotsFrame: false)
        }
    }
    @IBInspectable var normalInnerDotColor: UIColor = UIColor.blackColor() {
        didSet {
            setLockViewNeedUpdate(needRecalculateDotsFrame: false)

}

@IBDesignable public class HUIPatternLockView : UIView {
    private enum State {
        case Normal
        case Succeeded
        case Failed
    }
    
    static let defaultColor = UIColor(red: 248.00/255.00, green: 200.00/255.00, blue: 79.00/255.00, alpha: 1.0)
    static let defaultSucceededColor = UIColor.greenColor()
    static let defaultFailedColor = UIColor.redColor()
    
    //MARK: Layouts Related Properties
    @IBInspectable var numberOfRows: Int = 3 {
