Here\'s the code:
- (IBAction) charlieInputText:(id)sender {
//getting value from text field when entered
charlieInputSelf = [sender stringValue];
Check whether text field is empty in Swift
@IBOutlet weak var textField: NSTextField!
@IBOutlet weak var multiLineTextField: NSTextField!
@IBAction func textChanged(sender: AnyObject) {
//println("text changed! \(textField.stringValue)")
if textField.stringValue.isEmpty == false {
multiLineTextField.becomeFirstResponder()
multiLineTextField.editable = true
} else {
multiLineTextField.editable = false
}
}