How can i pass a function to run inside a function when passing it inside a parameter? .. as example
func thisDelay(_ passFunc:() ){//
let seconds = 5.0
DispatchQueue.main.asyncAfter(deadline: .now() + seconds) {
passFunc
print("test2")
}
thisDelay(print("Hello"))
//..Hello (is printed right away)
//.. test2 (is printed after 5 seconds)
// As seen Hello is printed right away .. shouldn't it been delayed with 5 sec?