You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
I am using the set() function in a template like this:
@propertyWrapper
struct UserDefault<T> {
let key: String
let defaultValue: T
//let defaults = KeychainWrapper.standard // this gives compiler error "No exact matches in call to instance 'set'"
let defaults = UserDefaults.standard // this works OK
init(_ key: String, defaultValue: T) {
self.key = key
self.defaultValue = defaultValue
}
var wrappedValue: T {
get {
return defaults.object(forKey: key) as? T ?? defaultValue
}
set {
defaults.set(newValue as T , forKey: key)
}
}
}
When using UserDefaults the code compiles, when using KeychainWrapper it does not. Could you please have a look into that issues ?! Thanks and regards
Christian
The text was updated successfully, but these errors were encountered:
chnbr
changed the title
Problem with .set in template
Problem with set(...) in template
Dec 27, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I am using the set() function in a template like this:
When using UserDefaults the code compiles, when using KeychainWrapper it does not. Could you please have a look into that issues ?! Thanks and regards
Christian
The text was updated successfully, but these errors were encountered: