generated from StanfordBDHG/SwiftPackageTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support CodableWithConfiguration when storing and retrieving from Loc…
…alStorage (#24) # Support CodableWithConfiguration when storing and retrieving from LocalStorage ## ♻️ Current situation & Problem As of know, we only support storage and retrieval using `Encodable` and `Decodable` types. iOS 17 introduced a new set of protocols: `EncodableWithConfiguration` and `DecodableWithConfiguration`. Instead of relying on the `userInfo` dictionary and runtime checks to ensure configuration is supplied on the call site, type can now strictly define a certain configuration type that has to be supplied when encoding or decoding. There is also a new [`@CodableConfiguration`](https://developer.apple.com/documentation/foundation/codableconfiguration) property wrapper that can be used to statically define configurations for nested types. To embrace these strongly typed configurations, SpeziStorage add support to accept types of these new protocols. We rely on the newly introduced `TopLevelEncoder` and `TopLevelDecoder` protocols introduced with StanfordSpezi/SpeziFoundation#15 to stay generic over the encoder and decoder. ## ⚙️ Release Notes * Support storage and retrieval of `CodableWithConfiguration` types. * Improved documentation. ## 📚 Documentation This PR reworks some of the documentation structure of SpeziStorage. Reducing some of the fluff and reorganizing the catalog a bit. ## ✅ Testing -- ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
- Loading branch information
Showing
12 changed files
with
181 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.