<commit_before>//
//  BGStatePickerView.swift
//  BGStatePicker
//
//  Created by <NAME> on 21/03/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit
public func toto() {
}
public class BGStatePickerView: UIView {

	public var delegate: BGStatePickerDelegate?
	public var datasource: BGStatePickerDatasource?
	var selected: BGStateable?
	var cachedStates: [BGStateable] = []

	public override init(frame: CGRect) {
		super.init(frame: frame)
	}
	public required init?(coder aDecoder: NSCoder) {
		super.init(coder: aDecoder)
	}

	public func reloadData() {
		subviews.forEach {
			$0.removeFromSuperview()
		}

		cachedStates = [BGStateable]()
		if let datasource = datasource {
			for index in 0 ..< datasource.numberOfState() {
				let state: BGStateable = datasource.stateForIndex(index)
				cachedStates.append(state)

				let button = UIButton()
				button.backgroundColor = state.stateBackgroundColor()
				button.setTitle(state.stateText(), forState: .Normal)
				button.addTarget(self, action: "didTapOnState:", forControlEvents: UIControlEvents.TouchUpInside)
				button.titleLabel?.font = state.stateTextFont()

				self.addSubview(button)
			}
		}
	}

	func didTapOnState(sender: UIView) {
		// retrieve selected state

		// update selected state

		// call delegate
	}
}<commit_msg>fix swift 2.2  selector warning<commit_after>//
//  BGStatePickerView.swift
//  BGStatePicker
//
//  Created by <NAME> on 21/03/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit
public func toto() {
}
public class BGStatePickerView: UIView {

	public var delegate: BGStatePickerDelegate?
	public var datasource: BGStatePickerDatasource?
	var selected: BGStateable?
	var cachedStates: [BGStateable] = []

	public override init(frame: CGRect) {
		super.init(frame: frame)
	}
	public required init?(coder aDecoder: NSCoder) {
		super.init(coder: aDecoder)
	}

	public func reloadData() {
		subviews.forEach {
			$0.removeFromSuperview()
		}

		cachedStates = [BGStateable]()
		if let datasource = datasource {
			for index in 0 ..< datasource.numberOfState() {
				let state: BGStateable = datasource.stateForIndex(index)
				cachedStates.append(state)
				let button = UIButton()
				button.backgroundColor = state.stateBackgroundColor()
				button.setTitle(state.stateText(), forState: .Normal)
                button.addTarget(self, action: #selector(didTapOnState), forControlEvents: .TouchUpInside)
				button.titleLabel?.font = state.stateTextFont()

				self.addSubview(button)
			}
		}
	}

	func didTapOnState(sender: UIView) {
		// retrieve selected state

		// update selected state

		// call delegate
	}
}
{'fraction_non_alphanumeric': 0.11367069486404834, 'fraction_numerical': 0.009818731117824773, 'mean_word_length': 3.7989130434782608, 'pattern_counts': {'":': 0, '<': 9, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2348470', 'n_tokens_mistral': 985, 'n_tokens_neox': 840, 'n_words': 202}