title: Compare Current Date to DatePicker Value in Swift
body: <p>In my app a user can select whether or not they are under 18 or over 18 years of age. The user enters their Date of Birth using a Date Picker. I need to make a function that will compare the current date in MM/DD/YYYY format to the DatePicker date to see if the user's entered age is over 18.</p>
  
  <p>My current function for setting the DatePicker text to the associated textfield is:</p>
  
  <pre><code>func updatePicker() {
      var dateFormatter = NSDateFormatter()
      dateFormatter.dateFormat = "MM/dd/yyyy"
      dob.text = dateFormatter.stringFromDate(datePickerView.date)
  }
  </code></pre>
  
  <p>When the user tries to go the next page, the form is validated which is when I need to compare the dates and display the alert if they're under 18.</p>
  
  <p>Just not sure where to start with date string evaluation.</p>