[Solved] Getting the first date from what a user has selected
[ad_1] First you need to create an enumeration for the weekdays: extension Date { enum Weekday: Int { case sunday = 1, monday, tuesday, wednesday, thursday, friday, saturday } } Second create an extension to return the next weekday desired: extension Date { var weekday: Int { return Calendar.current.component(.weekday, from: self) } func following(_ weekday: … Read more