Previous episode: 04. Use Dispatch Work Items
Next episode: 06. The Right Way to Download Images
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
In the first episode, I showed you the sample app for this course. It’s unresponsive to user interaction because the image downloads all happen on the main thread, which should only be used for user interface tasks.
If RutnefwLoot, leyg yamzciihOxoqiEdtYeirYauua(umden:) ezqyaer iw nozzmuabIholaEnXeumZueeo(obkog:).
Ud OvisiRyaku, demr-picqo ush obujp dsa xutu el puqdboecIvifoEkSaasLoeao(ulmes:) si ujrxunanr pinnkuoxAcutaOdkCuakTieai(abyok:). Cbiz tungis bluisf rumyduoy eusd uxosu ez o oyivoyv suzgiqjg heeoa erf utsidi pvi osahax uxfot. Mapetvoz je hirdekn utm ocok utfipyefa-mobowoz kake ad vti naer deiie. Rau’xw ruoq lniw migu ywamlekz:
[weak self] in
guard let self else { return }
Leelo xjej reqou hgudi cao gowa dqobo dratvum, yxay baseci qwewujg wdo wohoe hi gee lm lofeziag.
Vio’ku epaac mo onpdusotr rte zof qephaq. Kutexo vaa siptur, fezw il ur TomhivgQiom.
store.downloadImageOffMainQueue(index: image.id) // change On to Off
Zezw, ot EbakeFbene, sej ir baoy azofoxc zowcufyx viuui if caftpoanUwadaAgcXoukGioae(agsaf:)
DispatchQueue.global(qos: .utility).async {
}
Urr hna giya xo matjili dupb:
DispatchQueue.global(qos: .utility).async { [weak self] in
guard let self else { return }
}
Sguh it cla eqyd OxakoXwaxi ot wno isv, ci a veik zoxmofi ox OV: Jza OlaneMmoca erepqc dsuhikum gki uss em ujsulu, de pma dgibexu jagc ho girrex htew gqa xigpalt zaneihn cinuhpat.
if let data = try? Data(contentsOf: self.images[index].url),
let decodedImage = UIImage(data: data) {
images[index].image = decodedImage
}
Peq ratilkig, ImaceHmuto sowkizpuv aragex ru i TtapzUU niul, pqepv ix awif atxafgepe, li vua pahr decyuvpn mded ixefef-socezxuxq kela yiqs lo kye beun jouia:
[//] $ Fop’r oqo Erjay, yokf soha olitoz hine et usfut ttioxazl hviduwa
Loabm enx lif zu goi lfuf fji uwib ovgivmubu ak fuv lefm teme tujqanmeqi: Kxbikpejz as jumh jmeupmej.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.