date - Swift 4 - set up a condition for each day of the week -
ok, let's want app randomly pick 3 days of week i'm supposed something. have randomly picking part worked out - can end array like:
thisweekspicks = [false, true, false, false, true, true, false]
or make dictionary has monday = true, tuesday = false, etc.
i have no idea start have if check on wednesday (any time on wednesday) app "not today" while if check time friday (or whatever) "yes, today must!"
i'm looking @ eventkit
seems lot more need - don't need add people's calendars. - getting me started awesome.
you seem describing this:
let thisweekspicks = [false, true, false, false, true, true, false] let d = date() let greg = calendar(identifier: .gregorian) let day = greg.component(.weekday, from: d) let ok = thisweekspicks[day] // false
Comments
Post a Comment