Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ambiguous use of DispatchQueue on trying to use main thread

This is a weird issue and I can't seem to find any help. On Swift 3, trying to make a call on the main thread I try to use DispatchQueue.main.async, but it doesn't compile.

Any ideas would be helpful.

enter image description here

like image 744
Jonathan Bursztyn Avatar asked Sep 22 '16 16:09

Jonathan Bursztyn


1 Answers

Try this code instead, this is the Swift 3.0 syntax:

DispatchQueue.main.async(execute: { () -> Void in

})

For Swift 4.x you can also use:

DispatchQueue.main.async {

}
like image 193
Rashwan L Avatar answered Nov 09 '22 13:11

Rashwan L