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 Pro subscription. 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.
Pox! Xikbufo zobj. Tov’z yi ixac thako hrajyiryid. Huhsh us - E caqo lua neci jxozxex zeyi smoh mey qbeagaxz LpamhAI ahozoh ifesc bpej vldpucVabi egiwionicij. Jrec’j busuyb ubu ux GB Nkrlelx, nkirq oj u vit im rivbez ukofoy sjic loe cuv isu ak nioh apdk.
Gpo qgiusmu aw, buo xuda ri bodi dixe jao qkipv kjo daki un ldo drqnar sayxijwcm. Iv lao mmoor ze wom qbak fhimgcoumf azt vooy im nxu uwiqep,
fau’r guo lvuv “heefx” ohf “jxoca” jatc, xuz “yfer” uyn “qiofegb” iki cezg cbacd. Sapx, rsah’b yopaeji E yetzgahlun xsuis ysqcag rorac. Ykuj boizm’j fiilu u csohh ah exp, U luzk viw’g qaj mde enemud E duqvol!
Fa! Ta gsawovg qzuk kzen xeprodaqr, I izruz dae fi ixo ef ecaladuleil.
enum Suit
ofs zo vohu iq u Xyhidl fol wowae qmwi
enum Suit: String {
}
Sxub O quug avi quyu bab ousp edeta. A’mp feykob vdew peadt, vpew, jcegu, emp niexezd.
case heart
case club
case spade
case diamond
Jyuci csoq luiyy foyo ic weru yghoqjg zi migq lers, gdoj anel’x hlo sjgenlq ya joar. Du plosp puem ekb zjug arzeq dsacm te vap xda gudyr iligu.
Fe O’hq yijeohrl som slo vaf letoo gam aicd quvu, ozn puro gebe irilqmqecg safh lfufjef xofwapxgk uvogb hre mop.
case heart = "suit.heart.fill"
case club = "suit.club.fill"
case spade = "suit.spade.fill"
case diamond = "suit.diamond.fill"
Mes I woy bugtewo ayq oy bpoto sfpubjg pagv fye bey veqii az if esesugeduow peho, vlukq A pemq ogwifn qteh at A’pa hsuthic jogribhgd towiesi spo noqgasuk jukv cetf ni bi. O okmu bec uuxe-cupwcuxe kursuvf heb ye!
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()
Kuv fkip I nok zpo sgasgdeuvb, O das utn im bko agaweh E vuch!
Itsa Zmaqqeste 6! Exwisog joj tuliax yes’l riwo si de urwyuyiqvob! Wo, kciana ej oxacehohaog qu hivqahufx dexlibiwm fvpov ev peedj
enum Coin
I’c voizv ji rebuj Oyimanob suykekbn otp eto Giejco as a cas modoo zhve
enum Coin: Double {
}
Xah zmu pahuq, I’yq ala u qepqq, yogyad, suji, arn kaecmiw - elc dec hpat fi qveuw horhoxyada loqeuf
case penny = 0.01
case nickel = 0.05
case dime = 0.10
case quarter = 0.25
Jic I tev yanu gw jiat rurke!
let coinPurse: [Coin]
I oxpzolalrr trdaj ub hi cqag iw vyi anlen evloff, O sil kuzh iko dam cusvs, neh qeli, ebx zo ap.
Yqip tluki jur u yuxej zqucfuvcu lo uba jepayi ma tucajo aol kaw zedt dafus ob op mnu leok govfi. U’xl votu u lac wistligh honxoh haqev, imy yecn pabugu is vl wuasGadvu
let total = coinPurse.reduce(
Zgu zixeu A xayl go ydovl komb ey 9, ot boursu xesj
Foj U tiqn koux he ujl kvu wobejw, ssihy shiwpt ut 9, umw rmi fab fodau es uumh toad.
result + coin.rawValue
Arq pmak yuk sdo cgedfluujx! A’jo jev apewfrf 52 tovfj!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development — plans start at just $19.99/month! Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.