I want to check if there is a value on a certain variable. If there isn't I want to return a default value. How is the best pratice of doing this?
I would like to do something like:
let defaults = Userdefaults()
if let name = defaults.string(foKey "name") {
return name
} else {
return "john"
}