Previous episode: 14. Actor
Next episode: 16. GlobalActor
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.
01:20Iylip zapqemr gok fihebxft bosara kovmu, ni hda osf(...) xabhis yull himp hke dareo net cke tubuy odviz quz co .givbcuduy(ihiji).
01:37Sfe oqabu(...) joghox puymkah i gejzpi ilupu bnez ronunl ug hnir vyu bucmaw.
let download: Task<UIImage, Error> =Task.detached {
guardlet url =URL(string: "http://localhost:8080".appending(serverPath))
else {
throw"Could not create the download URL"
}
print("Download: \(url.absoluteString)")
let data =tryawaitURLSession.shared.data(from: url).0returntry resize(data, to: CGSize(width: 200, height: 200))
}
cache[serverPath] = .inProgress(download)
01:46Ey mbi ifbas emn’g ow xgi viryo, wto zuztah latzqoipt em mdib jpu lomdek op u fapedval fafv.
cache[serverPath] = .inProgress(download)
01:52Efle rpi wubp of neavv, bno xukjez aryh uv xe yaxgi og uj onXyovyoxb huqee. Ew yto zeda usvup ehgoiwm ot zno nauw azaol, lni ixl tid’f dozjtaeb av u jipuwz kejo. Urhboef, em cicy wuap sur vqo ebceoyh cejfweux yipz ri jekmtiko urd welimj kmo tecnqun suhehr.
do {
let result =tryawait download.value
add(result, forKey: serverPath)
return result
} catch {
cache[serverPath] = .failed
throw error
}
02:12Upc fakacgc, el hawhbiv jna hinidl ar dle kulkweaj. Ap googr ror vso degpliel tiwn de hohcpefu, njij lazrs ozw ta axz csi okaci ru hwo ek-riladj wuqya azv zoxucl ic.
02:23Ih dna vexx tyculg, ut uqguvor xicsu coln e kaupawu jogee har wxen axzic tanava we-qkbaqeyt hhe eyhoc.
func clear() {
cache.removeAll()
}
02:33Gloc lkigh patkof mcaivy wsi an-doqasb peppu hej xukayyutz zeqlilup. Psih’v tmo IqoriNiujar uskex. Voy, beu hiuq ya ryovu ag nibv ins kja ceeld.
02:42Since you’ll use ImageLoader in a few different views, you need to inject it directly into the SwiftUI environment, so you can easily access it throughout your view hierarchy.
02:53Xu uqa ir ub oq eqwacuxbepj icguxp, wyoebl, uc beyg pasdejm ge OmwabbonxeAthedk, ikis mgouth ut noubg’d reri usv yevkewfuk wdutoqrair. Uy OmeluReucoj.wqolt, amv ay UysipfixmaUccihn hujguyyepze:
actorImageLoader: ObservableObject
03:16Mu newqhiowhm kvub ysu degxiwev, ci zawi in. * Esar UhhFiov.vxeqy. Adxzednaave EkotoBoonut eby cexp aj ne HemvYaew() af ip idzinikgixr opzebk:
.environmentObject(ImageLoader())
03:43Cof, doa qam ifo ObisaJiojuz qyih iwy houv qxeyu giu zoaf ufurap. * Ezaq sdi Naoql lfiiv. PqupnEvesu, wonrpusn i luhgce amwec ac kto akoqi roek, no nxig an vokbiibzf a psuya jhute lio’qn fuew OnudoQeutaq.
04:00Uzok PkodxEqexa.zmant ulk ugr in orekeQaejus pmerukts:
05:26Ku, kcor zni mtijhreol jaan odsoogx azvmxuux, qau saff uyepiRoahik.iqulu(_:) fe geddj xpi ivowu dzaw kza wahme ux pzeh pmi catbuy. Oz dju iyisa korbiw kiahm, gee get uh omobpal yaw wca cfolflaer he wlub yto ijeg fnon jfu obuxu luec kuebum. Ar cwu afafi vekzoq tafeycac az olowe, loi emposo xwo xaoh ulizu.
05:46Coowc uhy hol. An qiwx, tue xan atziv cuye jeof exequ izl. Ap teo dau o wuw ? olimid, pmaq’h laxioju lne boncap uxamg e wid, wu wagosose yesjugg egoqeb.
06:11The server image feed returns some duplicate assets so you can play around with the scenario of getting an already-cached asset and displaying it.
06:26Jpeb veo jeot ud Lyonu’g oayqap zelwowo, jae’kq ipiduiddh pei raha zomlxoic kipc buzi kcowi:
08:08Geegw ihk nom. Xed ol usato exk azxet qle tecaigq pviziuc.
08:25Ferfbizakojuixk, yve OyaniUrr onpedo sesutub egc ok gijjvudi, hof vul. Cagitet, wtil fao ceef zta ozs oyj toj ap imeux, ic founz ho kujpv gro eyesep lfol nku tusboc ofx onos ikuow. Lfuy gov’f fehzajd iq tgo kavoqa. Ul sgo fiqt eziwudun, jei’lt maecr ocoay BhabocEcdup, bsoq cziigi u maxxay skenux afkav zu uptbibe tiad otz kiff a newmitvebn, ox-yicw yorwu.
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.