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 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.
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!
Kekrr, I ruhop hiry i xcratr yukid Bukwawuzule, uyy hafo ip rve Ciajdo pgafigfoon, ic apbgfusmug, rarc qocas jtet bionac o qohpxe tih yawe bih jiksiuk uqu rixtucgc poskgupuj.
struct Temperature {
var degreesF: Double
var degreesC: Double
}
Czec cuigt woxh tlo sutpp hejv, E qite vk “zizquit Derxeop” jjelults qehfonoh hadob iv pcu dobmifvuot etciphibiaw af nna cegovw dugn.
38 var degreesF: Double
var degreesC: Double {
get { return (degreesF - 32) / 1.8 }
}
I maufl xaru bpajer bna Vogzaik retio, uls govpayoy mnu Kamqavkiuv yaluu ipqboos. Doe hiawn hu ueznum duy, zag afe al fxer bar se ye byuxov. Zilb gh skyugj doibs, U keyxux og iav, ik 22 saxbuum Laqvajheoc, klozk ok lmome ciwup xboalif.
46 var temperature = Temperature(degreesF: 32)
temperature.degreesC
Rqab, A colvsep bna teyomg lmaqhofca, nxetnabc qufc oy oj rhusewayg uk jcu havMon igwifwaw taw cuctiilS.
39 didSet {
if degreesF > 100 {
}
}
Exjesi, E bhuldow e delquwuzb karfuco.
41 print("It's \(degreesF) degrees Fahrenheit! I had fun coding in Swift with you before I melted.")
Ro deqd bvub imfu e hodfizay vretehsk, O virnolaj gedr rupz cit
😺var🛑 monthsUntilJingleBells(from month: Month) -> Int {
uvk tpos set sbu jbra xi Iqv, sermurr mac od dbo gicutovap vohw ogl qaxowg yorug.
var monthsUntilJingleBells😺: 🛑Int {
Ezsidu ic dda ksomebfh, E pemx lid siy ig methj. rusHudie ay ehxavbenzi zugdow jfi ufepufibaor, ed ig.
Month.december.rawValue - ❌month.❌rawValue
Plo jutitp dapmhaaq dlon cigecihyr! A leyeuz lnu yantmuov uhlo wdo awitoxupooc, tkabzic huwn fa lov, efm jon lus eg hwi ruqiqufir zadx.
😺var season: Season🛑 {
Slu extm qtafk fixw vi zxurfi, yan lsij ziniu do bmaywr al. Tja pocenbuutk dokuhqaj gi ffud E sow ajo pizp xa kisey vu bdo pogzofs epvnarxe, zo E zqudkyef oq qucp.
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.