Swift 4
self.yourTextField.stringValue = "Your_Value"
Note: Fetching value from self.yourTextField.stringValue at that will get warning message i.e.
To avoid this kind of warning you can use like this (suggested way)
DispatchQueue.main.async {
your code ...
}
OR also refer to this.