   }
   
 }
-
-class NonPerformField: UITextField {
-  
-  override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool {
-    return false
-  }
-  
-}
-

    picker.showsSelectionIndicator = true
    picker.delegate = self
    picker.dataSource = self
    
    toolBar.barStyle = UIBarStyle.Default
    toolBar.tintColor = .blackColor()
    toolBar.sizeToFit()
    
    let doneButton = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Plain, target: self, action: #selector(PickerView.donePicker))
    let spaceButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil)
    let cancelButton = UIBarButtonItem(title: "Cancel", style: UIBarButtonItemStyle.Plain, target: self, action: #selector(PickerView.cancelPicker))
    
    toolBar.setItems([cancelButton, spaceButton, doneButton], animated: false)
    toolBar.userInteractionEnabled = true
    field.inputView = picker
    field.inputAccessoryView = toolBar
    field.tintColor = UIColor.clearColor()
    
    if field.text?.characters.count > 0 {
      let row = dataArray.indexOf(field.text!)
      picker.selectRow(row!, inComponent: 0, animated: false)


class PickerView: UIView {
  
  private let picker = UIPickerView()
  var dataArray = [String]()
  var field: UITextField!
  
