Closed codwam closed 7 years ago
Yeah. It will alwas return a date. I probably have to set the date to textField.text too (If it's not appearing already).
So how to fix it? I have add a property,
var isEmpty: Bool { get { let text = self.valueForKey("text") as? String return text == nil || text!.isEmpty } }
And I want to ask another question: textFieldDidEndEditing doesn't effct?
Currently there is no way to achieve this. I may need to fix it(If date isn't appearing at the first moment).
Hey @codwam I forgot what was the actual issue. Could you please remind me again?
`-(void)doneClicked:(UIBarButtonItem*)button { [self.view endEditing:YES];
NSLog(@"textFieldTextPicker.selectedItem: %@", textFieldTextPicker.selectedItem);
NSLog(@"textFieldOptionalTextPicker.selectedItem: %@", textFieldOptionalTextPicker.selectedItem);
NSLog(@"textFieldDatePicker.selectedItem: %@", textFieldDatePicker.selectedItem);
NSLog(@"textFieldTimePicker.selectedItem: %@", textFieldTimePicker.selectedItem);
NSLog(@"textFieldDateTimePicker.selectedItem: %@", textFieldDateTimePicker.selectedItem);
}`
Changed you project "doneClicked" function like above. Then click "Date Picker Mode" TextField, just click "DONE" without select any thing. And check "Date","Time", "DateTime" selectedItem not nil with the console log.
case IQDropDownModeDatePicker: { return [self.dropDownDateFormatter stringFromDate:self.datePicker.date]; }
while I didn't select any items, it always return the current date