I have this code:
DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async {
let url = URL(string: itemImageURL )
If you're creating a property using the Dispatch Framework and updating the UI with some animation within a function it might look something like this.
let queue = DispatchQueue.global(qos: DispatchQoS.QoSClass.default)
// dispatch_after says that it will send this animation every nsec
queue.asyncAfter(deadline: when) {
DispatchQueue.main.async(execute: {
self.animate(withDuration: 0.5, animations: {
self.image.setWidth(35)
self.image.setHeight(35)
})
})
}