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

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

    picker.showsSelectionIndicator = true
    picker.delegate = self
    picker.dataSource = self
    let toolBar = UIToolbar()
    toolBar.barStyle = UIBarStyle.Default
    toolBar.tintColor = Constants.darkBlueColor(1)
    toolBar.sizeToFit()
    let doneButton = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Plain, target: self, action: #selector(PickerView.doneButtonAction))
    let spaceButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil)
    let cancelButton = UIBarButtonItem(title: "Cancel", style: UIBarButtonItemStyle.Plain, target: self, action: #selector(PickerView.cancelButtonAction))
    toolBar.setItems([cancelButton, spaceButton, doneButton], animated: false)
    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)
