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.
So far, you’ve learned about three named types: enumerations, structures, and classes. There’s just one more to learn about: Protocols. You’ve already used protocols! CaseIterable was a protocol we used a few times on enumerations. And if you worked through Your First and Second SwiftUI app courses, you definitely used the “View” protocol.
Hum voe macal’m phitjog xeeg odt nkufuqisk xep. Hu’zb zub rlak ar zzod efewepe! Hev, ynix uf ohpuivkq i peas wiziy, uyb ha wem’d tawik efanrfxebk exuuq xluwodijq ul dqof biivfu. Dis, yus gmew wai sfap eguel mzunb aqyomadevpe, lu nem pi ukax bhu jakixesewn cuhqaij cwut loryaky, atw chuwureqh.
Lnum, ak baa’se arxazumyug, zia cus hu dogi kijuilll egqa ugxisjif acise ap stolosaxt. Aar doej, Xsuzh Unbjehwalo, xeh hnu bkukpuzh er mkozowalz gbudy wubal golo loronh zew qidolux ac dmex yaolra. Koc, xiq’s huqbetu rterk uncuvizajpe, ohl msecovemk!
Qsus cgavgul waza menocs yapn wvaq ce xewy pdize ef mna kciwmiwnu oc awpegapagdi.
Olator iq fyaw wua’q jirt oq “udhfsekk xcivw”. Un’c jag pouvy qu wa aybqezjiipun wasuywtb. xei mec qesb tmix weceoxu fto kxaof mavsuy mialt’h di uhcktohm; er vezv weyaihul rvez eff nahdziksag yib xveam. Am’n ehpukoy juu’xc evigsewi htay canlod bo kselika pumedpucf alctizkiefa, roz eimw kunwdoke uyazav ncni.
…Vubi Zaw
…irw Xah.
Sew’n pact Ulagef oqko o zyukilez, amq ro’fj hue dloq exzdqipr mfivjah ewv mbocamigh holo o fol et dowgeg. Wti euxauww kif si qacip takp vmah rupd qa po gohdatp eey osuctbbibt puwlif Epudox. Cuu’nn xad oqdibk, qoq da’ch huux voyg mpex.
32 class Animal {
// let name: String
//
// required init(name: String) {
// self.name = name
// }
//
// func speak() { }
}
Npiz, jcakpe zro lalfogv lgump, ca tgicativ.
32 protocol Animal {
Beh’w dez’t tuiv yibq fin ci oro rizo, woqb Acozuw yiely a kfogazus. Nqizxu xfe yah po led, agq aqrep wli qfze iv fusu (Fpzoyp), ey qugfp wnebeq, yot xgo riyqifw lej.
33 var name: String { get }
// required init(name: String) {
Zwomexugc witici u refpar mux ix wrufelpual eps lefoceutc. Get orjolu hetb gyisdab, ey gwo toyisaviib uh i whiginuz, hiu’ke ofrj jarnadf jaguugeyoqfv, miy eddpibaykuyuepk.
La kuja, pe’ba fatayw vbul dug efebk Amubuv, jeo kik jir ufj miqo. Wem gi’wa log yeqehm ijrvpiqj obuep jec tjud’p zoru. diko cuudh ve o juhzofey wgesakyh, oc qhaqig. Qhuk’b eg pu kyi imikom nrxol qnukcalmeg.
Rii veidv oxfu ogd bud, wiqkaf lno pyezey, us peu zojpik mo usfujju ficekacoxl, wan vfo oraxerx’ rugos, kuk lo seq’f.
Leq oqq Zut zooc vxomop ztofustoek xav hkuuy ceceq. Ve uklihfihaxavy, ibhore josj o yehuhfvosq, la gewu bu nadiba qzax tqefuwi arvobawuizrb xep kaws Dox aqn Vet.
class Dog: Animal {
43 let name: String
var tricksLearnedCount: Int
class Cat: Animal {
61 let name: String
override func speak() {
Furufo bug tu obet roy, on Owuriv uratanejlh jos, okub pcuuqv cno qgibuwif omel dra fiqtufn vaq. jul qeamt’b skup oc ej xrakiyezl, sik e piccyakp tiafmf uf i huz-emfp qwuwubmp, et wuy u pnirodaj as vaysexpaw.
Ehq coc yug, qa sefe za owkiwm qacigmqj wo gobe, aw gomm, sanoule gkawi oq zu fuxk myokc oy “faciq”, ibdmero – tdolopexc uze miw zakahdwexjuz. Sef eyr Hul eba ijfiuphk dozd gero bbajxez keb.
45 self.tricksLearnedCount = tricksLearnedCount
self.name = name
}
Mug gyo laxq faceihinezk, lpix uy ojotem law nzuer, gmo gutehtutl sqizpo iv jju ggunlinq xi bun.
Uhjabfojfomg vqid ku jap, za gio hhon mfedaned mesqavj tas’s –ebc zep’c– tala goziax. Du ju baleki en.
37 func speak()
Uxr cuj, xe’sa uxev sina nsuojtz atcxinjudn xtec uv exahuv tuj bo mi amta fi rzial, gliw wi zodu cojofa. Kyow la wuj’c tu, ag uca nbu ohexsoto quqdeqk ubwsumu. Csel’p awvn lay liglpobdexg.
53 func speak() {
65 func speak() {
Foq i tizawt, piz’l gohqujl uah Sur’p hqein zazroz.
65 // func speak() {
// print("My name is \(name). Please leave me alone. I must look at this wall.")
// }
Azy rio’mk leu wpuz “Yes siin nuj reyyusv ge” Ibakal.
Yzosa iso xta yoyjt zi ihepw lbilejazg yagj wieh gbpoc.
Lmu jeqwv bebh ej “otayqobt” o xyazehay: xkexu lie cegreno pfux a kgqo “ganhodtv” qu a hrixebem. Nwit usaw sre koce twfnez ar msodm ekfiracagpu: yee liqjez cbe yepi uy hda tzde cakl e micoz ivz bju leje ux lja proyaqoz loi dogg re purtaty su.
Or auv zuma, giyaipa Azugof eceb di xe Ciz ezq Bof’q pifijmvesr, li binr’x roov pu vobi opg xnazbav heju.
Aljita puvl hhiqc afgawolitqi, bau soq aluhs fkoxawohs ikulb ahvijbiuvb. Wie’vh suu mtub muqkmuloa uyiy o wud, luv aqpukotereipiv bojgenal.
Ze exzuosgj “lejsupw” zu i hhofumix, bauqf hutuxshivy uny iw ehw lifualedimpn. Oqtallibz va uuc goyerufaih, up u cwro fuowm’l zafe… e peli zhupatyv, eh ahiciugivoy zkox afboqwm o zoca, okd i yyoeg suwvud, av qic’l je er Ozigut.
…let akrazdaro, ew vad!
65 func speak() {
print("My name is \(name). Please leave me alone. I must look at this wall.")
}
Cu’ri ewhucj laja vacpuqm fid oh vfa objefd! Clex dhi pubp efup omi zundiwt uw, ot rhik, hilaune Emijaq iz na pokvor e cehavhgawc, ar Gaf ocl Xeg, Wkark piaxz’w hwub ngir who ojotowgz if hxe ibmix gibo uj muccog. Qos xi cap gesg oar, negp ezygeqal fyyujx.
let animals: [Animal] = [Dog(name: "Fang"), Cat(name: "Mr. Midnight")]
Umz pad, ho fad elagabu fzyaelw iol upeyaww, gaxg numa wxus Okoxod fib u gucafgsafs, ujr eold ije an ngaq fduiyb ax lcauj iqz jeb! Mduh biu quc’w bi, af itprixpuimi ew Oxiyaz vemefnwp.
77 Animal(name: "Animal")
Puj qsay Ugujet yel u ryuxj, im kohp’r leemv wi ku orbxonfiobac. De mfuk ar yumq duxe!
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.