title: Getting the convert value of type 'String' to 'Calendar.Identifier' error after converting Swift 2 to Swift 3
body: <p>After converting (my working previously) code to <code>SWIFT 3</code> I am getting an error message while trying to compile and run:</p>
  
  <blockquote>
    <p>Cannot convert value of type 'String' to expected argument type
    'Calendar.Identifier'</p>
  </blockquote>
  
  <p>Pasting the section the issue occurs:</p>
  
  <pre><code>    var calendar = Calendar(identifier: NSGregorianCalendar)
      var birthday = calendar?.date(from: dateComponent)
      var currentDate = Date()
  </code></pre>
  
  <p>Adn the whole App/code:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITextFieldDelegate { //, UIPickerViewDataSource, UIPickerViewDelegate {
  
  
  @IBOutlet weak var dayTextField: UITextField!
  @IBOutlet weak var monthTextField: UITextField!
  @IBOutlet weak var yearTextField: UITextField!
  
  @IBOutlet weak var messageLabel: UILabel!
  
  /*UI Picker data
  
  var data = */
  
  func textFieldDidBeginEditing(textField: UITextField) {
      let datePicker = UIDatePicker()
      textField.inputView = datePicker
  } */
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
      dayTextField.delegate = self //dopisujemy delegate i u góry uitextfielddelegate
      let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewController.dismissKeyboard))
      view.addGestureRecognizer(tap)
  }
  
  
  
  
  //Calls this function when the tap is recognized.
  func dismissKeyboard() {
      //Causes the view (or one of its embedded text fields) to resign the first responder status.
      view.endEditing(true)
  
  
  }
  
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
  
      // Dispose of any resources that can be recreated.
  }
  
  
  
  @IBAction func buttonPressed(_ sender: UIButton) {
      messageLabel.text = "Udało się!"
  
      var dateComponent = DateComponents()
      dateComponent.day =  Int(dayTextField.text!)! //1
      dateComponent.month = Int(monthTextField.text!)! //1
      dateComponent.year = Int(yearTextField.text!)! //2000
  
  
      //TextField - zamykanie klawiatury po nacisnieciu na ekran poza klawą
  
  
  
  
  
  
      var calendar = Calendar(identifier: NSGregorianCalendar)
      var birthday = calendar?.date(from: dateComponent)
      var currentDate = Date()
  
  
  
  
  
  
      //obie następne rzeczy printowane sa w konsoli XCode po naciśnieciu przycisku w aplikcaji
      print(birthday)
      print("Current Date is \(currentDate)")
  
  
  
      //sumowanie
      var datesDuration = (calendar as NSCalendar?)?.components(NSCalendar.Unit.day,
                                               from: birthday!,
                                               to: currentDate, options: [])
  
  
  
      //poniżej ! oznacza, iż nie jest to optional tylko na pewno var. Gdyby zostało ?, przy wyniku pojawił by nam się w aplikacji "otpional".
  
      var daysTogether = datesDuration!.day
  
  
      /*dodamy bajery aby było bardziej ładnie
  
      var numberFormatter = NSNumberFormatter()
      numberFormatter.usesGroupingSeparator = true
  
      var dayString = numberFormatter.stringFromNumber(daysTogether) */
  
  
      //wynik koncowy
      messageLabel.text = "Dni w związku: \(daysTogether) !! "
  
  
  
  }
  
  /*UIPicker nieskonczony
  
  @available(iOS 2.0, *)
  public func numberOfComponentsInPickerView(pickerView: UIPickerView) -&gt; Int {
  
  
  }
  
  
  @available(iOS 2.0, *)
  public func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
  
  } */
  
  
  }
  </code></pre>