 	}
 }
 
-public class TextFieldFormItemCell: UITableViewCell, UITextFieldDelegate, CellHeightProvider {
+public class TextFieldFormItemCell: UITableViewCell {
 	public let model: TextFieldFormItemCellModel
 	public let titleLabel = UILabel()
 	public let textField = CustomTextField()



public class CustomTextField: UITextField {
	
	public func configure() {
		backgroundColor = UIColor.white
		autocapitalizationType = .sentences

		let valid = validateAndUpdateErrorIfNeeded(s, shouldInstallTimer: true, checkSubmitRule: false)
		return valid
	}

	// Hide the keyboard when the user taps the return key in this UITextField
	public func textFieldShouldReturn(_ textField: UITextField) -> Bool {
		let s = textField.text ?? ""
		let isTextValid = validateAndUpdateErrorIfNeeded(s, shouldInstallTimer: true, checkSubmitRule: true)
		if isTextValid {
			textField.resignFirstResponder()
		}
		return false
	}
}

extension TextFieldFormItemCell: CellHeightProvider {
	public func form_cellHeight(indexPath: IndexPath, tableView: UITableView) -> CGFloat {
		let sizes: TextFieldFormItemCellSizes = compute(bounds.width)
		let value = sizes.cellHeight
		//SwiftyFormLog("compute height of row: \(value)")
		return value
	}
}
