mercredi 21 mars 2018

Comparing decimalValue to integer literal

I need to trigger several different notifications based on a specific condition which, in my case, is the number of steps done by a user:

if data.numberOfSteps.decimalValue < 200
            {
               // Build first notification type

            }else {
               // Build second notification type
            }

Even if the condition is satisfied, the code doesn't get into the "else" branch.

Any ideas why? If you have a clever way to trigger different local notifications depending on a condition, it is well appreciated.

Aucun commentaire:

Enregistrer un commentaire