add a toolbar with button to sismiss datePicker and actionSheet
toolbarPicker = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
toolbarPicker.barStyle=UIBarStyleBlackOpaque;
[toolbarPicker sizeToFit];
NSMutableArray *itemsBar = [[NSMutableArray alloc] init];
//calls DoneClicked
UIBarButtonItem *bbitem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(DoneClicked)];
[itemsBar addObject:bbitem];
[toolbarPicker setItems:itemsBar animated:YES];
[menu addSubview:toolbarPicker];
and add these actions for done button
-(BOOL)closeDatePicker:(id)sender{
[menu dismissWithClickedButtonIndex:0 animated:YES];
[txtDate resignFirstResponder];
return YES;
}
//action when done button is clicked
-(IBAction)DoneClicked{
[self closeDatePicker:self];
menu.frame=CGRectMake(0, 44, 320, 416);
}