0

I am write a subclass of UITableViewCell to loading some image from internet but when using dispatch_async it won't work imageUITableViewCell

class imageTableViewCell: UITableViewCell

private func updateCell() {
    dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0)) {
}
}

error: cannot convert value of type 'qos_class_t' to expected argument type 'Int' fix-it replace "QOS_CLASS_USER_INITIATED" with Int(QOS_CLASS_USER_INITIATED)

can't figure out why,any idea will be appreciate

jin
  • 57
  • 1
  • 9

1 Answers1

0
DispatchQueue.global(qos: .background).async {
    //fetch something
    DispatchQueue.main.async {
        //update UI
    }
}
Michał Kwiecień
  • 2,734
  • 1
  • 20
  • 23