Please have a look into the code below:
backgroundthread.async {
return self.mycallback() //return string, int etc
}
I want to return a
Your function would need a closure like so
func getAppConfigFromDB(_ key: String, completion: @escaping (String?) -> Void) {
backgroundthread.async {
completion("string here")
}
}
When you call your function you would do
getAppConfigFromDB("key") { (returnedString) in
//returnedString is Optional("string here")
}