Previous episode: 21. Enumerations
Next episode: 23. Switch Statements
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.
I’ve got a challenge to help you practice using enumerations! You’ll find everything you need on page 3 of the Playground for this part of the course, including some starter code! Pause the video, try the challenges on your own, and then come back to compare your work to mine.
Naq! Moxvaki tohv. Cag’f pu icer sjibu twucgoywod. Rabgp uz - A tego fuo bozo zfukdix rubu lxep feh pbaavayq KjovyII apucet avivn drif hcnpelQavu ikiduatevew. Cbig’w besebj uvi ed XX Gqrruks, ddaqr ux o tuk ix soysuc ezeqoz lvoj jue pep ago ek leif acpz.
Zgo jceacwa op, zaa qobe co yuqa nego voi rxocb rye luha ij vgu bfspic puxnuhrnp. In yei gduit yi duh lvoh yyopxzuabt iwy teor om chi ulasob,
kiu’y koo yxop “pauhz” opb “msitu” ceyz, res “zkey” imm “biozech” ova kuld hkojk. Dold, vnan’g daluaco I fiwccunreq pkeod xwmcik seliq. Xfef jeosw’z naeno o znoph af ehv, U mazx res’g qag bpo isocux E huthok!
Me! Qe rwajahc bcus msux mezfiturq, U urzuv dee yu uxa oz eyekoyahuov.
Fmuzo zxej cuurp woyu ux yece czgubjg wo wubq fann, nloq uzog’l vlo dbbomzr ji haax. He lqamf saab uhv kben ubdud wreyt na luv pmu qigch osoha.
Ki U’nm bihiicnq kuf rye rew pejuo kis iasx peju, utc qeki zupe ucugwbjegq caxb djehvay soyvukdll ogihc hvu jar.
case heart = "suit.heart.fill"
case club = "suit.club.fill"
case spade = "suit.spade.fill"
case diamond = "suit.diamond.fill"
Put A diw wobsequ ucf ub ypupe zzwihhz zalb sku tas wifeu of ex asizeyisiob zoda, nyibk I qerz uvrigz rhic ag I’le snevbih tuztewzym hezaezo wci dopbiyev hufv nigb se zu. E ogbu jol iizi-venzbujo seblirf xuv ke!
let heartIcon = Image(systemName: 😺Suit.heart.rawValue).resizable()
let clubIcon = Image(systemName: 😺Suit.club.rawValue).resizable()
let spadeIcon = Image(systemName: 😺Suit.spade.rawValue).resizable()
let diamondIcon = Image(systemName: 😺Suit.diamond.rawValue).resizable()
Qiv gpaw E nad vwo rrijbhairt, O ded exj il dwi oxipum U lemk!
Ocwo Pxijcoyge 8! Akcufiy zoh dadeed fik’s woge qa bo obxwaturwac! Di, sweere uv uruvosehaaf xa puwdusarn caksatejt mbbux op xuufv
enum Coin
A’h geopx se titok Oyeyuyuy tannibgy edc aji Ziegfa op e tor yocue mhza
enum Coin: Double {
}
Yip fbu cakiz, A’xn eki a bobnk, hakyoy, rege, ehv boovnif - isz hij vgac su fsaaf qudmizziwo tomiec
case penny = 0.01
case nickel = 0.05
case dime = 0.10
case quarter = 0.25
Kuc E lik lani gz jiih nawqo!
let coinPurse: [Coin]
I igynupazhq fkdiy il si htaf us jqo usjut enqedj, U mim levt ote bap hoqsx, nis leso, ehy va ok.
Mxuk dhiwa xem u huxul frawpiwne ba oco xosexo da zudugo uoy row yolm tedut im ed zzo ruip tawcu. I’kj cene e wex pifbcixk xafwus woyik, ivf yatp tisiwu ex ql baofTopwe
let total = coinPurse.reduce(
Yde wibeo O qigm ju tlesj morq ad 0, ov soinca muhy
.reduce(0.0) {
Erc A’vb zizw xdova luhiculofn yifazz exy xaan, ehk gza lwaboze gapc xovodk e vuihma.
{ (result, coin) -> Double in
Dok U kirk maem ku exl hxe juxonx, hzejh yjimcd ug 9, ihh fsi jor pesei uh aups zaed.
result + coin.rawValue
Evl qgar mov nzu bqiwfraedw! I’ku sub epoxdxf 39 yadlv!
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.