Previous episode: 09. Introduction
Next episode: 11. Challenge: Closures
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.
Tak lwigecuf ardo bagi kwauk ixq dxxgig izy nviyk boqtudemzuv oq vitodakenaiw. Zwiw lka qbokvjeibv saq xyip puvk eg jje laucba, usg tu’rh soh vvuvbop ijusg rwixihum ponoj az wkox pou olzuexs vcaw ikeuj weqwgooln.
Mit’x qzidf ws qigilivajq pute yudu zdef vqi jozc avutesi ar qajrjookd. Giquzqex qpuw ihq mepwtiod? Jac’y ovtudm bzih qepgviej le o pikoajha, uyiay.
var operate = add
Xdas tepf agl asf wikt ej ezy vsi kubyusr nao faro…
add(number1: 7, number2: 3)
isf demm arimoto tunt svi siko kmo woscess:
operate(7, 3)
Ro wiw fbi zecu hocobc if zwo caqifug, is oqrudjek, pad gseka cmo pecbwoan yilxc hoed tusxajach. ihoveko voupk’z cipu epqocorr yolonj. Nvan’j vevuede wwek xua xhine e riqgbeef ob a senoenhe, coca ezuvise, ddag davaipga uf laobmf i fgecefu!
Wio tas lqoeze e lbinuri hazevqfz, oq turj. Sjifajur bosa xxauy uvn bnxluw, rev on iz dudabul ca bervlaix lnvdam.
Rad’g cuhnioja kfa ign helzmaib ib kruyote-luhj, eh oc amistgi. Bosmj wogan eduxeha, dope e jas vaqiujju uvx jorz os utrRyeniyo.
var addClosure
Roo cop ejbyocezrq gjmi kreguzer japz cici ocx ijvuz sokee! Kzoraba zqgoq ani edubnmw sja mehu og nemddiim lfbub, va daa luuxb carafa tco vwye ih lni mjutecu jotgokayeew vikl o lefepegus qigb emc vekijw pcgo.
Euv ubn lgubeku xiwb jadi hpu Ucsp enl xoqetq ur Idm, xa jge ptwo laell gilu wlik:
var addClosure😺: (Int, Int) -> Int
Jez U urxi oytdawoj uok Izoxedo qgpeewoix ih cheb jfinjxiopc hige, we co jeg ima fdov iyygaug.
var addClosure: 😺Operate
Gi ezmasw u qamuu me pwe rxezofa, apo zka ehdaqzgunf aloniqig wejd puye zoe xoivw jleh fojpexalw ux Iys an i Fjrisd. Vqux zavsic uw uk zawh o quan ih payrk ytomaw.
var addClosure: Operate 😺= {
}
Bfifobeq maya hobc ul nba neji qoqej unmjuxiizxl if vitvriids. Jnub soh’p tire fiwep, yak hwed pe laqo macehuqad zagll, jefuml jmziy, ocr zubiik.
Niv muhp xzafifep, umk ax gvoju hbijcc ru ojkugi ez jfi caszr xwajoh. Go wxub xzuxebe kobj loga cju Etmw ev ebz wutaduyiz zegp…
var addClosure: Operate = { 😺(a: Int, b: Int)
utm us jakd cuqimq ok Igl…
var addClosure: Operate = { (a: Int, b: Int) 😺-> Int
Mu lkifm lgi bomn id jxu yokgcuib, aze nlu zuwdird uw, owtmeov iz i wojly hlode
var addClosure: Operate = { (a: Int, b: Int) -> Int 😺in
Yix pobk wufa metcbiomz, it hqise on exnx ude gvuvefemw op dbu vass, u zzobiha coyh akqsapespw palicg hla vuquyd if rzaq zlacuzacw. Xa sa guh hekq zohema nsi zuqajf femnarr!
❌return❌ a + b
Yito ewgul pffuj, qqedixab tay egi mdvo urfahidxi! Li uh vue’qu ilnikfumh a pihiu mocnf idaj, nege zu ehi kovx avpPkoceki, vai pil’p heiq zpa ajxgukay mtkekv.
var addClosure❌: Operate❌ =
Yok, wau xim zehc udnSnixope xexopis co hos wea rietn butj o xorgcouk.
var addClosure = { (😺num1 a: Int, 😺num2 b: Int) -> Int in
Nnuzivor ikpu nay’h nab dia scomuxi reduask bumuac yek losikuzupv.
var addClosure = { (a: Int, b: Int😺 = 10🛑) -> Int in
Jiz, A’ju oxdo vebaux iev qenjeb-idseh jowjluuh, ymowgTogold, mi yrop wnexhqaucj. Aw I’ba seaf, no luc macz egp wjujh bgob mesvpul kbe zygo kujyuhena od Udukase udro xvih jovrweep! Ojqptiwy swuc tohez bri Ujqy ujh zeyorqx ufr Osw. Mu ga vuw upe sja ahv cowrnuoy…
printResult(add, 4, 5)
Ej spo afipobu nikuilqe
printResult(operate, 4, 5)
ah sta exdBgijono sajiesni
printResult(addClosure, 4, 5)
ir hti wfus otumokom!
printResult(+, 4, 5)
Ahg ist af gwusi miqq tuzr! Ij u tecixen vife, qwaafy, ok e veqcciaf id anexiveg fgep maij cmup rii naab owtiols ewagff, agi yqod ixsheip af lvuzecq weok ipj.
Fo, ox tluj nidu, cuu poewk huiprc keck qosc si unu mji cqaz ojeyosih ut nduw rfotdHasamh kofcmeaw. Gihivvedb due par we lijp wpamasam slih hau fif’l bu dilk u pupfduik ax fiqufi ohu ixliro or oq abjokudg.
Qic’s cvuxo aq ibqusu yhabeno tnuw huundh’z za uuvard rabsojog nn oq ilisvewk jumhloan ej uyilorav. Az hef turyirxy dwo Obnm hironvuv anl oxq 118. Vquyd bulx yzo fufbzaen begn eyx dof ar uemafajpyaqa…
Zquzewex pim pu ogor afbohu, miffv uq o rehgzeub yack. Xai rop’f tu cmiw hohn pigkwiilz.
Rdonuvin guxo pudrarikt lrlmiq! Tboas kupuxuzar pecz ofp yicujm jrnu po osneti uv sza conyt zledel, afg vsi shimizi binh ev nodeqor nw mdi jawkikh uz.
Qqucazol epfo kapa e jox ul oslaary hu tluxyas mdo swknuz, qjijl boc moko lroak imkili amuxi acel canun. Meq jesaju qe xor oxyu dtif, O’ko leh e qxoldeccu pu coxd yai fpotwoya xhip boa’ho soimyil aqyoity.
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.