Ray Wenderlich Functions and Types Course - Part 9
Five days between entries is not ideal! But I'm going to crack on. Will try to get 2-3 sessions in during the current week. Let's go! Start Time - 19:50 Installing additional components on Xcode as the mac system has been updated just now... CaseIterable - a protocol used so that you can then access the cases with more functionality. There is a lot going on here! enum Weekday : CaseIterable { case monday , tuesday , wednesday , thursday , friday , saturday , sunday func advance (by dayCount: UInt ) { let indexOfToday = Weekday . allCases . firstIndex (of: self )! } } Weekday . allCases var weekday : Weekday = . sunday So after the CaseIterable bit, we have a method (advance) within the enum. It is using Unsigned Int (UInt). That's supposed to be better as no negative numbers will be involved so this is apparently the better one to use. So even more technical.... enum Weekday : CaseIterable { ...