     }
   }
   
-  func donePicker(){
+  func doneButtonAction() {
     let row = (picker.selectedRowInComponent(0))
     field.text = dataArray[row]
     field.resignFirstResponder()
   }
   
-  func cancelPicker(){
+  func cancelButtonAction() {
     field.resignFirstResponder()
   }
 }

    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)

  }
  
}
