daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Dec 11th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (UIView *)inputAccessoryView {
  2.     if (!inputAccessoryView) {
  3.         CGRect accessFrame = CGRectMake(0.0, 0.0, 380.0, 215.0);
  4.         inputAccessoryView = [[UIView alloc] initWithFrame:accessFrame];
  5.         UIDatePicker *picker = [[UIDatePicker alloc] init];
  6.         picker.datePickerMode = UIDatePickerModeTime;
  7.        
  8.         UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
  9.        
  10.         UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self.parentViewController action:@selector(setBlackoutPeriod:)];
  11.        
  12.         //closeButton.tag = indexPath.row;
  13.        
  14.         UIToolbar *pickerDateToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, -44, 320, 44)];
  15.         pickerDateToolbar.barStyle = UIBarStyleBlackTranslucent;
  16.         [pickerDateToolbar sizeToFit];
  17.         [pickerDateToolbar setItems:[[NSArray alloc] initWithObjects:flexSpace,closeButton, nil] animated:YES];
  18.        
  19.         [inputAccessoryView addSubview:picker];
  20.         [inputAccessoryView addSubview:pickerDateToolbar];
  21.     }
  22.     return inputAccessoryView;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand