                     title: NSAttributedString.tableRowTitle(
                         NSLocalizedString("Use Touch ID", tableName:  "AuthenticationManager", comment: "List section title for when to use Touch ID")
                     ),
-                    navigationController: self.navigationController
+                    navigationController: self.navigationController,
+                    delegate: nil,
+                    enabled: true,
+                    touchIDSuccess: { [unowned self] in
+                        self.touchIDAuthenticationSucceeded()
+                    },
+                    touchIDFallback: { [unowned self] in
+                        self.fallbackOnTouchIDFailure()
+                    }
                 )
             )
         }

        }

        if authInfo.useTouchID {
            AppAuthenticator.presentAuthenticationUsingInfo(authInfo,
            success: {
                self.toggleTouchID(enabled: false)
            },
            fallback: {
                AppAuthenticator.presentPasscodeAuthentication(self.navigationController, delegate: self)
            })
        } else {
            toggleTouchID(enabled: true)
        }
    }

    private func toggleTouchID(enabled enabled: Bool) {
        authInfo?.useTouchID = enabled
        KeychainWrapper.setAuthenticationInfo(authInfo)
        switchControl?.setOn(enabled, animated: true)
    }
}

extension TouchIDSetting: PasscodeEntryDelegate {
    @objc func passcodeValidationDidSucceed() {
        toggleTouchID(enabled: false)
        navigationController?.dismissViewControllerAnimated(true, completion: nil)
    }
}


        tableView.reloadData()
    }
}

extension AuthenticationSettingsViewController: PasscodeEntryDelegate {
    private func getTouchIDSetting() -> TouchIDSetting? {
        guard settings.count >= 2 && settings[1].count >= 2 else {
            return nil
        }
        return settings[1][1] as? TouchIDSetting
    }

    func touchIDAuthenticationSucceeded() {
        getTouchIDSetting()?.toggleTouchID(enabled: false)
    }

    func fallbackOnTouchIDFailure() {
        AppAuthenticator.presentPasscodeAuthentication(self.navigationController, delegate: self)
    }

    @objc func passcodeValidationDidSucceed() {
        getTouchIDSetting()?.toggleTouchID(enabled: false)
        navigationController?.dismissViewControllerAnimated(true, completion: nil)
    }
}
