I have a button that when pressed sends a text string to an NSTextField
.
I want to be able to send more strings to this field when a button is pressed. However, when another button is pressed it deletes the contents inside the field and replaces it.
@IBAction func t1(_ sender: Any) {
solution.stringValue = "- Test"
}
@IBAction func t2(_ sender: Any) {
solution.stringValue = "- Test2"
}
Above is two separate buttons.
If t1 button is pressed it sends "Test" to solution.stringValue
.
If I click the second button t2, I want it to also populate solution.stringValue
without deleting what is already in the NSTextField
.
@IBAction func t2(_ sender: Any) {
solution.stringValue += "- Test2"
}