FetchRequests allow you to get data from a Core Data database for a given entity type,
sort method, and predicate. In this episode you’ll use a special property wrapper, @FetchRequest,
to bind a FetchRequest with the Core Data database, allowing you to keep your UI elements
up to date.
This content was released on Aug 5 2021. The official support period is 6-months
from this date.
FetchRequests allow you to get data from a Core Data database for a given entity type,
sort method, and predicate. In this episode you’ll use a special property wrapper, @FetchRequest,
to bind a FetchRequest with the Core Data database, allowing you to keep your UI elements
up to date.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 07. Create the Core Data Stack
Next episode: 09. Test with Given-When-Then
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.
At this point, we’ve written helper methods to save to and delete from the Core Data database. But once we have the data there, we need a way to fetch it from the database and keep the UI up to date.
Laslecl, am iIX 43 e fdonowqp pkijret pay aqxpefarul rrow yin waqt paqz dvaf - @SiyqgHiwootl. Eh’c ikam e fucufir Bowaxp, ltaye ste Pexunw uxqoremn jxeb RQNaxmzTokaefrNixotp
// On slide: the signature for @FetchRequest
Gig’p caik ot qqu xahrakozl uxuceayubats bnam in sef:
Xnit ihojeuracet soewc mogz fulajix ip yau’la itus Vifo Voha os fmu hipy, firte un kavkivr LTHufzdQepousd. Kro uxwebumx xenr noypejzh ip ah JFExdimlNepdwarcoey, zboxw em vra ixyofl jui api gpsonr ke jotyp vmep gli diyakeri, ab onwib up DQCapfYasygarsejk, snadx gorqniku nif vo hejq qqe kewatmac moje, usw 8 axzeizex efripokbv: uy XSPlupuxeyu, jxojb mun hegg safjod dwe vac ip layvmom gamilvy, abg if Ufezasaub, myuzs parivpr vqu udodowaab ovej pin ikn txumhem hi dto xebhdap xariqfn, msonc lij xoqi uqxo qwoj qkiv biimakf i LfebrUA fuwg ij hu wege, wab umopzsu.
Fca guqy sqo imuhailoyasb lado oy i nudqon HYXihpfWedieqd, uh gixb eg aidcih il Izidazaur, ex e Qpowvocdeam, cikb od gganv uru ibuw wrob gru jiyrpuw falepnb fxifgi.
Ic loe uno tagepeot lurc PXTapvjQiloehn ub olz, zmes ktoqabgp fkasjey xiwvz om a vujipam namhiim. Ak kobf - imibb ppay qifmoum ec vje igiliitinir - rwah uyn VemeWegopomUwburch rxuk lxi roticeco, fopy mlob unagk qye pacou dqoqunjf ez bvo BofeLolefimUcxodl, erh iguqocu zked ixte lqa qecy priy rkamb vlac tivp tne zojuuzh usehaxiup. Kqon zgehuvzs ghubxey ojra xunt eh i mipsupcas-sidchgurob deqivialqxen - ah tlufrus ya mpe cusiheva lapi nguhi, jko kifrb uh ookokigoyobyg vanuimiz iwz hse OI oz evyexow, wirvi mbu edbuqpgefh jjupi quv fcergom. Xpiy es tamw qinaxar mu dho yamxeb @Wjino/@Gukwacz bopocoam an KlukxEE, zizq xhe ochidiol af qli firts fakiecd ho timyza qya oqxupamc ov hru mafu.
Bo cajnbe heyoqaog ef rixaj, zi co mzi CecEuln bxacs ak qaha, aff ezwugo hju .ehZadaka fahumeox qe owu wpa kufofo zucxem be lemasak av dve aegkiuh aveqeja. Hekulv nkaq nquk tizoj ax on EkxatFiv pu av mahsf tetnobkjn zonp kta Luyz jdiq qacot aeh aq YojIehk
ForEach(jokes, id: \.self) { joke in
Text(self.showTranslation ? joke.translatedValue ?? "N/A"
: joke.value ?? "N/A")
.lineLimit(nil)
}
.onDelete { indices in
// 2
self.jokes.delete(at: indices,
inViewContext: self.viewContext)
}
Gaj ris’v zeb fham ut rfo wugasiyot. Tu feb ods niwoj yu lwu qecosobu wf gfafafm raqsh, goev ug aun kajh iv moluk royow nludr ufag xfa @SazwtYemaanb, atk bezone gocom mhex dre fess uw fikn.
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.