Minor release
An error message was updated, see below for details.
What's Changed
- Enhance constructor error message in case the default value is missing by @PierreMardon in #31
Full Changelog: 1.0.1...1.0.2
Details
Declaring
@PDefaults("user.wallpaper")
var wallpaperData: Data
resulted in the error:
'init(_:suite:behavior:)' is unavailable: You can use PDefaults only types that either conform to Codable or are natively handled by UserDefaults
but the obvious mistake here is that there's no default value, being it implicitly nil
(in case the intention was to use an optional type).
I couldn't manage to discriminate between the cases "valid type, missing default value" and "optional invalid type, no default value".
Thus the error message covering these cases is now:
'init(_:suite:behavior:)' is unavailable: You have to provide a default value or use an optional type. In the latter case, make sure the type either conforms to Codable or is natively handled by UserDefaults