         self.reason = ""
     }
     
-    class func canAuthenticateWithError() throws{
-        let error: NSError! = NSError(domain: "Migrator", code: 0, userInfo: nil)
+    class func canAuthenticateWithError(error: NSErrorPointer) -> Bool{
+        if (NSUserDefaults.standardUserDefaults().objectForKey("touch_id_security") != nil){
+            if NSUserDefaults.standardUserDefaults().boolForKey("touch_id_security") == false{
+                return false
+            }
+        }
+        else {
+            return false
+        }
         if ((NSClassFromString("LAContext")) != nil){
-            if (EHFAuthenticator.sharedInstance.context.canEvaluatePolicy(EHFAuthenticator.sharedInstance.policy, error: nil)){
-                return
+            if (EHFAuthenticator.sharedInstance.context .canEvaluatePolicy(EHFAuthenticator.sharedInstance.policy, error: nil)){
+                return true
             }
-            throw error
+            return false
         }
-        throw error
+        return false
     }
     
     func authenticateWithSuccess(success: EHFCompletionBlock, failure: EHFAuthenticationErrorBlock){
         self.context = LAContext()
+        var authError : NSError?
         if (self.useDefaultFallbackTitle) {
             self.context.localizedFallbackTitle = self.fallbackButtonTitle as String;
         }else if (self.hideFallbackButton){
             self.context.localizedFallbackTitle = "";
         }
-        if (self.context.canEvaluatePolicy(policy, error: nil)) {
+        if (self.context.canEvaluatePolicy(policy, error: &authError)) {
             self.context.evaluatePolicy(policy, localizedReason:
                 reason as String, reply:{ authenticated, error in
-                if (authenticated) {
-                    dispatch_async(dispatch_get_main_queue(), {success()})
-                } else {
-                    dispatch_async(dispatch_get_main_queue(), {failure(error!.code)})
-                }
+                    if (authenticated) {
+                        dispatch_async(dispatch_get_main_queue(), {success()})
+                    } else {
+                        dispatch_async(dispatch_get_main_queue(), {failure(error!.code)})
+                    }
             })
         } else {
-            failure(0)
+            failure(authError!.code)
         }
     }
-}+}


typealias EHFCompletionBlock = Void ->()
typealias EHFAuthenticationErrorBlock = Int -> ()

class EHFAuthenticator : NSObject {
    

//
//  EHFAuthenticator.swift
//
//  Created by Christopher Truman on 9/29/14.
//  Copyright (c) 2014 truman. All rights reserved.
