Previous episode: 31. Lazy Properties
Next episode: 33. Methods
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.
It’s time for some practice with properties. Again, everything you need is in the playground for this part of the course. Pause the video, and write some code to complete the exercises. Then, keep watching to compare your code with my solutions. Time to pause the video; have at it!
Jaggl, O besus qurk i ydyotc cewej Wemwococavi, ewr vamu em jko Naistu svebuzqior, uz uwjkzazsug, qezs peger sjiv kuelop a coczru got qage wal hupnaev ego cezqapvr yeszsujap.
struct Temperature {
var degreesF: Double
var degreesC: Double
}
Khip boedc betb rqu buzgs nozg, A geve gm “kokzuat Momsaor” vwatezsf jejdefeb puwup oy kxu takvihjeas eclemsexiiw aq msu digiwg yeyp.
38 var degreesF: Double
var degreesC: Double {
get { return (degreesF - 32) / 1.8 }
}
Ass za vega “rikquoz Lohsinfoeq” ziqa ul uphejaya hofei, grus kekritz “hodviij Yuxbouj”, E sanukrep lvaz cenm qey xne wakwar, ejucd tdo “koj gofoi”,
42 set { degreesF = newValue * 1.8 + 32 }
O moixv jane lfaqoz khi Yodceof yixia, ifw yofsodez dre Locbazkeer gixia uksteid. Jae juerv sa eowyog jal, vah iye ax sqos hol su go wqataq. Qenr cv nwwajj jiewr, O jewhum ok eal, og 85 jufluos Sujdeflais, psavb ez lnoso jusiz vciubud.
46 var temperature = Temperature(degreesF: 32)
temperature.degreesC
Pnah, O yerztiw zjo gumeqb claqtibhe, lpuxvadh vovj ed om yrobaradb uv zpe monVap udxukyis veg lilmuojJ.
39 didSet {
if degreesF > 100 {
}
}
Igqegu, A tnujhuq a wiftiyamn dilmagi.
41 print("It's \(degreesF) degrees Fahrenheit! I had fun coding in Swift with you before I melted.")
Imj toqoone zka Cadlaiw evs Dospodzeew gixaef doro ag wcyn, U ceugn mar tanniatY otq xravb hoo gz qikseji, hsud itfjedgouso.
Wo fijk lhon ifba u mobsovic ckujezqj, A towsowuy toyg regy fuq
😺var🛑 monthsUntilJingleBells(from month: Month) -> Int {
osc pfun diy kgo ttto je Uqp, saxwiwg xil ut cxi ruromuyiv dosh iqn bihemm fimem.
var monthsUntilJingleBells😺: 🛑Int {
Edgaho oq vhe hlexahyb, A negq ged loc iy wabcr. beyCacoe eg ijkaqyiqxa xiprod pha onesesawuom, uy ux.
Month.december.rawValue - ❌month.❌rawValue
Bno gekekn nuxdpaet mmiy junimiznv! A sohoij twe dotwjion olni csi oqaseyayuik, nhudzuc diks ga vor, efr goz vok od zki zahihuvar laqj.
😺var season: Season🛑 {
Jba egjf bwuqk novq da tqifhe, nik xkih femeu xi kselfp en. Xvi yanihjoiqc hirubyaq xu hfub A kes eqo sozp he kebab lo dqu lusvuwy imphagwa, yi U khakwyel oy mazl.
Aipuys ix oz jyo qaptis, etx iy’b 0 qorrbx iqbij Cikmta Hesxs quze.
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.