<commit_before>//
//  ASRegistrationViewController.swift
//  AugmentedSzczecin
//
//  Created by Patronage on 14.03.2015.
//  Copyright (c) 2015 BLStream. All rights reserved.
//

import UIKit

class ASRegistrationViewController: UIViewController, UITextFieldDelegate {

    @IBOutlet weak var emailTextField: UITextField!
    @IBOutlet weak var passwordTextField: UITextField!
    @IBOutlet weak var registerButton: UIButton!
    var alert: ASAlertController?
    var success = false;
     
    @IBAction func registerButtonTapped(sender: AnyObject) {
        alert = ASAlertController(title: "Rejestruję", message: "Proszę czekać", preferredStyle: .Alert)
        alert?.showWithDelay(2, inViewController: self)
        //request to api
        if(success == true) {
            alert?.dismiss({ () -> () in
                NSLog("success")
            })
            self.performSegueWithIdentifier("RegisterSegue", sender: nil)
        }
        else{
            alert?.dismiss({ () -> () in
                NSLog("error")
            })
            alert = ASAlertController(title: "Błąd", message: "Sprawdz swoje połączenie z Internetem", preferredStyle: .Alert)
            alert?.addCancelAction("Zamknij")
            alert?.showInViewController(self)
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        emailTextField.delegate = self
        passwordTextField.delegate = self

    }
    
    func textFieldShouldReturn(textField: UITextField) -> Bool {
        textField.resignFirstResponder()
        return true
    }
    
    override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
        self.view.endEditing(true)
    }
}

<commit_msg>Added loadingAlert & errorAlert<commit_after>//
//  ASRegistrationViewController.swift
//  AugmentedSzczecin
//
//  Created by Patronage on 14.03.2015.
//  Copyright (c) 2015 BLStream. All rights reserved.
//

import UIKit

class ASRegistrationViewController: UIViewController, UITextFieldDelegate {

    @IBOutlet weak var emailTextField: UITextField!
    @IBOutlet weak var passwordTextField: UITextField!
    @IBOutlet weak var registerButton: UIButton!
    var loadingAlert: ASAlertController?
    var errorAlert: ASAlertController?
    var success = true;
     
    @IBAction func registerButtonTapped(sender: AnyObject) {
        loadingAlert = ASAlertController(title: "Rejestruję", message: "Proszę czekać", preferredStyle: .Alert)
        loadingAlert?.showWithDelay(2, inViewController: self)
        //request to api
        if(success == true) {
            loadingAlert?.dismiss({ () -> () in
                NSLog("success")
            })
            self.performSegueWithIdentifier("RegisterSegue", sender: nil)
        }
        else {
            loadingAlert?.dismiss({ () -> () in
                NSLog("error")
            })
            errorAlert = ASAlertController(title: "Błąd", message: "Sprawdz swoje połączenie z Internetem", preferredStyle: .Alert)
            errorAlert?.addCancelAction("Zamknij")
            errorAlert?.showInViewController(self)
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        emailTextField.delegate = self
        passwordTextField.delegate = self

    }
    
    func textFieldShouldReturn(textField: UITextField) -> Bool {
        textField.resignFirstResponder()
        return true
    }
    
    override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
        self.view.endEditing(true)
    }
}


{'fraction_non_alphanumeric': 0.09822685054883197, 'fraction_numerical': 0.007317759639741064, 'mean_word_length': 2.484313725490196, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1891535', 'n_tokens_mistral': 1042, 'n_tokens_neox': 984, 'n_words': 221}