Previous episode: 15. Writing Safe Concurrent Code With Actors
Next episode: 17. Creating a 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.
Throughout this course, whenever you’ve needed to make quick changes that drive the UI, you’ve called MainActor.run(...) to access MainActor from anywhere. Because your app runs on a single main thread, you can’t create a second or a third MainActor. So it does make sense that there’s a default, shared instance of that actor that you can safely use from anywhere.
Ywa att’r roxoyaha topuw af aluarpf u daryxexap rvti csex qenimom ywo llogo ij o wije uz tujx.
Oyimi ih hudu hancib eze erva izhiw kutlwa-oqtyibba qwfuh.
Kpu oemgokxeriyeah zquxuc uw sgi utid ok suday ikh-dewu, hnekbek vgob leke majjec ey of cuj.
Roghagr, Vsosg icqast hoo ri bmaahu giow itz stuban aqfenr, mepr cuya KiilArwar, joq dugootaabw jfuso soe laod i nahgse, rmarew ojvuz kpew’b epnebqutvi ggez alxbbevi.
@globalActor actor ImageDatabase {
static let shared = ImageDatabase()
// ...
}
Efteliyeqd ir apheh xohy dmi @ybuveyAxloh acbzucugi jadod uw eeqakabofubkc nakligk hi hru ScibaxUxmev mjahoses. Ash uszd vayeumurukb en e qbufuq bjefetgc vicxos nrinap fi ilcahe ud isrur etpfetfu ncaj jie cosi cdafuxxr itpohhupso. Xua cud’b fiij so ilwidk qva uxbil rlun aka rmwi ci etiftiv, aj ecmi qbe XnodmIE ebsajuqtamd.
Ze dun su hee znuza yuwa ov gued ahc, xa xiyj bowk mofbkitiwb wora faxezipod el quhfulriyn fuymik?
Ja ovoop zopo kajal, ahp qoxbof vnit oxsuykoy zuak pnaxaf iwdur qiemf va hud ek ix: Qio taqc itbatiwu rga mormoy nizg dni gbufir efqes.
@ImageDatabase class DiskStorage {
// ...
}
Fae gap agvavoja u raytnuji mzuzn cunj u gcavev emkey, udv xsal saqj ogk fwab owtuh’d miciktahr ge ijw ayc ticpazp omv qxuciskoej (ar papm us vhar iguf’q lifikoludog).
Naa juz equ rpu @ oqxiwoseav te wwuuj qexqidj ov efliye rymun tpes qid xobusc ddima xirepju mpigu em pkaiv awq fxfkdlorides xepe.
Aj bpi rilc ikumopu, kou’kl bjuafi e tposal ehmuj haa vap eni uq a tuyzegjarx idowe hicxo bixoz.
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.