<commit_before>//
//  Copyright (c) 2014-2016 Actor LLC. <https://actor.im>
//

import Foundation

public class AAAuthLogInViewController: AAAuthViewController {
    
    let scrollView = UIScrollView()
    
    let welcomeLabel = UILabel()
    let field = UITextField()
    let fieldLine = UIView()
    
    var isFirstAppear = true
    
    public override init() {
        super.init(nibName: nil, bundle: nil)
        
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: AALocalized("NavigationCancel"), style: .Plain, target: self, action: "dismiss")
    }

    public required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    public override func viewDidLoad() {
     
        view.backgroundColor = UIColor.whiteColor()
        
        scrollView.keyboardDismissMode = .OnDrag
        scrollView.scrollEnabled = true
        scrollView.alwaysBounceVertical = true
        
        welcomeLabel.font = UIFont.lightSystemFontOfSize(23)
        welcomeLabel.text = AALocalized("AuthLoginTitle").replace("{app_name}", dest: ActorSDK.sharedActor().appName)
        welcomeLabel.textColor = ActorSDK.sharedActor().style.authTitleColor
        welcomeLabel.textAlignment = .Center
        
        if ActorSDK.sharedActor().authStrategy == .PhoneOnly {
            field.placeholder = AALocalized("AuthLoginPhone")
            field.keyboardType = .EmailAddress
        } else if ActorSDK.sharedActor().authStrategy == .EmailOnly {
            field.placeholder = AALocalized("AuthLoginEmail")
            field.keyboardType = .PhonePad
        } else if ActorSDK.sharedActor().authStrategy == .PhoneEmail {
            field.placeholder = AALocalized("AuthLoginPhoneEmail")
            field.keyboardType = .Default
        }
        field.autocapitalizationType = .None
        field.autocorrectionType = .No
        
        fieldLine.backgroundColor = ActorSDK.sharedActor().style.authSeparatorColor
        fieldLine.opaque = false
        
        scrollView.addSubview(welcomeLabel)
        scrollView.addSubview(field)
        scrollView.addSubview(fieldLine)
        view.addSubview(scrollView)

        super.viewDidLoad()
    }<commit_msg>fix(iOS): Fixing incorrect keyboards in log in<commit_after>//
//  Copyright (c) 2014-2016 Actor LLC. <https://actor.im>
//

import Foundation

public class AAAuthLogInViewController: AAAuthViewController {
    
    let scrollView = UIScrollView()
    
    let welcomeLabel = UILabel()
    let field = UITextField()
    let fieldLine = UIView()
    
    var isFirstAppear = true
    
    public override init() {
        super.init(nibName: nil, bundle: nil)
        
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: AALocalized("NavigationCancel"), style: .Plain, target: self, action: "dismiss")
    }

    public required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    public override func viewDidLoad() {
     
        view.backgroundColor = UIColor.whiteColor()
        
        scrollView.keyboardDismissMode = .OnDrag
        scrollView.scrollEnabled = true
        scrollView.alwaysBounceVertical = true
        
        welcomeLabel.font = UIFont.lightSystemFontOfSize(23)
        welcomeLabel.text = AALocalized("AuthLoginTitle").replace("{app_name}", dest: ActorSDK.sharedActor().appName)
        welcomeLabel.textColor = ActorSDK.sharedActor().style.authTitleColor
        welcomeLabel.textAlignment = .Center
        
        if ActorSDK.sharedActor().authStrategy == .PhoneOnly {
            field.placeholder = AALocalized("AuthLoginPhone")
            field.keyboardType = .PhonePad
        } else if ActorSDK.sharedActor().authStrategy == .EmailOnly {
            field.placeholder = AALocalized("AuthLoginEmail")
            field.keyboardType = .EmailAddress
        } else if ActorSDK.sharedActor().authStrategy == .PhoneEmail {
            field.placeholder = AALocalized("AuthLoginPhoneEmail")
            field.keyboardType = .Default
        }
        field.autocapitalizationType = .None
        field.autocorrectionType = .No
        
        fieldLine.backgroundColor = ActorSDK.sharedActor().style.authSeparatorColor
        fieldLine.opaque = false
        
        scrollView.addSubview(welcomeLabel)
        scrollView.addSubview(field)
        scrollView.addSubview(fieldLine)
        view.addSubview(scrollView)

        super.viewDidLoad()
    }
{'fraction_non_alphanumeric': 0.09354766688993078, 'fraction_numerical': 0.004465282429113641, 'mean_word_length': 2.621665319320938, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3638016', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1233, 'n_words': 230}