The question may be a duplicate but I couldn't find a right & simple answer matching to the current Swift version so I decided to ask the question "again".
func mainFunction() {
myFunction(Callback: {
print("") // should be "send this message"
})
}
func myFunction(Callback: @escaping () -> String) {
// do something
Callback(text: "send this message")
}
I'm using the code from above but I'd just get a bunch of errors. How is it possible to send via Callback(text: "send this message") the text parameter back to the callback-caller (myFunction)?