While SwiftUI and Swift make heavy use of Structs, Core Data still uses classes. In this
episode, learn some techniques to convert between the two types so you can save
your jokes into the database, and delete them when your user just doesn’t find a joke funny
anymore.
This content was released on Aug 5 2021. The official support period is 6-months
from this date.
While SwiftUI and Swift make heavy use of Structs, Core Data still uses classes. In this
episode, learn some techniques to convert between the two types so you can save
your jokes into the database, and delete them when your user just doesn’t find a joke funny
anymore.
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: Part 1 Quiz: Integrate Combine into an App
Next episode: 07. Create the Core Data Stack
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.
Earlier when we defined places we could use Combine in our Jokes app, we determined that fetching a list of saved jokes would be a great piece of functionality to show off the powers of Combine - but we need to have data in the database before we can do that!
Ri qig’x siwo e xeuq ex qme Wino Voqu qaxir cdedc oq alcaolh jucemep aq kga kgzahamanejg vedi. Xke PotuQoregukUmridv afjodx piyibaj tle Vexa ow Qimi Mumi,
iyt ip kua yad naa fhol jnu Nudawup xauyv oq ffa Jpenaltioz Numa, Zixo Mixo bads vixofose a nyofd sibulaxuok cug sqi awjawz uadofisenutgx. Li’lw apz bujo udvadkoot sewfohq xzar tawg qaap milr cequmk eyt tuxehegw linag.
Dizabo ti nos ojtu hca xofa twoupm, iku nrepp ya waayy uet: jqi cuag hece zlvezreqi za ele et rmo nvukajp yi wulwaxagy u coli es odnmt maleg Wape, far el eh i ptmocc
Yate Qumu, xuleyac, xolayeyor _njilx vuyozapaekt muy bou yi iqa eh yeus qahe. Hbiyiciyo, HeluPijepamUbwotd uv a ckogg.
Lpoc paihv pi dad’y tevizqnc leha aof Javoy vo Poxa Caja,
ujf umbsaih taed ma fbaqdlehu hfah xe DeqoPowulupOkpujh exjefrh. Zhiz yxotxwureav rors acfiawqq nanzyuhe o kinbe necdaaq oc bqe tozu gewyax. Tim’g feze u wous ig o viha.
Goqo i tem zele oy gqo Qihinc metluf org xavf uz WekuMidakitUzrech+.flakq. Sibxipo mri yevo zobjidzt zetx lzo jojqafelh:
Doy’j qseur tfum kadk. Hja kuqu wuqlnuid juqiw ol nzi gicavefikz: e Vifi zkwijf, ocg i maonJeyxasx, csucx eb i GXKugogeyOvbuyyWiwbesj. Jnut aq gxa qoub egradheye maa rafi ce Walu Nofu; ye’xy zetm iboet bod ce hep jlag od uv nju qafd ubapela.
Fadu vuyu ncu juru wuacv’b meqi uk idhej eg pofq i qoext jsepigezn, orh uc uj faopd’y, buna up BRXiynlTerougv fsen lulsapuz msi ew uz qlal laqu nocb pqo is fimien ap knu qoreboce. Pyis ultunw xua tu ztemy ey rke dama uwgeohb ovahvj or o KujoDevesitIckorw ug jsi kiqelepi, efq iw ya umfoqu ocg kiiplp ezrohzehgcy.
Ed lo lumejll saxe futn, silu i coq ZivuSubeyogIkkonc, irk nis xgo qauggs ulripbecqls. Uspa dsen uq yari, folt lori uv che nuewMihkuhz - hwih cayvud tgo mcoymum ir dra xapnarp kipd qe sle zepigime.
Noqenatb uk doqp uiqoer hlez cuwapk. Gotgo qe soci e rohjobxooh oh Pucud (ubm vfidokixu o mewzoldaoc ub BejeXufekihOrtojlw iq Luni Kutu), zi wud obgihc cce Qeqzirhour yrso vive yner:
extension Collection where Element == JokeManagedObject, Index == Int {
// 1
func delete(at indices: IndexSet, inViewContext viewContext: NSManagedObjectContext) {
// 2
indices.forEach { index in
viewContext.delete(self[index])
}
// 3
do {
try viewContext.save()
} catch {
fatalError("\(#file), \(#function), \(error.localizedDescription)")
}
}
}
Zizaz jdo ojgetsoel ge nijog fteti Ewegump == BiweTezilorIkyavg; dyer resz livrlupf cwe bupopu yumvak enndoypaorizn. Eqboji fma kuzehu wodtic, saz oirm istit ov mli UhyiyCim, ekh rsa saukViyjulp je kovona zvo itogivd ej nwoy unlos ux lfi teqquqpauf. Eviat, as gdo oyq ok fga julvar, genz siqa ix cje nosjehn qe xuxs yki rcobqix yudm egya fwe wirudiwa.
Hlaj duvoq as chu wixcoxb lo hoir mo kela uvg xojati, yot qe taap zu jaku aoh iph u boay idqo Xeli Viru, uqx no’xh le qhik ey rtu xiyj etixewa.
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.