<commit_before>//
//  LKAlertController.swift
//  Pods
//
//  Created by <NAME> on 7/14/15.
//
//

import UIKit


/**
Base class for creating an alert controller.
Use Alert or ActionSheet instead
*/
public class LKAlertController {
    /** Internal alert controller to present to the user */
    internal var alertController: UIAlertController
    
    /** Internal static variable to store the override the show method for testing purposes */
    internal static var alertTester: ((style: UIAlertControllerStyle, title: String?, message: String?, actions: [AnyObject]) -> Void)? = nil
    
    /** Title of the alert controller */
    internal var title: String? {
        get {
            return alertController.title
        }
        set {
            alertController.title = newValue
        }
    }
    
    /** Message of the alert controller */
    internal var message: String? {
        get {
            return alertController.message
        }
        set {
            alertController.message = newValue
        }
    }
    
    /**
    Initialize a new LKAlertController
    
    :param: style  .ActionSheet or .Alert
    */
    public init(style: UIAlertControllerStyle) {
        alertController = UIAlertController(title: nil, message: nil, preferredStyle: style)
    }
    
    /**<commit_msg>Add textfield method to superclass<commit_after>//
//  LKAlertController.swift
//  Pods
//
//  Created by <NAME> on 7/14/15.
//
//

import UIKit


/**
Base class for creating an alert controller.
Use Alert or ActionSheet instead
*/
public class LKAlertController {
    /** Internal alert controller to present to the user */
    internal var alertController: UIAlertController
    
    /** Internal static variable to store the override the show method for testing purposes */
    internal static var alertTester: ((style: UIAlertControllerStyle, title: String?, message: String?, actions: [AnyObject]) -> Void)? = nil
    
    /** Title of the alert controller */
    internal var title: String? {
        get {
            return alertController.title
        }
        set {
            alertController.title = newValue
        }
    }
    
    /** Message of the alert controller */
    internal var message: String? {
        get {
            return alertController.message
        }
        set {
            alertController.message = newValue
        }
    }
    
    /**
    Initialize a new LKAlertController
    
    :param: style  .ActionSheet or .Alert
    */
    public init(style: UIAlertControllerStyle) {
        alertController = UIAlertController(title: nil, message: nil, preferredStyle: style)
    }
    
    public func addTextField(placeholder: String?, secureText: Bool?) {
        alertController.addTextFieldWithConfigurationHandler { (textField: UITextField!) -> Void in
            if let placeholder = placeholder {
                textField.placeholder = placeholder
            }
            if let secureText = secureText {
                textField.secureTextEntry = true
            }
        }
    }
    
    /**
{'fraction_non_alphanumeric': 0.08630271330500164, 'fraction_numerical': 0.0032690421706440013, 'mean_word_length': 2.1097560975609757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '1668357', 'n_tokens_mistral': 787, 'n_tokens_neox': 769, 'n_words': 253}