Set Date picker And Time // Set Date picker... UIDatePicker *datePicker = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, 320, 50)]; [datePicker setDate:[NSDate date]]; datePicker.datePickerMode=UIDatePickerModeDate; [datePicker addTarget:self action:@selector(updateTextField:) forControlEvents:UIControlEventValueChanged]; [txtDate setInputView:datePicker]; // Set Toolbar for DatePicker... UIToolbar* dateToolbar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)]; dateToolbar.barStyle = UIBarStyleBlackTranslucent; dateToolbar.items = [NSArray arrayWithObjects: [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil], [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil], [[UIBarButtonItem alloc]initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(Done)],nil]; [dateToolbar sizeToFit]; txtDate....
Programming Tutorials For IOS and React Native