I am creating an iOS app in Swift that uses Firebase as the backend. The app gets images from Firebase storage using this code:
imageRef.downloadURLWithCompletion{ (URL, error) -> Void in
print("Firebase sent something back!")
if (error != nil ) {
print("couldn't get pic")
} else {
print("about to dispatch async")
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0)) { [unowned self] in
print("got image")
}
}
}
}
The line "about to dispatch async" gets printed, but the line "got image" doesn't. Any ideas why dispatch_async isn't working?