jeudi 4 mai 2017

Swift language if statements

//the StoredValues.() are all set to 0 though I am trying to make it to where a person is prompted if the count were to go below 0 (creating a register like application and need to make refunds)

if(StoredValues.currentChildCount == 0 && StoredValues.childStepperCount == 0 ){ StoredValues.totalChildCount != 0 && StoredValues.TotMones != 0 } else if (StoredValues.totalChildCount < 0 && StoredValues .TotMones < 0){StoredValues.TotMones != 0 && StoredValues.totalChildCount > 0}

    switch StoredValues.TotMones{
    case _ where StoredValues.TotMones < 0 :
        print(decisionText.text = nope)

    default:
        print(decisionText.text = ok)

    }
  // was unable to figure out certain portions such as making code that was:

    if(StoredValues.currentChildCount == 0 && StoredValues.childStepperCount == 0 ){
        StoredValues.totalChildCount != 0 && StoredValues.TotMones != 0
    } else if (StoredValues.totalChildCount !< 0 && StoredValues.TotMones < 0){StoredValues.TotMones != 0 && StoredValues.totalChildCount > 0}

    switch StoredValues.TotMones{
    case _ where StoredValues.TotMones !< 0 :
        print(decisionText.text = nope)

    default:
        print(decisionText.text = ok)

    }

Aucun commentaire:

Enregistrer un commentaire