Created
January 15, 2020 01:20
-
-
Save dilames/9e4a5f46cf099cd918ac59ffe03f4c4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: NSViewController { | |
@IBOutlet private weak var textField: NSTextField! | |
@IBOutlet private weak var textView: NSTextView! | |
private var bashService = BashService() | |
@IBAction func execute(_ sender: Any) { | |
bashService.execute(textField.stringValue) { response in | |
DispatchQueue.main.async { | |
self.textView.string += "\(response) \n" | |
self.textField.stringValue = "" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment