jeudi 12 décembre 2019

Swift not allowing if statement because it dose not recognize an variable that is defined in the if statement

I am trying to get the input of a text field so that if the user is the one that is allowed in then their user credentials can be matched to a folder that is in the cloud but swift is giving the error "expected declaration" but there is no variable that is undefined. if anyone can help me then that would be greatly appreciated.

if (username_Input) == ("tyler") && (password_Input) == ("1234"){
    user = ("Tyler_O'dell")
}

//this is for declaring the folder where all the adds are
var ImgRef: StorageReference {
    return Storage.storage().reference().child("Ad_Images/Ad_Images-\(user)")
}

//this is for declaring the folder where all the adds are
var Profile_image_Location: StorageReference {
    return Storage.storage().reference().child("Profile_Images/Profile_Images-\(user)")
}

Aucun commentaire:

Enregistrer un commentaire