I have a survey form that appear only if the user still didn't answer survey every time the user launch the app. But even if I already answered the survey still its appearing. Here's how I'm doing it
//Get if questionaire is done
let defaults = UserDefaults.standard
if let questionaire_done = defaults.string(forKey: "questionaire_done") {
print(questionaire_done) // Some String Value
}else {
performSegue(withIdentifier: "questionaireSegue", sender: nil)
}
UserDefaults.standard.set("yes", forKey: "questionnaire_done") //set the questionnaire as done