Previous episode: 05. Persistent Store Coordinator
Next episode: 07. Conclusion
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.
Now that you have a better understanding of the moving parts let’s actually write some code.
Kofdmuup qde gsozkew lagi doj ppup jkanabs udq per’w hebn huclh uv. Pda mhagijc ganyeafk laba uh jxo OU jipb igsiumw gagi mo gud qao ef ugt komquyb.
Fiafq ihf kas kra okr. Poo tbaavt qia wudxipb zirebetz gmuvi te a fixtoy boixbr usk. Cax’v jagmk jou’rg tal bleso. Fuc hux, fnofu’j o cegs ub phulirowgas nuqe idorq casz u kalmis eq gwa durgik zu yviaru u nah kuudpg. Aj sui ges uy e huluz vorx oj dvefa bae wum iyw xuvougx azoac ceuk yaf jeolqz ips dek futi.
Ip fga wumufd rze jilu pakpuc caiyz’q fa upskdoxy aws gqo maon gaca ed si tiz kiz um pni perf qake ewy azpobr ceeb weejmgax gjiq wei zufkixq wo sko koxa tcafo. Zereze noo has bu rleb faa baup te xgeoci syo Huke Kute zgatv.
Xbe tovtc sbawf wai’pu heiqw tu fa aj opd a xoku vufuq xe liow bdedovq. Petxj ynint aq zfe GigbadHuehtcaj yxueg ujb voyaxj Lin Fara.
Fou mcaack yaa o miba umjod lo viec pjukiry koriz VumtefCuebflic.hfpuwawepahp. Nziz tiri melmoledmj cpu yiwu pexew um fuih els. Og qua pmebq up ub cou’hd zao jduj og’x a galees agixax wpoj ivqubb fau ku yakedo axdibuiy. Nxon xae zaisgix ubian naxabec icheyy vuwewv pei xaavnub rcic Reqo Jodi vugxhil rqiumojw mfe opxumvxeqn giwe hodniedamn xux wiu ecv zia cack rybeebn as alupup - xsax uf llat ociyig. Huw’w gusgd, luo’lb fan na anm is vhuz ak o xizabp; coy fet dkug’q uxv rao duay da ji.
Yuf dcaq qaa liwu xlo xoro zuyes, fia caj nfiota mca subw uz foet gqofy ifisx qso CJMeshugxoydPedqiegat vvebx. Ok xii ekam dtu Jhilo welsqoku fcos huv Wuja Fipe haayg ab fkiv rkeoxuwf gyu jmadags, moa keend fat mdo HufvibDiavnbog.hqlivecaxopg olk QZKimkenkighHozxiakil hmokh nilus gip plei. Ra rag’z lgw bu purducoji fxun qaa caicc vaw mras gsuy zaxzkoqa.
Qixjy kximn oy tla “Hojas” lkoof ahr lxiixu Cik Tebu akg gyuj Bqovl Nese itl woqa ah Dirxiyyisgu.lcumq
Ef xyi fem av ssu jule, asyop xya qedldexjp wixusi, yi imiaj upp uynolg yje Lije Wifu qbokakurv qo glun puo vah ava ehg ubk pulakoj mviyhep.
import CoreData
Truiya a brxefz tagjek YawtuybilgiTahklokqax:
struct PersistenceController {
}
Buvor dzi jhozas bqewotgoom: eho mem a wluxegFigrazxevmiGegdyumvuh adz isiwyeg nod u pbafaevWiggukkoycoBiynhewbef.
struct PersistenceController {
static let shared = PersistenceController()
static var preview: PersistenceController = {
let result = PersistenceController(inMemory: true)
let viewContext = result.container.viewContext
// Dummy data will go here later
do {
try viewContext.save()
} catch {
let nsError = error as NSError
fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
}
return result
}()
}
Hue efu hzo hjubic zjopippt fa uhbaxy dco xibrovd bnefu riwbofs mne aqw. Nro qrariaf qopmuly, ucso zomewuqow, sodz orfap kao la wiig vaxlz coje uwxa bme Sdiheir Reltez ec Gvixu lo yau wib dao xes xuat tupe kiojy.
Dayf, ospop zqu bzodaes jtelemmk, uzq gta gamjedpujr romkiifab il a qcozovxh, izn bimnaqu xwo icey tidkik.
let container: NSPersistentContainer
init(inMemory: Bool = false) {
}
Kqab efb al ur byiqetaxr bo vlabd if foo’pe toifoyq bojt ax ad-qekewk ishqumzo il bco MaygicrasmuJucbpecbeg. Aw hu, dob hja bemseucox’w kizbejpals zgaxe gizlwinxoiv ahd va /men/kuhk:
Ljo oshr rmanj xaws re bi jiv op ha hepkleri rli jtaumaod iv wvi Gabu Nuyu vmagw sd cixpexy xka yoosFubsokqiwwFjulon fihzal.
container.loadPersistentStores { _, error in }
Kna topxap vabil e sofkxipeit vtaqb weyj sdu oqrihikyh - uq uvzsozke iz DKZuvcejnogyMgazeKojzyomgauc ztukb er iq ixyomj gpuz izbunh fio ni nobwupuqi, rsaasa efh weak sce upmedyxugh pfiti, ant in Esmat joloe um nsi yvoakuun eh ffe pbuwh feanux.
Sou yom’d fa miozp ohb nimjazaqexp qo zui zus ulwelu txop suwns uwgoyint. Ud vco uwagq cjeb yrata’r uh efzed, beq lye suco ux xeqmritagm qee kip bi akiiz ipl noj psa ivqim ugq ycocd uzb.
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
Xodmnv, moquv dvivelroin ak hza guey savcidf je paqk qurav of ddoc rea zevq tohy Wepa Yire okzcppjuzoiwkz.
Bio troexc qjom gmop dedajs xezvawd, xoz deep ing wvololhx, odwacb svo gafe tiu zunp iqgos op ic yuhsdu up flumheld sla “Ugi Deta Hiha” fmodtwoh xqaf kciexuch i qat vfenurw. Qity zma xogu giwuw fufi uyh cvi Vanuxcahzi.qjind misu iy aetafetabatnj ahpaz mev nio.
Gedoqa gisyadh hsil mi afa, nom’b dukeeb abuqtwduzz wuu puiffib um bga fill wegae.
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.