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
@@ -77,10 +77,10 @@ There are [many ways to observe property changes](https://www.jessesquires.com/b
77
77
finalclassAppSettings: NSObject {
78
78
staticlet shared =AppSettings()
79
79
80
-
@WrappedDefaultOptional(key:"userId")
80
+
@FoilDefaultStorageOptional(key:"userId")
81
81
@objcdynamicvar userId: String?
82
82
83
-
@WrappedDefaultOptional(key:"average")
83
+
@FoilDefaultStorageOptional(key:"average")
84
84
var average: Double?
85
85
}
86
86
```
@@ -122,9 +122,9 @@ AppSettings.shared
122
122
123
123
### Supported types
124
124
125
-
The following types are supported by default for use with `@WrappedDefault`.
125
+
The following types are supported by default for use with `@FoilDefaultStorage`.
126
126
127
-
> [!IMPORTANT]
127
+
> [!IMPORTANT]
128
128
> Adding support for custom types is possible by conforming to `UserDefaultsSerializable`. However, **this is highly discouraged** as all `plist` types are supported by default. `UserDefaults` is not intended for storing complex data structures and object graphs. You should probably be using a proper database (or serializing to disk via `Codable`) instead.
129
129
>
130
130
> While `Foil` supports storing `Codable` types by default, you should **use this sparingly** and _only_ for small objects with few properties.
@@ -144,8 +144,8 @@ The following types are supported by default for use with `@WrappedDefault`.
144
144
-`RawRepresentable` types
145
145
-`Codable` types
146
146
147
-
> [!WARNING]
148
-
> If you are storing custom `Codable` types and using the default implementation of `UserDefaultsSerializable` provided by `Foil`, then **you must use the optional variant of the property wrapper**, `@WrappedDefaultOptional`. This will allow you to make breaking changes to your `Codable` type (e.g., adding or removing a property). Alternatively, you can provide a custom implementation of `Codable` that supports migration, or provide a custom implementation of `UserDefaultsSerializable` that handles encoding/decoding failures. See the example below.
147
+
> [!WARNING]
148
+
> If you are storing custom `Codable` types and using the default implementation of `UserDefaultsSerializable` provided by `Foil`, then **you must use the optional variant of the property wrapper**, `@FoilDefaultStorageOptional`. This will allow you to make breaking changes to your `Codable` type (e.g., adding or removing a property). Alternatively, you can provide a custom implementation of `Codable` that supports migration, or provide a custom implementation of `UserDefaultsSerializable` that handles encoding/decoding failures. See the example below.
0 commit comments