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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -