 
 import UIKit
 
-class WMFLoginViewController: UIViewController, UITextFieldDelegate {
+class WMFLoginViewController: UIViewController, UITextFieldDelegate, WMFCaptchaViewControllerDelegate {
     @IBOutlet fileprivate var scrollView: UIScrollView!
     @IBOutlet fileprivate var usernameField: UITextField!
     @IBOutlet fileprivate var passwordField: UITextField!

    fileprivate var doneButton: UIBarButtonItem!
    
    public var funnel: LoginFunnel?
    fileprivate var captchaViewController: WMFCaptchaViewController?

    func closeButtonPushed(_ : UIBarButtonItem) {
        dismiss(animated: true, completion: nil)


    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        captchaViewController = WMFCaptchaViewController.wmf_initialViewControllerFromClassStoryboard()
        captchaViewController?.captchaDelegate = self
        wmf_addChildController(captchaViewController, andConstrainToEdgesOfContainerView: captchaContainer)
        
        // Check if captcha is required right away. Things could be configured so captcha is required at all times.
        getCaptcha()
        
        enableProgressiveButtonIfNecessary()
    }
    
