title: UIDatePicker with UIToolbar
body: <p>I'm trying to implement UIToolbar on UIDatepicker to dismiss it when touching "Done" button. But when I tap on the button, the datepicker is scrolling and the action button doesn't work.</p>
  
  <p><strong>Here is my code :</strong></p>
  
  <pre><code>datepicker = [[UIDatePicker alloc] initWithFrame:CGRectZero];
  [datepicker setDatePickerMode:UIDatePickerModeDate];
  [datepicker addTarget:self action:@selector(changeDate:) forControlEvents:UIControlEventValueChanged];
  
  UIToolbar *toolbar= [[UIToolbar alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,44)];
  toolbar.barStyle = UIBarStyleDefault;
  UIBarButtonItem *flexibleSpaceLeft = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
  UIBarButtonItem* doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(dismiss)];
  
  [toolbar setItems:[NSArray arrayWithObjects:flexibleSpaceLeft, doneButton, nil]];
  [datepicker addSubview:toolbar];
  </code></pre>
  
  <p><strong>My datepicker :</strong></p>
  
  <p><img src="https://i.stack.imgur.com/q6FZx.png" alt="UIDatePicker"></p>
  
  <p>Thank you for your help.</p>