I wondered if there is any way to delay the return statement of an function... an example:
func returnlate() -> String {
var thisStringshouldbereturned = "Wrong"
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
// Here should be the String changed
thisStringshouldbereturned = "right"
}
// The Return-Statement returns the First Value ("Wrong")
// Is there a way to delay the return Statement?
// Because you can't use 'DispatchQueue.main.asyncAfter(deadline: .now() + 1)'
return thisStringshouldbereturned
}
Thanks, have a nice day and stay healthy.
Boothosh