<commit_before>import UIKit


public extension UIAlertController {

	@nonobjc
	public convenience init(actionSheetWithMessage message: String) {
		self.init(title: nil, message: message.nonEmpty, preferredStyle: .ActionSheet)
	}


	@nonobjc
	public convenience init(actionSheetWithTitle title: String) {
		self.init(title: title.nonEmpty, message: nil, preferredStyle: .ActionSheet)
	}


	@nonobjc
	public convenience init(alertWithMessage message: String) {
		self.init(title: nil, message: message.nonEmpty, preferredStyle: .Alert)
	}


	@nonobjc
	public convenience init(alertWithTitle title: String, message: String) {
		self.init(title: title.nonEmpty, message: message.nonEmpty, preferredStyle: .Alert)
	}


	@nonobjc
	public func addActionWithTitle(title: String, handler: Closure? = nil) {
		addAction(UIAlertAction(title: title, style: .Default) { _ in handler?() })
	}


	@nonobjc
	public func addCancelAction(handler: Closure? = nil) {
		addCancelActionWithTitle(NSBundle(forClass: UIAlertController.self).localizedStringForKey("Cancel", value: "Cancel", table: nil), handler: handler)
	}


	@nonobjc
	public func addCancelActionWithTitle(title: String, handler: Closure? = nil) {
		addAction(UIAlertAction(title: title, style: .Cancel) { _ in handler?() })
	}


	@nonobjc
	public func addDestructiveActionWithTitle(title: String, handler: Closure? = nil) {
		addAction(UIAlertAction(title: title, style: .Destructive) { _ in handler?() })
	}


	@nonobjc
	public func addOkayAction(handler: Closure? = nil) {
		addActionWithTitle(NSBundle(forClass: UIAlertController.self).localizedStringForKey("OK", value: "OK", table: nil), handler: handler)
	}
}<commit_msg>UIAlertController action shortcuts now also return the action<commit_after>import UIKit


public extension UIAlertController {

	@nonobjc
	public convenience init(actionSheetWithMessage message: String) {
		self.init(title: nil, message: message.nonEmpty, preferredStyle: .ActionSheet)
	}


	@nonobjc
	public convenience init(actionSheetWithTitle title: String) {
		self.init(title: title.nonEmpty, message: nil, preferredStyle: .ActionSheet)
	}


	@nonobjc
	public convenience init(alertWithMessage message: String) {
		self.init(title: nil, message: message.nonEmpty, preferredStyle: .Alert)
	}


	@nonobjc
	public convenience init(alertWithTitle title: String, message: String) {
		self.init(title: title.nonEmpty, message: message.nonEmpty, preferredStyle: .Alert)
	}


	@nonobjc
	public func addActionWithTitle(title: String, handler: Closure? = nil) -> UIAlertAction {
		let action = UIAlertAction(title: title, style: .Default) { _ in handler?() }
		addAction(action)
		return action
	}


	@nonobjc
	public func addCancelAction(handler: Closure? = nil) -> UIAlertAction {
		return addCancelActionWithTitle(NSBundle(forClass: UIAlertController.self).localizedStringForKey("Cancel", value: "Cancel", table: nil), handler: handler)
	}


	@nonobjc
	public func addCancelActionWithTitle(title: String, handler: Closure? = nil) -> UIAlertAction {
		let action = UIAlertAction(title: title, style: .Cancel) { _ in handler?() }
		addAction(action)
		return action
	}


	@nonobjc
	public func addDestructiveActionWithTitle(title: String, handler: Closure? = nil) -> UIAlertAction {
		let action = UIAlertAction(title: title, style: .Destructive) { _ in handler?() }
		addAction(action)
		return action
	}


	@nonobjc
	public func addOkayAction(handler: Closure? = nil) -> UIAlertAction {
		return addActionWithTitle(NSBundle(forClass: UIAlertController.self).localizedStringForKey("OK", value: "OK", table: nil), handler: handler)
	}
}
{'fraction_non_alphanumeric': 0.11178918169209431, 'fraction_numerical': 0.0, 'mean_word_length': 5.690166975881262, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2972596', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1110, 'n_words': 279}