Here\'s the code:
- (IBAction) charlieInputText:(id)sender {
//getting value from text field when entered
charlieInputSelf = [sender stringValue];
We already have inbuilt method that return boolean value that indicates whether the text-entry objects has any text or not.
// In Obj-C
if ([textField hasText]) {
//* Do Something you have text
}else{
/* what ever */
}
// In Swift
if textField.hasText {
//* Do Something you have text
}else{
/* what ever */
}