lundi 20 août 2018

Check Conditional against Date in swift 4

I need to be able to check a Bool Against the last day of the month.

Example : I want to see if little tommy's tasks are done by the end of the current month.

I have code for end of the month. Basically calling next month minus 1.

It's the conditional I need help on.

Thanks!

PsuedoCode

var tasks = true
var endOfDate = Date().lastDayOfMonth // extension I will write

If task == true && endOFDate == false {
   func tommyGetsMoney()
} else {
   func tommyinDeepDoodoo()
}

Help! Thanks!

Aucun commentaire:

Enregistrer un commentaire