title: Minimum and maximum date in UIDatePicker
body: <p>I want to get the minimum and maximum date from a date picker, but minimum date should be "- 18" of the current date and the maximum date should be "- 100" of current date.</p>
  
  <p>Suppose current year is 2018 then I want minimum date 2000 and maximum date 1918.</p>
  
  <p>What I have done so far is : </p>
  
  <pre><code>NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  NSDateComponents *components = [gregorian components:NSYearCalendarUnit fromDate:[NSDate date]];
  
  NSInteger year = [components year];
  
  int mindt = year - 18;
  
  int maxdt = year -100;
  
     // NSDate * MinDate = [components year] - 18;
  
     // NSDate * MaxDate =  [components year] - 100;
  
     // self.datePicker.minimumDate = MinDate;
  
     // self.datePicker.maximumDate = MaxDate;
  </code></pre>
  
  <p>but I cant get this integer to my date format..</p>