title: How do I get the age after using a date picker?
body: <p>I need to get the age after the datepicker has been used. How would I do this. I can currently get the datepicker to work. </p>
  
  <pre><code>@IBAction func datepickerobj(sender: UITextField) {
  
      let datePickerView:UIDatePicker = UIDatePicker()
  
      datePickerView.datePickerMode = UIDatePickerMode.Date
  
      sender.inputView = datePickerView
  
      datePickerView.addTarget(self, action: Selector("datePickerValueChanged:"), forControlEvents: UIControlEvents.ValueChanged)
  }
  
  
  func datePickerValueChanged(sender:UIDatePicker) {
  
      let dateFormatter = NSDateFormatter()
  
      dateFormatter.dateStyle = NSDateFormatterStyle.MediumStyle
  
      dateFormatter.timeStyle = NSDateFormatterStyle.NoStyle
  
      dateofbirth.text = dateFormatter.stringFromDate(sender.date)
  
      let myDOB = NSCalendar.currentCalendar().dateWithEra(1, year: 1970, month: 09, day: 10, hour: 0, minute: 0, second: 0, nanosecond: 0)!
      let myAge = myDOB.age
  }
  </code></pre>