I would like to call the @autoclosure parameter inside the block dispatch_async.
func myFunc(@autoclosure condition: () -> Bool) {
dispatch_async(dispatch_get_main_queue()) {
if condition() {
println("Condition is true")
}
}
}
I get the following error.
Using the @noescape close option may allow it to exit.
Is it possible to call the @autoclosure parameter asynchronously?
Tested in Xcode 6.4 (6E23).
source
share