<commit_before>//
//  AlertHelper.swift
//  Reddit
//
//  Created by <NAME> on 05/08/16.
//  Copyright © 2016 Faber Ventures. All rights reserved.
//

import UIKit

class AlertHelper {

  private let viewController: UIViewController

  init(viewController: UIViewController) {
    self.viewController = viewController
  }

  func presentActionSheet(title: String? = nil, message: String? = nil, options: [String],
                          clicked: (Int?) -> Void) {
    let alertController = UIAlertController(title: title, message: message,
                                            preferredStyle: .ActionSheet)

    let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { action in
      clicked(nil)
    }
    alertController.addAction(cancelAction)

    (0..<options.count).forEach { index in
      let action = UIAlertAction(title: options[index], style: .Default) { action in
        clicked(index)
      }
      alertController.addAction(action)
    }

    viewController.presentViewController(alertController, animated: true, completion: nil)
  }
}<commit_msg>AlertHelper now has a localizable cancel string<commit_after>//
//  AlertHelper.swift
//  Reddit
//
//  Created by <NAME> on 05/08/16.
//  Copyright © 2016 Faber Ventures. All rights reserved.
//

import UIKit

class AlertHelper {

  private let viewController: UIViewController

  init(viewController: UIViewController) {
    self.viewController = viewController
  }

  func presentActionSheet(title: String? = nil, message: String? = nil, options: [String],
                          clicked: (Int?) -> Void) {
    let alertController = UIAlertController(title: title, message: message,
                                            preferredStyle: .ActionSheet)

    let cancelAction = UIAlertAction(title: tr(.AlertButtonCancel), style: .Cancel) { action in
      clicked(nil)
    }
    alertController.addAction(cancelAction)

    (0..<options.count).forEach { index in
      let action = UIAlertAction(title: options[index], style: .Default) { action in
        clicked(index)
      }
      alertController.addAction(action)
    }

    viewController.presentViewController(alertController, animated: true, completion: nil)
  }

}
{'fraction_non_alphanumeric': 0.10419485791610285, 'fraction_numerical': 0.009923319801533603, 'mean_word_length': 2.7914529914529913, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2264295', 'n_tokens_mistral': 630, 'n_tokens_neox': 593, 'n_words': 158}