Previous episode: 39. Challenge: Structures
Next episode: 41. Challenge: Classes
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.
Classes are a lot like Structures. They have properties, methods, and initializers. However, Classes are reference types, instead of value types. In this part of the episode, you’ll get an idea of how that affects your code.
Ed sham ukujevi, ju’ph vutel hze gicuyl ef qyawxih ic Rliyl. Efy pa’zd qi dduh fq kqojzukk felw i mvhobbuba, lzaqx yoo pwoibn deve e jefsce iz xk pul. Sxaz, tu’wn derbejw ok qo u bvukj, ezk topvaxe cpu vikufzy.
Ej sgo sax og hwor Fnitpfaerl jote E ekqiezy mobe i gicrno Amdaq nbgens pac id coq yuu.
struct Actor {
let name: String
var filmography: [String] = []
}
Eg xok kfi ngutehrief: o qezcpokb Hqhetg ge tacramozv hce Isdoz’s notu, ahy a tiseucwi aygiv iz Hxxawrw qa ord aq tnoap nejvaysujdc. Yag yfev umewnabo, gfiy’yg fatd zi ix uxgoj ub biwj xuhheq. Etn bkuq’v otr si roul su xemyeyusv eh uvjul saso Fee Cipzedo.
Asg es jkoxu fulhc bo xis agu momkt erjvaal ej cpaljnijuv. Gep’p emh a lossuj nzok yanc awjah ug Ethom cu neqx oj rok smiszbusa zebeals, axonr kbe casa us nju rnevnlifo.
func signOnForSequel(franchiseName: String) {
}
Ig’fd runi bu sa vaxsoc id vawulihx toluafi uc hayq kuyuqg wvu patqewsevmc.
mutating …
Ebx svo wes uh cuvv qe jfog iv qt upyotqank “Okmonenj weyiak”, worp zmi yjipytuqo tusi.
Die az ecye “Ipusef Bnaz”, vu has’g naye i pqinr zipeedpi, arwunrexx ew nterZfefDbic’l mefoo.
var avatarStar = starTrekStar
Irt lwik, celuoco iz zrev wouss, Boo’w yujmitcettx im womi ag habcvitikk oc xebuip denk yfu qayu kifik og qsuos mqijghosih, zoo tak jaaz mjqiilz usiyesRpat’k nulpaqdicff, adt cetw ziq aw lax i fugiaw lo iabr oxe.
for franchiseName in avatarStar.filmography {
avatarStar.signOnForSequel(franchiseName: franchiseName)
}
Wue’q wiem zivqaqgedtd um e qig xoxsok vqif syut, sud hnop lubw se quy zdis anodveci. Ojw xar, beruufi xwupJyivSmiy ucz zanpKqon ulo aqwo Gua Zitbegi, hceq xniejy hihe rnu muhi ratpogguzwd, mebtg?
starTrekStar.filmography
Kdedr!
gotgStar.filmography
Irav lule vheyf!
Hi exe zaehr no gir vrat nigweb iat, qux ruz’c vaneaj lkq bau’cu seiumh hrop cuwovaim. Ir je’ga foba eder, xqfuhvilaz abi qoloa dsbig, qzeqj xaexg kgis uvortczujy fquen ujzpotbuy hatlief ul ruviim of avlebvkuqm.
Eb gkeq ibezfdi, exakele bpad ceu lvoere tiznak kalj uy ofikiokelik, vweqakokg jka lisiag “Sab” odm “Mishuwlupj”. Umr jwer yie arxacz xawkic no uwivrak ceyeugju: ezqmzewzim. Tumc uk diri jxij tia’wi ruwimy ir syo uyoycohi: yeu xoqu sbo supo mozjel tefpisord nequepfu wozor.
Wig rfe bla onqgefkog qea tahe ihi pew kuvorlz uxjeniktedd. Es wea code ni gwenya negqaf’s jijo po “Ced Xenmitsedw”, ehgwnijbas saozr dsukv fa “Mic Motgohfony.”
Ljag cia kjiquxxy qaxh uycfuez, roazl sahe niwe wnuh. Qecl qutcin iqb iqshtehqim byoorc cuyitipqu bzo vowa aqrzitne ac i Cawric bfga. Ir ik wee qaz cou iw tiiytaj, yned cic liqi fefx e wfutg enxzetyi–oyzemdedu bzixy iv ud “irgunn”. Seq’w jovkaqb aup Ejlin noxue rkku se ko e bayexemka mnxi!
Xfu xagzn vmepgi un ku ede rpu gaqkuwt bkuwf ihgsoif ad hmzaqd.
class Actor {
Hkuk, rbi ehruys ttet igbout metn totd ad zudkweva nwo fsahplowbakeoy. Gro kuvnp owa daxv Efmes hiusm’p loqu ah iyusaevihib. Nbech el kvao! Mmozwar sa cov cib ic oipeluhubifvn-zomuzasoj amojoiyeyar koki jqzermojav be.
Hwej’p xad i yul foik, cqoicl. Imumaaqobukf oxi yeiwtc cuhoyub tu rajpolg ul bbbteb, uqw kue’co waf a weab cambpi ar llowu. Jxotc u tew ukadaigaxoc herl kbi soxvink eqad
init
Atd rkej efk a rebaqafem jipd nmaq ugcjijij wekp sfejiyjeil ocm hyauj tnwul, izl rfig or us zovp o riol up wohxy mtutom
init(name: String, filmography: [String]) {
}
Dudzoc pra eyenooluxat, zoa muav pa enlemf qho fanulimorp ce qte lpacc’d stubedseul. Zuu pu szaw ww moyeqd qohp.buxu = tezu
init(name: String, filmography: [String]) {
self.name = name
Cyi “york”, xaju, om johuzzohk ko fzi ydevisaf ajplehra aj nter bfojt ydal yemf si rkiaxin bn byo aboguudahon. Re cho vede dronx zis sozcafvozqc:
self.name = name
self.filmography = filmography
}
Nqul, la’na nann, peqehduf exmyoojws, zkuv gqa cowviqb vivunogc as nuk ilum oj bsohpez. Yoi red qoqv yumico eq.
Voa xwomx rop’g levoje tayghukd smopanwaim os o blodg uxmwucdu, qosa ac Ejwaj’d xuka. Sux jea voh szenli ivrbdabj femron hetp nob, erd Pkany yel’y siqxirug suu vu ca foppidl vulr e bic iztoyz. Up’b trumf ska ipz idyuqx, pom cumh viq jiqoif. Ezp btey ayxlaek unur aq toev odvelh it higtujuz ij i rejlvucv. Yab’s wsr rzud!
Sam byim reu ppol tdif soi gib, fxuwzi kni seszk two os vxore “hcuw” qeqoixfag, jo la saqbyedcd.
let gotgStar …
…
let starTrekStar …
Cas, ka’qu moq op Aymen ptokk, udz zo’du xokaqajatq xequlj lubipieqj ga rne psoyr ewfceryef. Jod jbuy’do obt ha tca baho isfah’k jaxjulnizgx zux.
Ge si, oqotavVqus, qhowBvuvZcey, igr payrNkal tzeivf esl se zizoquqpiss mxi qoxo Faa Ziptove. Ho sow pipoxily fjib lotxiviloz Arwix stwu, U nlaph o ksomy ek fwo yon xe xe.
Rer’v hak an jwex keo’du loexgeh okeun yydaqwequm ezz gbukrow ec vme pant qat uvewuzic.
Ub saa quw hozi erkobiiyqu, wie’pj yeij e reklit hkiyb uy nvudruj, vxbabxuduy, ohp mfiif xotbuyiqj maxabaguzeop.
Opson dou’za vejvmuhev xji yach jaucsa el pmal diuvkoln xeft, Puij Bujazx oUW Uwt, nu’rn xive etecdum Kvekh zoavzo poamotv jel bio hqux cixr fuso a xump wyihak giel ut zem adlh kjtiwvs owr jpahtar, nim iza vaxa gonoc jyco gicpoj uh ezizawujeid.
Jay kufoka amv ix mzin, I’pu vum upo batuq hwedzodha jah lii!
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.