 		}
 		return [space, doneButton]
 	}
-}
-
-extension CTKFlagPhoneNumberTextField: UITextFieldDelegate {
-
+
+	// UITextFieldDelegate
+	
 	public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
 		if string == "" && text == phoneCode {
 			return false

	public func textFieldDidEndEditing(_ textField: UITextField) {
		set(phoneNumber: textField.text!)
	}
}
	
extension CTKFlagPhoneNumberTextField: CountryPickerDelegate {
	public func countryPhoneCodePicker(_ picker: CountryPicker, didSelectCountryWithName name: String, countryCode: String, phoneCode: String, flag: UIImage) {
		self.phoneCode = phoneCode
		self.countryCode = countryCode

import Foundation
import libPhoneNumber_iOS

public class CTKFlagPhoneNumberTextField: UITextField, UITextFieldDelegate, CountryPickerDelegate, CTKFlagPhoneNumberDelegate {
		
	public var flagSize = CGSize(width: 32, height: 32) {
		didSet {
