Jonathan Bursztyn Jonathan Bursztyn - 2 months ago 21
Swift Question

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

Answer

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

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

})
Comments